Expand my Community achievements bar.

SOLVED

Rule Firing Order

Avatar

Level 3

I am migrating a property from DTM to Launch.  I have a couple of rules that trigger on Library Loaded that I need to fire early, so I set the Order value to 10 and 20.  All the others are the default of 50.

The rule with an order of 10 always fires first, but one with an order of 20 always fires after several of the 50 rules.  This is causing some grief.

Why is the order value not honored after the first one?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi, stephenk67545596

Actually, this rule has custom code in the rule condition and no actual rule body.  That custom code does a getVar on several data elements which, in turn, execute custom code.

I didn't write it in the first place, but I have seen plenty of instances of tricks like this where people have tried to reduce the number of js files that DTM would load.  So it's a weird case.  I have gotten around the problem by moving this code into the rule with an Order value of 10.  Phase II of the migration is to unwind things like this and do stuff in a more Launch-y way.

If you are looking for positives, I now have practical experience to back up my warning to clients that the "creative" implementations they may have done to make DTM more performant can lead to hassles when migrating to Launch.

View solution in original post

3 Replies

Avatar

Level 3

Does your rule with the order of 20 (which is firing late) have a custom code action? I am seeing that custom code actions appear to execute somewhat asynchronously and cause rules to fire out of order, I'm wondering if you are seeing the same thing.

Avatar

Correct answer by
Level 3

Hi, stephenk67545596

Actually, this rule has custom code in the rule condition and no actual rule body.  That custom code does a getVar on several data elements which, in turn, execute custom code.

I didn't write it in the first place, but I have seen plenty of instances of tricks like this where people have tried to reduce the number of js files that DTM would load.  So it's a weird case.  I have gotten around the problem by moving this code into the rule with an Order value of 10.  Phase II of the migration is to unwind things like this and do stuff in a more Launch-y way.

If you are looking for positives, I now have practical experience to back up my warning to clients that the "creative" implementations they may have done to make DTM more performant can lead to hassles when migrating to Launch.

Avatar

Level 10
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?