Facebook Time on Page Custom Event Recipe for GTM

This free Google Tag Manager recipe creates a Time on Page Custom Event for your Facebook Pixel.

This time on page data can then be used to create custom remarketing audiences in your Facebook business manager.

The tag will send a trackCustom event called Time On Page to Facebook every 10 seconds for 2 minutes.

In fact you can even see for yourself on this page using this Facebook Pixel Helper!


This can be useful to help distinguish users with high vs low intent in your remarketing audiences.

All GTM accounts have the ability to import containers within GTM > Admin > Import Container.

We recommend testing this in preview mode from your GTM account first before publishing to production.

What’s Inside this Recipe

You’ll find (1) tags, (1) triggers, and (1) variables.


How to Modify this Recipe

You can change a few things with this:

  1. The event name that is sent to Facebook. Our example has “Time on Page” as the event name and “time” as the parameter
  2. The timer trigger. You can change from 10 seconds (which is 10000 milliseconds) to any frequency. You can also modify the total # of times this executes. Our container has 12 (2 minutes) by default.

Here’s the tag:


And here is the trigger:


Download Facebook Time on Page Recipe

NOTE: Always merge these containers when importing into GTM. Never select overwrite! 

Download Facebook Time on Page GTM Recipe

Click to download this container to import into your own GTM Account.

Create Audience in Facebook

Once you’ve implemented and published this tag then you will begin to push event data into Facebook.

Inside of your custom audiences you now have the ability to use this event as a filter!

It’s quick to create and setup:


You can combine with URL and any other event filters as well.

(“Elevar”) is strongly committed to protecting and respecting your privacy rights.