custom conditions

Avatar

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
davidh97534450
Level 2

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)

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
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)

Avatar

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
davidh97534450
Level 2

07-05-2018

Thanks for the help Josh!

I'll look in to Launch migration sometime, after GDRP changes complete! 😉

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,338 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,338 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
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

Avatar

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
davidh97534450
Level 2

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

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,338 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,338 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
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?