Reply
Highlighted
Visitor
Posts: 35
Registered: ‎09-22-2015
Accepted Solution

Trouble with multiple load rules

We are facing an issue with tag firing which are having multiple load rules.

Here i am talking about two separate set of load rules used for the same tag.

Sometimes tag fires for the urls mentioned in the older load rule and the newly implemented load rule doesn't get executed and sometimes the newer one gets the preference.

I know that if we have multiple load rule then it acts as an "AND" operatot between those two but then what if i want that tag to be fired for all the urls mentioned in both the load rules. the reason behind creating two load rules is because both of them are having their own specific date range to run for, a part of which overlaps.

due to this we faced issues like tag drop/not firing for intended urls.

Need more clarity on the multiple load rule mechanism.

Reply
0 Kudos
Occasional Contributor
Posts: 120
Registered: ‎12-11-2015

Re: Trouble with multiple load rules

[ Edited ]

Have you considered shifting the complexity out of the Load Rules and into Extensions, @shailesh_gaikwa?

So you could in theory create a single, simple load rule, based on a new UDO element called "fire_my_tag", whereby the tag loads if fire_my_tag is set to 1.

You could then use either Set Data Values extensions and conditions, or otherwise a JS extension (scoped to "Before Load Rules" execution), to set the value of fire_my_tag, which would give you more control and transparency around exactly how that is set:

 

utag.DB("Tag30: Checking for qualifying date periods");
if( b.current_date >= period1_start_date && b.current_date <= period1_end_date ){ utag.DB("Tag30: Period 1 active"); if(period1_url_list.indexOf(window.location.pathname) >= 0){ utag.DB("Tag30: Period 1 URL matched"); b.fire_my_tag = 1; } } else if(b.current_date >= period2_start_date .....


Or something along those lines. You can then use the built in TIQ debug function to track how the logic is unfolding in order to test that it's behaving in line with expectations. Also, by using a custom "current date" variable from the UDO for your comparison, you can have a play around and override it to simulate different dates for testing without having to meddle directly with the code.

 

Visitor
Posts: 35
Registered: ‎09-22-2015

Re: Trouble with multiple load rules

[ Edited ]

Thanks @UnknownJ.

i would like to understand that if we have two load rules set up for the same tag then in an ideal scenario how does that perform?

What is the order of operation when it comes to those two load rules and how Tealium reads/treats that tag with multiple load rules.

Reply
0 Kudos
Super Contributor
Posts: 161
Registered: ‎11-15-2015

Re: Trouble with multiple load rules

Hello shailesh_gaikwa,

If there are multiple load rules applied to a tag that they use "and" as the operator then condition would see if all the condition should match for the specific rules. If we switch this to "or" operator, then condition would match with "OR" condition. See below example which used "AND" & "OR" conditon for your perusal:

Pathname, hash and query string based load rule

I presume this might helpful additionally to conclude your ques. Happy learning!!! Hope it helps!!!

Tealium Employee
Posts: 417
Registered: ‎09-01-2015

Re: Trouble with multiple load rules

@shailesh_gaikwa you might be interested to take a look at this "Product Idea" https://community.tealiumiq.com/t5/Product-Ideas/1-tag-and-multiple-load-rules-with-quot-OR-quot-con...

I'd encourage you to vote on it if this feature is important to you :-)
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Occasional Contributor
Posts: 120
Registered: ‎12-11-2015

Re: Trouble with multiple load rules

[ Edited ]

If you want to follow the code through, @shailesh_gaikwa, the way TIQ works is that first, all load rules are evaluated and stored in utag.cond, with each load rule ID corresponding to a flag that stores whether or not the conditions were met.

When you add multiple load rules to a tag, that tag will only fire if all the load rules are satisfied. In the code, that's expressed along the lines of:

tag.send = utag.cond[10] && utag.cond[12];


So if you have two date ranges, and two lists of pages, only dates that are in both ranges and sites that are on both lists would qualify using multiple load rules.

Visitor
Posts: 35
Registered: ‎09-22-2015

Re: Trouble with multiple load rules

[ Edited ]

Thanks @UnknownJ,

this is what i was looking for clarity.

 

Now i understood how multiple load rules are trated.

 

Thanks again :)