Home > Paid Traffic Sources > Facebook & Instagram

How to prevent overtracking by FB Pixel? (15)


12-25-2020 06:56 AM #1 revale (Member)
How to prevent overtracking by FB Pixel?

Hi,

my FB results stats are usually almost twice as high as the actual conversions. So far I could get around that issue by filtering for "unique purchase" which used to fairly accurate.

But for 2-3 weeks now even the "unique purchase" tracking is higher than the actual conversions. From my site were no changes made.

I just have a my pixel on the TY/upsell page. There are multiple pixel IDs in the same pixel code but that wasn't a problem in the past.

The current pixel code looks like this

Code:
<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', '740xxxxxxxxxxxxx');
  fbq('init', '345xxxxxxxxxxxxx');
  fbq('init', '872xxxxxxxxxxxxx');
  fbq('init', '659xxxxxxxxxxxxx');
  fbq('init', '391xxxxxxxxxxxxx');
  fbq('init', '145xxxxxxxxxxxxx');
  
  
      fbq('track', 'Purchase');
</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=740xxxxxxxxxxxx&amp;ev=PageView&amp;noscript=1"></noscript>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=345xxxxxxxxxxxx&amp;ev=PageView&amp;noscript=1"></noscript>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=872xxxxxxxxxxxx&amp;ev=PageView&amp;noscript=1"></noscript>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=659xxxxxxxxxxxx&amp;ev=PageView&amp;noscript=1"></noscript>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=391xxxxxxxxxxxx&amp;ev=PageView&amp;noscript=1"></noscript>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=145xxxxxxxxxxxx&amp;ev=PageView&amp;noscript=1"></noscript>
Are there any "tricks" to get more accurate results?


12-25-2020 02:50 PM #2 jeremie (Moderator)

You can use the Pixel Helper extension to check your pixel implementation:

https://developers.facebook.com/docs.../pixel-helper/


12-26-2020 12:52 AM #3 revale (Member)

Quote Originally Posted by jeremie View Post
You can use the Pixel Helper extension to check your pixel implementation:

https://developers.facebook.com/docs.../pixel-helper/

The pixel is set up correctly.


12-26-2020 08:37 AM #4 jeremie (Moderator)

Here are a few options, if you want to keep the pixel on the thank you page
https://funnelboom.com/the-duplicate...w-to-solve-it/

(I would start with the cookie solution, or the GTM cache if you fire FB pixel through GTM)

You could also fire the pixel from the backend, and not on page view. See my post in this thread:
https://stmforum.com/forum/showthrea...Your-FB-Pixels


12-27-2020 08:30 AM #5 nickpeplow (AMC Alumnus)

I’d suggest you implement the pixel using google tag manager. You can set the tag firing trigger to only let it fire once. If you have any sub pages, you can include the same tag so it’s got a second change at firing.

I find it’s more resilient than the usual fb implementation


12-28-2020 02:54 AM #6 revale (Member)

I have set up GTM with FB Pixel to fire once. I hope that does the trick.
Click image for larger version. 

Name:	4.png 
Views:	23 
Size:	5.1 KB 
ID:	24498


12-28-2020 02:56 AM #7 revale (Member)

Click image for larger version. 

Name:	4.png 
Views:	12 
Size:	90.4 KB 
ID:	24499


12-29-2020 03:39 PM #8 revale (Member)

In my test today I had 15 real conversions but FB still tracked 22 "unique purchases". Seems like GTM isn't the solution. I'm wondering why because GTM was set to fire the pixel just "once per event". Does it still fire a second time when the user reloads the page?


12-30-2020 12:45 AM #9 jeremie (Moderator)

You configured GTM to fire once per event. And the event trigger is a page view, so FB pixel is triggered once per page view, which is the exact same situation as when your pixel was hardcoded on the page. Not surprising it did not improve.

Look at your server log to check the number of page views during that period, to see if the problem comes from here.

Then, look at the solutions i mentioned above (easiest one being with cookie).


01-03-2021 05:23 PM #10 zeno (Administrator)

Try setting the GTM tag to "once per page" rather than once per event, see if that makes it more reliable.


01-14-2021 01:01 AM #11 revale (Member)

Quote Originally Posted by zeno View Post
Try setting the GTM tag to "once per page" rather than once per event, see if that makes it more reliable.
That also overtracks.


01-14-2021 08:29 AM #12 zeno (Administrator)

Here's an idea:

1. Rewrite your FB pixel code to fire the FB purchase event, then update URL to add a query string param of done=1 or any other value.

2. Wrap the purchase event in an if block that checks if done exists, and if so, do nothing. This way if the event has already fired it will not re-fire, not unless the user reloaded the page AND removed done=1 from the URL.

I'm a JS noob but something like this might work:

Code:
var searchParams1 = new URLSearchParams(window.location.href);


if(searchParams1.has("done") == false){
    console.log("firing FB pixel event");
    var url = new URL(window.location.href);
    url.searchParams.append('done', '1');
    history.pushState("", "", url);
}


I tested and it seems to work, just replace console.log with the fbq.purchase event.


01-14-2021 12:17 PM #13 jeremie (Moderator)

Quote Originally Posted by revale View Post
That also overtracks.
I gave you several ideas a couple of weeks ago, notably to use a cookie and check its value before firing the pixel. Have you tried to implement them?


01-27-2021 11:29 AM #14 revale (Member)

Quote Originally Posted by jeremie View Post
I gave you several ideas a couple of weeks ago, notably to use a cookie and check its value before firing the pixel. Have you tried to implement them?
Hey, sorry hadn't logged in here for some time. Yes, I checked it out a few times actually. Thanks again. At the end what fixed the problem was removing the other pixel IDs from the pixel and have just 1 per TY/upsell page.


02-15-2021 03:53 PM #15 laurentjm (Member)

By the way - you could add a transaction id / event id to the code in order to deduplicate the purchase events.
facebook does the deduplication automatically.


Home > Paid Traffic Sources > Facebook & Instagram