Back

The following Extension delays firing of a Tag by 1 second. Note that only the Tag this Extension is scoped to will be delayed.

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

What may be new is the "id" data point. This 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 will fire.

a = event (i.e. "link" or "view")

b = the data layer for current link or view call

id = the UID of the tag