Expand my Community achievements bar.

Allow boolean logic/containers for firing conditions within DTM

Avatar

Level 5

9/11/15

Currently, all conditions specified on a DTM rule must be met in order for the rule to fire. 

 

So, if I want to fire a metric or a rule on a certain set of pages within DTM, and they don't have one single common value, I either need to use regex matching on the same exact data element, utilizing the "OR" operator to match multiple values, or I need to set up multiple rules. This becomes very painful when I also then need to ensure that the rule doesn't fire twice, by also adding regex to the second rule to make sure it wasn't already matched, and ti also means that I need to remember to update all of my rules by hand whenever I want to add a new analytics value or trigger a new script on those pages.  

 

For a concrete example, let's say I want to set the "Channel" value based on either URL matching or a data element (defined by, say, a JS value.) Right now, I need to match based on the URL bit, then copy my rule and change the condition to match on the data element. And now that it is a copy, all future changes need to be updated in 2 places. What I would like to do is match on EITHER rule, i.e. an "OR" operator. 

 

It would be far preferable, and allow for better scaling/targeting/rule maintance, if we could arrange boolean operators between conditions when setting conditions. This would better align with how our conditional logic has been set in legacy JavaScript s_code deployments, and it better aligns with how we think about our site architecture and mapping data with processing rules and segmentation.

2 Comments

Avatar

Level 5

9/15/15

While expanded conditional logic is still a good idea, you could perform you above example using one data element.  Basically, create a data element with a custom script and walk through your triggers:

- check your URL match, if true return '1' (or your value of choice to indicate a match)

- check your data element value for a match (either directly via JS value or use _satellite.getVar), if true return '1'

- on your page load rule, see if this new data element = 1

 

This means you need only one rule and can alter whether it fires through the single data element. The only drawback is your logic is hidden in your data element rather than the rule, but that's probably preferable to having multiple rules.

Avatar

Level 5

9/15/15

@MikeT1 - I appreciate the response, but would it not be possible to simply do that using a custom condition and returning "true" if all criteria are met?

 

Still, that requires custom script to handle 3 checks that I can do separately through the UI. Most of the business users who are working with DTM are not UI engineers, but more marketers and analytics-types who have a good-enough understanding to set up rules in the UI, but whom I wouldn't want adding custom code to the site. The UI already maps most conditional checks into a nice, JavaScript-less interface and gives you the option to add multiple conditions... it seems like such an oversight that a quick  "or" or "not" modifier isn't possible.