Highlighted

How to stop Tealium within an All Tags Extensions if I want to abort a utag.view or .link Event?

loldenburg
Contributor
loldenburg

I know we can stop a certain tag from firing by scoping an Extension to Tag X and have this Extension return false.

But how do we do this for ALL Tags?

The use case is:

A client's website keeps firing utag.view Events at some points where those should not be fired. Waiting for the release to fix this will take months. We send those Events to all kinds of tools. 

We can identify the false events easily (they are Cart View Events even though the user is not in the Cart), but how can we tell Tealium "stop execution for all Tags" in an All Tags Extension? Returning false in an All Tags Extension does not abort execution for All Tags like it does when it is scoped to a certain tag.

So in short: We COULD create an Extension like that and scope it to all tags manually by adding in all the tags in question, but that seems like a waste of code (the extension code is then duplicated for all those tags) and it is also less sustainable as new tags would not be part of the Extension and we would have to think about adding them each time we create a new tag.

There must be something more elegant.

4 REPLIES 4

How to stop Tealium within an All Tags Extensions if I want to abort a utag.view or .link Event?

UnknownJ
Occasional Contributor
UnknownJ Occasional Contributor

My suggestion here:

https://community.tealiumiq.com/t5/Tealium-iQ-Tag-Management/Hard-coded-UID-value-in-utag-view-call-...

Would work for this.. You could put a wrapper around utag.view, effectively replacing the function, and then conditionally abort it (i.e. fail to call utag.track) if the conditions for "do not send" were met.

How to stop Tealium within an All Tags Extensions if I want to abort a utag.view or .link Event?

loldenburg
Contributor
loldenburg
That's slick, thanks a lot! However, that is quite a brutal method to override standard Tealium functionality for this simple purpose I have in mind. Tealium Developers of the future may hate me for such a hack... So I will look out for something less invasive.

How to stop Tealium within an All Tags Extensions if I want to abort a utag.view or .link Event?

JohanAlm
Occasional Contributor
JohanAlm

Hi @loldenburg 

I had a similar situation only from the Tealium SDK in Android App. We kept getting double server calls where one is "utag.view/link" and the other is "remote_api". These extra calls are for the Tealium TagBridge and unless you need them should be ignored. No tag was firing based on this call but it did pass through all our code and in some cases causing extra increase to counters since two server calls contains the variableX++ and so on. 

The solution here is similar to what you want to achieve for a tag scoped extension where you can return false. More or less it looks at the call and determines if it should be used or thrown. Here is the code I am using:

if(typeof(window.oldTrack) != 'function') {
    window.utag = window.utag || {};
    utag.oldTrack = utag.track;
    utag.track = function(a, b) {
        if (a == "remote_api") {
            return;
        } else {
            utag.oldTrack(a, b);
        }
    }
}

Test it thouroughly before using to make sure it isn't causing anything unexpected. Even though my setup is for App, I expect it should be possible to use on a web setup as well.

 

How to stop Tealium within an All Tags Extensions if I want to abort a utag.view or .link Event?

loldenburg
Contributor
loldenburg
thanks @JohanAlm, this is great feedback. I still would like a solution that does not require overriding native Tealium functions, but it seems this is the only way to do it.