How do I set a tag to fire after 30 seconds on the page?

wayne_krowitz
Not applicable
wayne_krowitz
I want to fire a tag after a user has been on the page for 30 seconds.
6 REPLIES 6
Highlighted

How do I set a tag to fire after 30 seconds on the page?

andrew_rose
Not applicable
andrew_rose
Wayne, Is this going to be on all pages, or only on a specific/few pages? Also, is it only one tag or all tags? Andrew

How do I set a tag to fire after 30 seconds on the page?

wayne_krowitz
Not applicable
wayne_krowitz
Hi Andrew - Thanks for jumping in here! It will be on a specific page and for multiple tags (but not all). Pretty much going to be one tag load rule applied across multiple sources.

How do I set a tag to fire after 30 seconds on the page?

jared_hislop
Employee Emeritus
jared_hislop

Hey Wayne,

 

You've got a couple options here. Both are somewhat technical given this is an uncommon use case, but feel free to reach out to your Account Manager for help setting this up.

 

Method 1: In the latest version of the utag.js file, we have added a "Wait Timer" that tells determines how long the Tealium Library should wait before it begins loading the tags. This timer begins at DOM Ready and is counted in Milliseconds. It also applies to ALL TAGS on the page.

 

To implement this:

 

1) Update to latest utag.js file. Be mindful if you're currently using a version before 4.26.

2) Add a JS Code extension in Tealium and scope that extension to PreLoader. Add the following:

 

var utag_cfg_ovrd = {};

utag_cfg_ovrd.waittimer = 5000; // delay 5 seconds before loading any tags

 

You can also add a "if" statement around this to make it page specific:

 

if(b.page_name=="some page name"){ var utag_cfg_ovrd = {}; utag_cfg_ovrd.waittimer = 5000; // delay 5 seconds before loading any tags }

 

Method 2:

 

On the page you would like this to happen we can add an extension that suppresses specific tags from firing. Then we would add a utag.view() call to trigger them after 30 seconds.

 

To implement this:

 

1) Add a JS Code Extension and scope it to the tags you want to suppress for 30 Seconds. Add the following to the extensions:

 

if(a=="view" && b.page_name=="some page name" && typeof b.fire_tags=="undefined"){ return false; }

 

Change the page condition to match the page where this should load. Leave the "b.fire_tags" condition in place. That is what will be used to trigger the tags.

 

2) Add another JS Code extension and scope this extension to DOM Ready. Add the following:

 

if(utag_data && utag_data.page_name == 'some page name' && typeof b.fire_tags=="undefined") {

 

// Set the fire tags variable utag_data.fire_tags = 1;

 

// Trigger the tags 30 Seconds after DOM Ready setTimeout(function() { utag.view(utag_data,null,[1,2,3]) }, 30000); }

 

In the code above, change the Array of UIDs (i.e [1,2,3]) to the UIDs of the tags you want to fire after 30 seconds. This will ensure that only those tags are triggered and none else.

 

Hope this helps.

How do I set a tag to fire after 30 seconds on the page?

wayne_krowitz
Not applicable
wayne_krowitz
Thanks a lot for your help. will need to get some assistance with the coding element but it all makes perfect sense to me. Method two will be the one required as it allows us to pick specific tags from firing for 30 seconds (whereas method one applies to the entire page). Regards, Wayne

How do I set a tag to fire after 30 seconds on the page?

jared_hislop
Employee Emeritus
jared_hislop
Wayne, The tag will only fire if the user is still on the same page. If the user navigates away the tag will not fire.

How do I set a tag to fire after 30 seconds on the page?

samrat_dsouza
Silver Contributor
Silver Contributor samrat_dsouza

Hi

 

We have a simialr scenario, however we have many requests coming in for multiple pages to fire tags after 15seconds and 30 seconds.

 

e.g.

Tag1 fires on page2 after 15 seconds

Tag2 fires on page2 after 30 seconds

Tag3 fires on page1 after 5 seconds

Tag4 fires on page1 after 30 seconds and so on... another 10-20 tags of simialr config.

 

Though second method is best but it would take a lot of effort to make one and maintain them in future. it would get messy soon and slow down execution.

 

 

Has there been any development where each tag has it's own wait timer functionality?

1) Is it be possible to fire a time based, utag.link with UID's which still abides by Load rules, than ignoring it?

 

Or

 

2) Can we create an extension and scope it to certain tags, all it does is wait for certain seconds before loading themselves as per the load rule?

 

Or

 

3) As all the tags are of a particualr vendor, can we add it as a custom tag and add a delay within the tempelate itself?

 

Thanks

Sam