The following JavaScript code delays firing of a tag by 1 second. Place the code in a JavaScript extension and scope the tag this extension is expected to be applied. The UID of the tag will need to be entered, replacing 'id' in the utag.view call below. 

// JS Extension - Scope to the tag(s) that you want to delay
var localDataObject = utag.handler.C(b);
var timeout = 1000; // 1000 ms
// Halt initial tag load and run delayed version instead
if ( !b.tag_delay && a == "view" ){. //"a" can equate to "view" or "link"
  setTimeout( function(){ 
                  localDataObject.tag_delay = true;
utag.loader.cfg[id].load = 1 ; utag.view(localDataObject, null, [id]); //update the "id" to the specific id you would like }, timeout ); return false; }

The "id" data point is in the family of "a" and "b" variables that Extensions have access to. That means the id of the Tag this is scoped to is passed to the utag.view call and only that Tag(s) will fire.

"a" is the Tealium event (i.e., "link" or "view")
"b" is a copy of the data layer for the current link or view call.
"id" is the UID of the tag. If multiple tags are scoped, enter those as a comma delimiter list (e.g. [4,13,45,78]).
To alter the delay, change the value set to 'timeout'.

Scope the extension to "All Tags - Before Load Rules"

Screen Shot 2020-10-27 at 11.42.10 AM.png

Remove the null and the IDs in the call if you want to have the time delayed for all tags, e.g., utag.view(dataLayer); 

Version history
Last update:
‎11-06-2020 02:40 PM
Updated by: