custom conditions

davidh97534450

02-05-2018

Hi there,

when I am creating a "custom" criteria on Pageload or Event rules, is there anyway with in the script I can know the name of the rule the condition is checking against?

I have looked in the "this" and "arguments" scope, but can't find any reference to the context the condition is triggering against.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

joshd7227840

MVP

07-05-2018

The short version is no, DTM does not expose the rule name for you to reference.

I have spent a fair amount of time trying to find some unofficial method or property with it, but it is simply not exposed within the scope of anything you can passively do.

I have also spent a fair amount of time figuring out the least invasive way to alter the _satellite object to give me what I want, and.. while I have done it in a sandbox, it is not something I have or will ever actually use in practice. (Adobe won't even support passively using existing internal methods/properties, let alone actually changing the DTM library).

The good news is this is something a lot of people have asked for over the years, and Adobe has listened and added it to Launch, if/when you migrate from DTM to Launch.

Answers (4)

Answers (4)

jantzen_belliston-Adobe

Community Manager

07-05-2018

I'm not aware of a way to accomplish what you're looking for as it will likely require a bit of custom coding. One of our super users on the community ofter comes up with solutions for use cases like this. I'll tag him below to see if he has any ideas.

joshd7227840

davidh97534450

06-05-2018

Hi Jantzen,

Thanks for taking the time to answer this.

What I would like to do is have a custom condition, and the if the check fails, add the name of the rule to a global variable.

pseudo code:

----------------------------------------------------------------

var result = ( [custom condition logic] );

if( !result ) window.failedRuleArray.push([the name of this rule]);

return result;

----------------------------------------------------------------

for this to work, the condition needs to know the name of the rule/context it is firing within.

The reason for this is that if the user then does and interaction on the page (without reloading the page) that would make the "[custom condition logic]" return true, we can iterate over the rules that previous failed and trigger them off.

This is all related to the General Data Protection Regulation (GDRP) changes

jantzen_belliston-Adobe

Community Manager

03-05-2018

I'm not sure I understand the question.

If you are writing a custom condition within a Page Load or Event rule, that condition is only applied to that rule. Are you trying to debug something on the page to figure out which rule the custom condition is in, or is there another use case I'm not seeing?