Regular expressions not working for a load rule to fire a tag

shailesh_gaikwa
Visitor
shailesh_gaikwa

I need to fire a particular tag in case of only events occuring on the site.

In that too there is a condition that i want that tag to not fire on few events and it can be fired for rest all.

We capture all the events values in "EventType" variable.

I am using the following load rule for that tag as - 

EventType is populated AND

EventType does not contain EventValue1|EventValue2|EventValue3

but it is not working and tag doesn't fire for any events on the site.

can someone help me understand how i can use multiple values in that condition to check the load rule and it should work?

7 REPLIES 7

Regular expressions not working for a load rule to fire a tag

VIP
VIP VIP

Hi @shailesh_gaikwa  - it seems that you would want to actively debug this to see what's happening on the page. Check out the documentation here (via search results) on how to set the debug cookie so you can watch the code execute and determine how to address the issue.  You will want to open utag.js in the browser Sources tab, enable Pretty Print and set some debug breakpoints to see what's happening.

Regular expressions not working for a load rule to fire a tag

GavinAttard
Occasional Contributor
GavinAttard Occasional Contributor

Hi 

THe multiple value exclude is always a tricky one, and the reason for its failure is that the condition 

Is it possible to set the condition in the reverse manner?

Is popualted and contains....

 

 

Research your Experience | Improve and Evolve | Leave no one behind

Regular expressions not working for a load rule to fire a tag

shailesh_gaikwa
Visitor
shailesh_gaikwa

Hi Gavin,

to use the condition in reverse manner i will have to add 50+ such event values in there.

Which will be too much ask to do from configuration and also from testing poin of view.

Isn;t there a way that this works?

any regular expression which can be used in this case?

Regular expressions not working for a load rule to fire a tag

Tealium Employee

Hi @shailesh_gaikwa,

have you tried splitting it out like this:

 

EventType is populated AND

EventType does not contain EventValue1 AND

EventType does not contain EventValue2 AND

EventType does not contain EventValue3 AND

I'd expect that do what you're looking for if I've understood your issue correctly, and it has the advantage of being easier to manage than regular expressions - hope that helps?

Best
Caleb

Highlighted

Regular expressions not working for a load rule to fire a tag

shailesh_gaikwa
Visitor
shailesh_gaikwa

Hi @calebjaquith ,

I used your solution and it did work for me :) thanks for the solution

I have a query though - need little clarity for my understanding -

when we put AND condition then it means that tag will only fire if all the conditions are met in the AND clause, right?

then how come this worked because all those event values are not fired in the single call?

When we say EventTypeValue1 AND EventTypeValue2 AND EventTypeValue3 means if the value of events has all three then only it will fire but we are passing individual values per event then how come it worked?

Regular expressions not working for a load rule to fire a tag

Tealium Employee

Hi @shailesh_gaikwa 

glad to hear it's working!

Since you're using AND, the rule will only evaluate to TRUE if all of the component conditions evaluate to TRUE. 

Here are three cases to illustrate what's happening when TiQ evaluates the Load Rule:


CASE: EventType value is "EventType4"

Condition Result
EventType is populated TRUE
EventType does not contain EventValue1 TRUE
EventType does not contain EventValue2 TRUE
EventType does not contain EventValue3 TRUE

> Evaluates to TRUE, tag will fire. 


CASE: EventType value is "EventType2"

Condition Result
EventType is populated TRUE
EventType does not contain EventValue1 TRUE
EventType does not contain EventValue2 FALSE
EventType does not contain EventValue3 TRUE

> Evaluates to FALSE, tag will not fire. 


CASE: EventType value is ""

Condition Result
EventType is populated FALSE
EventType does not contain EventValue1 TRUE
EventType does not contain EventValue2 TRUE
EventType does not contain EventValue3 TRUE

> Evaluates to FALSE, tag will not fire. 


Does that help?

Best
Caleb

Regular expressions not working for a load rule to fire a tag

shailesh_gaikwa
Visitor
shailesh_gaikwa

It makes total sense :)

 

Thanks a lot @calebjaquith