This Q&A comes from some recent optimization work I’ve been doing for a client.

I’ve been examining page load times, plugins, server quality image size and several other things that load how fast a website loads. Along with this was the scripts that load on a page, and Facebook Pixel.

Don’t leave! I know I said scripts and your eyes glazed over, but the question, “Why isn’t my Facebook Pixel loading” or getting me the data I should be getting prompted a deep dive into what the page was loading.

The Facebook Pixel works by inserting a script onto a page, and then reporting back data when that script loads.

We found there were a lot of scripts on this page, including two different Facebook Pixels, which at first thought in the troubleshooting stage, that seemed like it had to be it. This seemed especially true because even more confusing was that one of the pixels was loading, but the other wasn’t.

Facebook Pixel Helper

How did I find this out, apparently Facebook has made a Google Chrome extension for investigating just that, here’s their Facebook Pixel Helper extension.

With this installed, I could see feedback on the pixels on the page and what was happening, which showed one loading and one not loading.

So we moved onto testing, I removed one script and tested it again, hmm still didn’t load. Replaced the one I removed and added the other back in, it worked!

Hmmm…

So it was that particular script…odd but making progress.

Minification, the Culprit

In the end, it took re-arranging the sequence of scripts and thinking back to the optimization that had been done, and actually turning off an optimization feature called minification so that the pixel scripts were not combined with other scripts to load as one block of code to resolve the issue.

One of those things that only gets discovered by attention to detail, and deep dives into a website.

This was of course enabled earlier to speed up the pages overall loading time.

So, after re-arranging the scripts, using the Facebook Pixel Helper extension, and turning off the minification of scripts, the answer was uncovered.

Fixed

Now, both pixels are loading, reporting their data back to Facebook and the client is happily getting the ad feedback they need.

More work will likely be done on the page speed optimization, but due to their specific mix of needs, script minification will have to be handled carefully.

Questions about Facebook Pixel, page optimization or scripts to make your website better?

We love answering questions for free!