- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
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.
Solved! Go to Solution.
03-06-2018 12:39 AM - last edited on 03-06-2018 07:02 AM by kathleen_jo
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.
03-07-2018 12:00 AM - last edited on 03-07-2018 07:03 AM by kathleen_jo
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.
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:
I presume this might helpful additionally to conclude your ques. Happy learning!!! Hope it helps!!!
03-07-2018 07:22 AM - last edited on 03-07-2018 11:17 AM by kathleen_jo
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.
03-20-2018 04:33 AM - last edited on 03-20-2018 06:57 AM by kathleen_jo
Thanks @UnknownJ,
this is what i was looking for clarity.
Now i understood how multiple load rules are trated.
Thanks again :)
Copyright All Rights Reserved © 2008-2023