Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

DTM Firing Priorities / Sequential execution

Avatar

Level 1

Use Case:

I need 2 JS scripts to run in a specific order. 1 script is an API call with a callback which needs to be declared AFTER another script that defines the callback.

I need both of these to run BEFORE s.t() runs or before the app measurement library loads.

Questions: 

How do I prioritize page rule tags to fire in a specific order? 

How do I ENSURE the adobe s.t() call fires last.

I understand all the JS is asynchronous but what can we do ensure firing order is preserved?

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hi,

if you set properly the Adobe Analytics tool, then in my personal experience every conditioning "trigger" available (top of page, bottom, dom-ready) except from "window-load", runs before the AA tracking request.

So you should write your javascript code in the dedicated custom code section on each of these two rules. Check load order here to decide better the trigger and synchronous/asynchronous loading: https://marketing.adobe.com/resources/help/en_US/dtm/load_order.html

You can create 1 rule with a "top of page" trigger where you write the first script code, then a second one with trigger "page bottom" which can use the first resource. Both of these rules should be executed before the AA tracking.

Hope to be clear enough

Gabriele

View solution in original post

1 Reply

Avatar

Correct answer by
Level 1

Hi,

if you set properly the Adobe Analytics tool, then in my personal experience every conditioning "trigger" available (top of page, bottom, dom-ready) except from "window-load", runs before the AA tracking request.

So you should write your javascript code in the dedicated custom code section on each of these two rules. Check load order here to decide better the trigger and synchronous/asynchronous loading: https://marketing.adobe.com/resources/help/en_US/dtm/load_order.html

You can create 1 rule with a "top of page" trigger where you write the first script code, then a second one with trigger "page bottom" which can use the first resource. Both of these rules should be executed before the AA tracking.

Hope to be clear enough

Gabriele