How do you check your load rules are working?

Silver Contributor
Silver Contributor

Hi

I have been tasked with auditing Load rules on tealium IQ i was wondering how does everyone else do it?
Is there a script or a browser extension ? or simply visit the pages or try and trigger the load rules and look in the console?

8 REPLIES 8

How do you check your load rules are working?

Gold Contributor
Gold Contributor
Hello @dsavvy83,

The easiest way to find where load rules are is to search utag.js for the condition that one of your load rules uses. Depending on the version of utag you are using, you should find code like this;

utag.loader.loadrules = function(_pd, _pc) {
...
c[6] |= (d['userAgent'].toString().toLowerCase().indexOf('chrome'.toLowerCase()) > -1)
...
};
You can put a breakpoint on the condition line. Note that this line may be executed more than once during the page load, and during subsequent view and link calls, depending on your set up.

Also note that userAgent is not a built in data source variable. So, to use it in a load rule, I created a Set Data Value extension for All Tags, that runs Before Load Rules, that sets the data source variable userAgent to the JavaScript snipper navigator.userAgent.

If you are running earlier than version 4.38 of utag, Before Load Rules is not available. You can do a similar thing using a Preloader extension in that case, using this kind of code;

window.utag_data = window.utag_data || {};
window.utag_data.userAgent = navigator.userAgent;

source:https://community.tealiumiq.com/t5/Tealium-iQ-Tag-Management/How-to-debug-load-rules/m-p/17623#M5736

Hope it helps!!! Happy Learning!!!

How do you check your load rules are working?

Tealium Expert
Tealium Expert

On a given page, @dsavvy83, you can determine whether a particular load rule evaluated to true or not as follows:

window.utag.cond[loadRuleId]

Or for a particular tag, you can determine whether its load rules evaluated to true as follows:

window.utag.loader.cfg[tagId].send

For my own part, when I had to do load rule auditing, I set a UDO variable to equal a serialised version of utag.cond which I then mapped into my Web Analytics tool, meaning I could create a report which at a page level listed all the load rules that passed. So anyone could look at a specific URL and see which load rules fired all the time, which fired none of the time, and which fired something in between.

How do you check your load rules are working?

Tealium Expert
Tealium Expert

Hi @dsavvy83,
If you haven't already, just install the Tealium tools Web Companion and checking for example load rules on a per page basis is a simple task.

Instructions how to install it in your browser is here:
https://community.tealiumiq.com/t5/iQ-Tag-Management/Web-Companion/ta-p/11947

How do you check your load rules are working?

Moderator
Moderator

OOOOOoooo @dsavvy83... I'd accept that as an accepted solution! #JustSayin #toodles

If you liked it then you should have put a kudo on it!

How do you check your load rules are working?

Silver Contributor
Silver Contributor

Hi @per_lundqvist,
I had a look but the load rules tab on my web companion doesn't appear!

How do you check your load rules are working?

Silver Contributor
Silver Contributor


currently just working through Srinivasan solution, as it makes the most sense to me!

How do you check your load rules are working?

Tealium Employee

@dsavvy83

May I suggest this Tealium Tool: https://community.tealiumiq.com/t5/iQ-Tag-Management/Tealium-Tools-Web-Companion/ta-p/18523

It is a more advanced version of the standard web companion, it shows additionally the load rules that have been triggered.

Adrian

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

How do you check your load rules are working?

Silver Contributor
Silver Contributor
Thanks adrian, that's exactly what i wanted!
Public