Reply
Highlighted
Visitor
Posts: 7
Registered: ‎03-05-2018
Accepted Solution

Use Load Rules with utag.view() for Specific Tags

Hello,

I want to fire certain tags under certain conditions, for which I can use utag.view() with an array of UID. However, a side effect of passing in the array of UID is that load rules are ignored. I don't want the load rules ignored. I want them processed. Essentially, I will have two layers of conditional execution. After the condition is met to fire utag.view(), I want individual tags to fire only if load rule conditions are also met.

How can I do this? Can I use utag.track() and pass in the load rules as part of the config object?

Thanks.

"If it sounds good, it is good." - Duke Ellington
Reply
0 Kudos
Tealium Employee
Posts: 16
Registered: ‎09-07-2017

Re: Use Load Rules with utag.view() for Specific Tags

Hi @powem

Here is one possible approach:

// 8 and 9 are the load rules IDS
var load_rules = {8:0, 9:0}, 
      tag_ids = [];

// update scope load_rules
utag.loader.loadrules(utag.data, load_rules);

// start building the IDS collection
if (load_rules[8]) 
    tag_ids.push(345); // where 345 is the tag id for load rule with id 8

if (load_rules[9]) 
    tag_ids.push(43);  // where 43 is the tag id for load rule with id 9

// send tracking
if (tag_ids.length > 0) 
    utag.link({}, null, tag_ids)

 

Visitor
Posts: 7
Registered: ‎03-05-2018

Re: Use Load Rules with utag.view() for Specific Tags

Very clever, thank you.

Like many good ideas, it seems obvious - once you've shown it to me.

I really appreciate the help.

 

 

"If it sounds good, it is good." - Duke Ellington
Reply
0 Kudos