We need to fire a set of tags after 30 seconds on the page, how do we set it up?

Gold Contributor
Gold Contributor

Hi

 

I have read this solution:

https://community.tealiumiq.com/t5/Developers/How-do-I-set-a-tag-to-fire-after-30-seconds-on-the-pag...

 

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); }

 

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 the above 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?

 So we just fire a time based utag.link with UID's and timeDelay value of (5/15/30) and the tags still abides by rules for pages to fire on.

 

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

1 REPLY 1

We need to fire a set of tags after 30 seconds on the page, how do we set it up?

Tealium Employee

Hi @samrat_dsouza

 

So, short answer is, please speak to your Account Manager to get an enhancement logged for this functionality.

The best thing to request, would be both time based firing, and also ordered firing of tags, i.e. Tag 1 has to of fired before Tag 3 can fire.

 

1) There are solutions around this, however, most either involve firing mulitple tags that aren't covered by the load rule, or having a lot of controling logic that we don't have in the utag.

If you really want to go this route then I would suggest talking to your AM about getting an update to your utag.js file done. However this wouldn't be offically supported, and you would have to re-apply the changes every time you upgrade your utag.js

 

2) This is maybe the best of the suggestions. What you can do is have scoped extensions, that will cancel the request and then pass the current object into a setTimeout, calling the tag.

 

if (a == "view" && b.page_name == "some page name" && typeof b.fire_tags == "undefined") {
  (function(_data, _id) {
    setTimeout(function() {
      utag.view(_data, null, [_id]);
    }, 5000);
  }(utag.handler.C(b), id)); 
  return false;
}

3) You could have it as a custom tag, you would need to do is use the send function as a trigger for the timeout, calling another contoller method that will do the tag logic for you.

 

Hope this helps,

 

Adrian

 

 

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Public