In this guide, we’ll show you how to build higher-quality audiences in your Facebook Ads by delaying your Facebook Pixel and eliminating bounced users from your audience.
This tutorial will explain:
- Why you should delay firing your Facebook Pixel
- How to create a base Facebook Pixel Tag
- How to delay a Facebook Pixel event
- How to set a Tag’s firing priority
- How to create a Facebook audience
Why Should You Delay Facebook Pixel?
Delaying the Facebook Pixel from firing immediately when a user enters your website will filter out any user who isn’t really interested in what you have to offer.
Sometimes users click on links accidentally, or click a link thinking it contains different content than it actually does. These users typically leave the website immediately (we call this a “bounce”).
This is totally fine—not everyone on the whole internet is part of your intended audience. However, it could be a problem if these users become part of your targeted audience for marketing campaigns.
These users are not promising leads, and it could be a waste of your resources to target them. Instead, you should focus your efforts on users who are genuinely interested in your website or business.
If you want to optimize your audience for retargeting purposes, you might want to focus on users who have been on your website for more than a few seconds.
We can implement such a delay with the help of Google Tag Manager and create a Facebook audience of people who have stayed at least five seconds on your webpage.
Delaying your Facebook Pixel will give you a better quality audience by excluding those who have clicked on a link by mistake, or just closed the page immediately and didn’t have the chance to even look at the page.
Then, you should hopefully get better results by advertising to a better quality audience.
🚨 Note: If you use The Facebook Pixel and haven’t integrated Google Tag Manager yet, be sure to check out our Facebook Pixel Tracking with GTM guide.
Creating Your Base Facebook Tag
Let’s begin by creating our base Facebook Tag. This Tag will load the Facebook Pixel library so your pixel can record other Facebook events.
For this, let’s create a new custom HTML tag in Google Tag Manager.
To create a new Tag, click on Tags, then New.
Make sure to give your Tag an informative name. I like to use CHTML for “custom HTML” to describe the Tag type, then the tool and the scope or function of the Tag. In this case, I’ve named this Tag CHTML – Facebook – Base Pixel.
Since there isn’t an official integration for Facebook Pixel Tags, we’ll be making a custom one using the Custom HTML tag type.
Next, go into your Facebook Events Manager account on a separate tab and grab your unique pixel code. (You can find it under Set Up → Install Pixel → Manually add pixel code to website.) You can just click on the code box to copy the whole snippet.
Then, paste this pixel code into the HTML field of your new Tag.
Since we’ll need this base Tag to fire first to track any other Facebook events, we’ll want it to fire on all pages across our website.
To do this, we’ll scroll down and click anywhere in the Triggering field, then select the All Pages trigger for this Tag.
Finally, click Save. We’re almost done with this step, so let’s test our Tag to make sure it’s working properly.
Testing Your Base Pixel Tag
Click Preview to enter Google Tag Manager’s preview and debug mode.
While in preview mode, navigate around your website. If everything is implemented correctly so far, your CHTML – Facebook – Base Pixel Tag should fire on each webpage.
I also like to use a browser extension called the Facebook Pixel Helper, which shows here that a PageView event has fired. This is the Tag that we just installed, so we know that the Tag is firing properly and will be sent to our Facebook Ads account.
Creating Facebook Event that Fires 5 Seconds After Page Load
Now that we have a base Tag that will load our Facebook Pixel library, we can create more customized event Tags to collect better data.
Next, let’s create a custom event for this Facebook Pixel that fires five seconds after the page load. This accomplishes our goal of tracking only users who are interested in our website and excluding users who bounce.
There are two main steps to this process.
First, we’ll need to create a timer trigger that will wait for five seconds before firing our Tag.
Second, we’ll need to build a new custom HTML Tag that will track a specific Facebook event without bogging down page loads with extra code.
Create GTM Timer Trigger
To create a new custom trigger, click on Triggers inside of Google Tag Manager and click on New.
We want to create a trigger that fires five seconds after the page loads.
There is a built-in trigger inside Google Tag Manager that can help use accomplished this called the Timer trigger.
The field Interval determines how long the timer will wait after trigger to fire a Tag. To achieve a five-second delay on our Facebook Pixel Tag, enter 5000 milliseconds in the Interval field.
If no Limit is placed on this trigger, then it will fire a Tag every consecutive interval. In this case, the Tag would fire again every five seconds.
We only want to fire our Tag once per page, so set the Limit to 1.
Finally, we need to set the conditions for this trigger. This will tell the trigger when it should start its timer.
We want this trigger to fire on all pages, so we’ll set the conditions to Page Path / matches RegEx / .*. The dot-star ( .* ) in regular expression notation means that any value will be considered, so the timer will begin on any page on this website.
Finally, don’t forget to give your trigger an informative name—Timer – 5 Seconds is pretty self-explanatory—and Save it.
So with these settings, we have a timer trigger that fires just once after five seconds on all pages. This is perfect for tracking pageviews from users who don’t bounce.
Build Custom HTML Facebook Tags
Now, let’s create a Tag that uses our new trigger and fires a custom Facebook event.
Go to Tags, then click on New.
Let’s give this Tag a name to distinguish it from our base Tag. I’ll call mine CHTML – Facebook – 5 Seconds.
Click in the Tag Configuration field, then choose the Custom HTML tag type.
And here we need to type exactly like this:
<script> fbq('trackCustom','5 Seconds'); </script>
Next, we’re going to attach our five-second timer trigger to this Tag that we’ve just built.
So this piece of code fires five seconds after each page load.
Click Save—now we’re ready to test our new Tag!
Testing Your Delayed Pixel Tag
We’re almost done with this Tag. Our last step is to test it in the Google Tag Manager preview and debug mode.
Enter preview mode on your website. Your base Facebook Pixel Tag should still fire right away when the page loads. Then, after five seconds, you should also see your five-second timer event Tag. This should occur on any page across your website.
If you check the Facebook Pixel Helper, you can also see that the PageView has fired and also our 5 Seconds event.
Finally, we should also make sure that our Facebook Ads account is receiving the correct data from these Tags.
In your Facebook Events Manager, go to Test events. Under the Receiving activity list, you should see events for both your base Tag (Page view) and for your timer Tag (5 Seconds) on each page you opened while in GTM preview mode.
If you want to test this more carefully and see results in real time, you can also click Clear Activity, refresh your webpage, and come back here. You should see the list populated with data from first your base Tag, then your timer Tag.
Setting Tag Firing Priority
There’s one more step that we should take to ensure that our implementation is airtight.
We want to make sure that our base Tag always fires before the timer Tag, no matter what else happens on the page load. This is because without Facebook library initiating from the base Tag, the timer Tag will not successfully send information to our Facebook Ads account.
In Google Tag Manager, click on your base Facebook Pixel Tag.
Under Advanced Settings, find the field labeled Tag firing priority. The higher a Tag’s firing priority compared to other Tags, the earlier it will fire (the default is zero). Any value greater than zero will ensure that this Tag fires before our other Tags.
Then, find the dropdown options under Tag firing options. Here, we want to select Once per event. Finally, click Save.
Creating Facebook Audience in Facebook Pixel Interface
Finally, we can create an audience made up of users tracked by our timer Tag for remarketing purposes. These users are some of the best leads for targeted remarketing since we already know that they’re interested in our website.
In your Facebook Events Manager, click Create Audience.
Choose the Facebook Ads account where you’d like to create an audience.
Choose the correct pixel that is tracking your new events.
Then, we can create an audience of people who have stayed for at least five seconds by selecting for users tracked by our 5 Seconds event.
We also need to determine how long users stay in this audience after being tracked by this event. Remarketing works well within a short timeframe, so I’ll set this to one week.
Finally, give the audience a name and click Create Audience.
With this custom audience, you can target users who were interested in your website with your remarketing campaigns.
🚨 Note: If you’re getting errors in your Meta Pixel, make sure to check out our handy guide on how to fix Meta Pixel errors.
So there you have it. This is how you can delay your Facebook pixel to build a higher quality audience.
Check out our guide on Facebook Pixel Purchase & Conversion Tracking with GTM which also improves your ability to track more qualitative data.
Have you already tried delaying your Facebook Pixel firing with Google Tag Manager? How do you optimize your remarketing audiences? Let us know in the comments below!