How to get a Facebook Pixel to work with GoDaddy Website Builder

I don’t generally use GoDaddy Website builder. As a web developer, I opt for more powerful and customizable tools like WordPress, however, today I had to install a Facebook Pixel for an advertising client that built their own website on GoDaddy Website Builder.

At first, this seemed like an easy task. I was able to navigate to site settings and use the “Site-wide Code” function to paste the Pixel javascript into the header. I saved and published and the pixel showed up in the source! Unfortunately, it didn’t actually function. I used Facebook’s pixel Chrome extension to test and while it was recognized it was not sending a PageView.

Instead, I got an error:
The Facebook pixel code on this page didn’t load, so no information was sent to Facebook. Learn more

This error was not terribly helpful and nor was the documentation. It suggested there may be some sort of a problem with a button event, well, I didn’t setup a button event. I spent more time than I should’ve trying to debug and I discovered if I did add events things start work… sort of.

Eventually, after much testing I discovered the problem. GoDaddy Website Builder minifies the HTML and javascript. This is great except when it does it the minification tool doesn’t remove Javascript comments within<
tags. The Facebook Pixel code comes configured like this:

Notice the link:

There is a comment

The GoDaddy minification system minified the code and turned it into a single line of Javascript. This resulted in the next line of code

Being commented out

Removing this internal comment from the Facebook pixel code solved the problem and everything worked as expected.


You may also like...

6 Responses

  1. Cody says:

    What exactly did you take out of the code? I keep trying and it slows down my website immensely and still doesn’t track correctly

  2. Kelsey says:

    Was in this same exact position and couldn’t figure out what went wrong. Thanks so much for the insight and troubleshooting help!

  3. Lynn says:

    Thanks for the solution!

  4. Mike says:

    Dude…Thanks a million. I was a bit frustrated and you solved it. Thank you.

  5. Eden says:

    Wow….I have been troubleshooting this for over 6 months now. Thank you so much for this post. Most said it wasn’t even possible on Godaddy!

Leave a Reply

Your email address will not be published. Required fields are marked *