window.fireflag

Bronze Contributor
Bronze Contributor

I am trying to troubleshoot a custom javascript tag but can't figure out what window.fireflag does.

 

   if(!window.fireFlag){
   (function() {
   dataLayer.events.listener.listen('eventName', function(eventData) {
   window.fireFlag = 1;
   utag.link({...call goes here... });
   }
   });

 

Any idea as to why window.fireflag is needed? Tried searching online but can't find any reference to it anywhere. Is it a custom Tealium Window Object?  I think it helps avoid multiple utag calls? but it also seems to disable further utag.link calls from other extensions within the same page...

 

Any insight would be appreciated.

 

Thanks

5 REPLIES 5

window.fireflag

Tealium Employee

Hi @corzop,

 

You're exactly right, the  fireFlag variable is being used to determine if the tag has fired already if it has then don't run the code again.

window.fireflag

Bronze Contributor
Bronze Contributor

Thanks @simon_browning.

 

So is fireFlag a Tealium custom variable? Just want to learn compatibility of it between tags and extensions and how to work with it. Seems like two extensions on the same page with that code each will only execute the first one (since it only runs the code once, regardless of its container) 

 

Also, what is the difference between using fireflag and Scope Execution Run Once after/before Load Rules? 

Any documentation on fireFlag anywhere?

 

Appreciate any light or knowledge you can shed on this.

Pablo 

 

 

 

 

 

 

 

window.fireflag

Tealium Employee
Hey Pablo,

It isn't a Tealium variable as such, it is just a javascript variable that is being used to record when the code has been called to prevent it from firing multiple times.

If two extensions both used this flag only the first would ever work as the flag would be set. Using the run once is doing exactly what the fireFlag is doing but isolated to just that extension and is the method I would recommend.

window.fireflag

Bronze Contributor
Bronze Contributor

@simon_browning Thanks for the insight.

 

Will try the 'run once' approach and see what happens.

 

Thanks,

Pablo

window.fireflag

Gold Contributor
Gold Contributor

Hello @corzop,

You can use run once or I would recommend to use eventprobagations to run once approach.

Hope it helps!!

Public