Expand my Community achievements bar.

Control the precedence/order of DTM Rules


Level 5




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



Level 9


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



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. 


Level 5


__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.