Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEP Community revamp live on 1st Feb, 2023

Control the precedence/order of DTM Rules

Avatar

Level 5

22-04-2015

hi

 

having the ability to specify precedence or order override when mutiple rules match would be very helpful. 

2 Comments

Avatar

Level 9

29-04-2015

My unofficial understanding is that the order of operation is firstly based on the Trigger Rule At setting:

 

Top of Page > Bottom of Page > DOM Ready > Onload

 

Then, for each rule during those "phases",  order of operation is based on the order they appear in the rule listing, and near as I can tell, that order is based on alphabetical sorting.  So for example if you prefix them with something sequential e.g. 


01 - Some rule

02 - Rule 2

03 - some other rule

etc..

 

it will show up in the listing in that order and execute in that order.  

 

I have not completely reverse engineered the satellite library to find out 100% if this is true but from basic testing (outputting a console.log() value in each rule) this appears to be true. 

 

However.. this doesn't really guarantee that everything in rule "A" will be evaluated before rule "B".  For example, if rule "A" has some code that dynamically creates a script tag asynchronously, or has something in a setTimeout, etc.. it is very likely rule "B" will start evaluation before that is finished. So, you need to take into consideration what code is actually in a given rule, as well. 

Avatar

Level 5

11-09-2015

__josh, I am not experiencing what you are describing. I started ensuring that my (non-async, adobe-only) rules that fire at the same are alpha-ordered and they still fire out-of-order. 

 

This is a frustrating missing feature of DTM.