Highlighted

How to execute a custom tag before any other default tags (such as GA, Chartbeat, etc) is executed?

Rookie Contributor
 
3 REPLIES 3
Highlighted

How to execute a custom tag before any other default tags (such as GA, Chartbeat, etc) is executed?

Employee Emeritus
Hi Siegert, thanks for your question. A quick question, do you want to make sure the tag is loaded first or that the request the tag makes is made first? The reason I ask is that the new utag.js will ensure that tags are loaded in order (and their requests will fire when ready) but they will fire their request as soon as they are ready. So, by upgrading you can control the order in which the tags are loaded but they will make their requests whenever they are ready. For example, if you have tag 1 loading first and tag 2 loading after, if tag 2 completes first it will fire its request before tag 1 has completed even though it was loaded after. You can upgrade here: https://www.evernote.com/shard/s142/sh/5f2f2116-93dd-4616-9008-df90a569b784/7c63df3be74247592c19f3ed... You'll notice the new utag.js is a lot faster and you can read about it here: https://community.tealiumiq.com/posts/726815 If you want to make sure the actual request is made first I don't believe there is much we can do but hopefully this will meet your use case?
Highlighted

How to execute a custom tag before any other default tags (such as GA, Chartbeat, etc) is executed?

Rookie Contributor
Tx Roshan. Actually what we want to do is next: there is still some hardcoded tags (GA, Chartbeat, ComScore, CIM) on the site, but because of the complexity of the site, we can not really identify on which pages the hardcoded tags are still present. Therefore we are writing a custom script that will detect the pages where the hardcoded tags are still on, and send this info to a logfile. For GA, the script will focus on "_gat.bb", so this means that the GA tag via Tealium can not be triggered before our custom script has been activated and has run. We will do a test by moving our custom script to the top of the list, and set the wait flag to No.
Highlighted

How to execute a custom tag before any other default tags (such as GA, Chartbeat, etc) is executed?

Employee Emeritus
Hey Siegert, Ah. I see. In this case you could set your custom tag to have a 'wait flag' of 'no' in the advanced settings. This way, your tag will fire before the DOM is ready (by default all tags wait until the DOM is ready before firing) so it should fire first. Maybe give that a go? If that doesn't work, as a workaround you could always run your tag as an extension scoped to 'Pre Loader'. This way, it's the first thing Tealium will run (even before load rules and extensions). Maybe try that?