Megan Perry-Thibault
Megan Perry-Thibault

Reputation: 33

Facebook Pixel not firing on all pages

I have Facebook Pixel installed on a client's site but am running into a really weird issue.

I have the standard tracking code on the header for all the pages of the site.

<script>!function (f, b, e, v, n, t, s) { if (f.fbq) return; n = f.fbq = function () { n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments) }; if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0'; n.queue = []; t = b.createElement(e); t.async = !0; t.src = v; s = b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t, s) }(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', 'xxxxxxxxxxxxx'); fbq('track', 'PageView');</script> <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=xxxxxxxxxxxxx&ev=PageView&noscript=1" /></noscript>

And it's tracking pageviews correctly on almost every page, however, it is not tracking them on every page. When checking it with Pixel Helper I get the "We detected event code but the pixel has not activated for this event, so no information was sent to Facebook" message.

Further troubleshooting has led to three discoveries:

  1. The pixel fires just fine on the subpages of the errant pages.

Example: clienturl.com/shop/order/products is not tracking page views but clienturl.com/shop/order/products/product is.

  1. If I drop a Content Viewed event onto the problem pages, it tracks just fine. (This is my current work-around but is not sustainable long term).

  2. Moving the tracking code for page views into the body rather than the head of the page does not fix the issue.

Does anyone have any experience with this happening that might be able to say why it's doing this?

The website is built on Sitefinity v11 for reference.

Upvotes: 0

Views: 1429

Answers (1)

BJC
BJC

Reputation: 1

a good couple of years late but leaving this here for someone who comes across this same issue for WordPress (but I assume the same logic applies for any site).

Short answer came down to caching. Had to clear the Page's cache on the WordPress instance itself in order to get it to work using the option "Clear this cache" (Possibly a plugin option) when hovering over the page in the admin portal.

Hope this helps.

Upvotes: 0

Related Questions