If you own a digital agency or are a social media professional who creates content for your clients, this is for you. Marketing today is…
In this post, I'm going to show you how to create a custom Facebook pixel event based on the time spent on your website (all pages or a section of your website). This event will help you better track, optimize and target those who spend the most time on your website.
This is a big deal. It's more than just creating a personalized audience for those who spent the most time on your website, as is already easily possible (top 5%, 10% and 25%). It offers a greater granularity of that audience, but two of the most important capabilities of this approach are through measurement and optimization for this type of visitors.
This post will be thorough. I will go through even more details in my next Facebook Pixel masterclass (the first lesson is free). Go here to sign up!
The problem: low quality traffic
The foundation of my marketing strategy is driving traffic to my website. I use organic content, email updates and Facebook ads to send a steady stream of people to my site. This is where my funnel begins, where I hope to bring them to my email list (usually through a free offer) before making a sale with a single product and hopefully as a continuous affiliate.
The quality of this funnel depends on the quality of the initial traffic. If my website is flooded with low quality visits (usually reflected by a quick exit), the other efforts will fall apart.
I became more and more skeptical about the results I saw from traffic campaigns promoting blog posts. Landing page views optimization. I would occasionally see results that were too good to be true. After digging further, the culprits were usually the source country or location (the audience network almost always sends low quality traffic).
Why is this happening? Simple: Facebook cares about volume and cost without caring about quality. They do not hide from this fact …
When you optimize your landing page display (after clicking on your ad, website, and uploading Facebook pixels), Facebook will try to give you the most LPVs for the lowest cost. It doesn't matter if they are three-second or three-hour views. Facebook doesn't care.
It may not matter when it comes to sales. A $ 100 sale is a $ 100 sale. But there is a huge variation in the quality of a landing page view.
The solution: The Facebook Pixel event for the time spent
We want Facebook to track, report, optimize and even target based on the time spent on our website. We can force Facebook to take care of the quality of the traffic I send.
By creating a Facebook pixel event to create a visit log based on multiples of 30 seconds (30, 60, 90, 120, 150 and 180 seconds), we can then do the following specific things:
- Create Custom conversions based on these events
- Add columns to our ad reports for the number and cost of these events for a clearer view of your ability to drive quality traffic
- Optimize for any of these specific events to focus on directing and leading high quality visits
- Create personalized web audiences of those who performed these events for high quality targeting
A member of my team did this for me using Google Tag Manager. I will go through the specific steps so that you can do the same.
Add the basic Facebook pixel
I guess you have the base Facebook pixel code already installed on your site. Anyway, let's get through this.
We do this inside Google Tag Manager. Although there are likely ways to do this elsewhere, the variables and triggers provided by GTM facilitate execution.
1. Create a label and name it "Facebook – Basic Pixel".
2. Choose "Custom HTML" as the tag type under Tag Setup.
3. Paste the base pixel code in its entirety into the HTML text box. Below is an example, but you should use your own unique code for your ad account.
4. Under Trigger, we want to run our basic pixel code on all pages of our website.
Keep in mind that I will not have the events we create to run on each page (it's up to you). But the basic pixel should absolutely.
Create a trigger
We want Facebook to pull an event every 30 seconds that a visitor is on a page.
1. Create a new trigger in Google Tag Manager and name it "Blog – 30, 60, 90, 120, 180 seconds."
2. Select the "Timer" trigger type.
3. For the interval, use 30,000 milliseconds (3 minutes). You can use a different range if you want.
4. Set a limit of 6. Again, this is optional, but in my case I wanted to record events at 30, 60, 90, 120, 150 and 180 seconds.
5. The page path setting contains "/ blog /". I decided to focus only on blog posts, but this is optional again. You can skip this step and it would run on any page.
We need the pixel to record the number and range of the event so that it can be executed in the label (appears). So we need to create two variables in Google Tag Manager.
1. Create a variable named "DLV – gtm.timerEventNumber" using the data level variable type. Use the variable name of the data layer "gtm.timerEventNumber."
2. Create a variable named "DLV – gtm.timerInterval" using the data level variable type. Use the variable name of the data layer "gtm.timerInterval."
Create a label
Now, we'll create a new tag in Google Tag Manager that will refer to the trigger and the variables we just made.
1. Create a new tag and name it "Facebook – Blog – 30 seconds or more." Of course, your name belongs to you.
2. Use the custom HTML tag type.
3. Paste the following code into the HTML text box …
It should look like this …
4. In Advanced Settings> Tag Sequencing, check the box next to "Trigger a tag before Facebook – Blog – 30 seconds or more."
5. Select the "Facebook – Basic Pixel" tab under configuration.
6. Under Trigger, select the trigger you created earlier.
Test your event
Let's make sure this event works. In Event Manager, select your pixel and click Test Event on the left.
Open a separate window or tab and go to a page on your website where this event should start. Wait a minute and it should appear in this window.
You can also use Facebook Pixel Helper to test in the same way.
Create custom conversions
We've created custom conversions for each of the six interval timer events that should shoot.
1. Instead of "All URL traffic", select "Block tracking" in Custom events.
2. Click to add a rule.
3. Instead of "URL", select "Event parameters".
4. Select "Page Time" as the custom setting.
5. Enter "30 seconds" next to "Equals".
6. Name it, select a category (probably "Other") and set a value (probably leave it blank).
7. Repeat for 60, 90, 120, 150 and 180 seconds.
You can test these custom conversions just as you tested your event. You should also start seeing activity in your custom conversion list.
Add columns to your ads
This is the information you should monitor in your advertising reports, especially when driving traffic to blog posts. To do this, click Customize Columns …
Then find your new custom conversions and check the boxes to add them to your report.
Optimize for high quality traffic
If you normally run campaigns to promote your blog posts, let's do it a little differently.
First, use the Conversions goal, not Traffic.
When you set Ad Delivery Optimization to your ad set, select one of the custom conversions you created.
Feel free to experiment with different time intervals to see if it affects your results.
By setting up campaigns this way, Facebook will try to show your ads to the people most likely to click and spend 30+ seconds on a blog post.
Create custom audiences for websites
As you probably know, there are already ways to target some of the highest quality visitors to your site. You can aim at the base time spent on your website…
You can also create audiences of people based on the number of PageView events…
And now we can create audiences based on these new events that we have created …
While the Time on Site audience will allow you to reach those who have spent the most time on your site, and the PageView audience will allow you to target those who have viewed the most pages. focus on those who have spent a certain amount of time on any blog post.
Facebook Pixel Masterclass
I will go into detail on this topic (and many more) in my future Facebook Pixel Masterclass. We will talk about everything from the basics to the most advanced. I hope you will join!
This approach changed my advertising on Facebook. It gives me a much clearer view of the quality of the visitor I lead and allows me to optimize for that type of visitor. This isolated audience also gives me an option to target a small, valuable group.
Are you doing something similar? What do you think?
Let me know in the comments below!