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
BedrockMission!

Learn More

View all

Sign in to view all badges

s-code-content file to execute first before direct call rule file

Avatar

Avatar
Level 1
peter_paul
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
peter_paul
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
peter_paul
Level 1

04-07-2016

Hi Adobe Community,

How can I make sure the s-code-content is executed before the direct call rule?  window.s inside my direct call rule is undefined because initialization of variable s (var s = new AppMeasurement() ) is called after my direct call rule based on the logs I placed in each files. Below is the situation.

I am using a Direct Call Rule but when I assigned a value to the variable, console said it is undefined (please see image). I realized the variable s below found in s-code-content-xxx.js file is not yet executed. 

var s = new AppMeasurement();

Sometimes it has a value, sometimes it does not have depending on how the sequence is rendered. I added logs to the 2 main files (satelliteLib-xxx-staging.js and s-code-contents-xxx-staging.js) and the file of the direct call rule that is fired (satellite-xxx-staging.js) to see the sequence they are called.

If there is value, the sequence is this which makes sense because variable s above is initialized first before calling the direct call rule:
1. satelliteLib-xxx-staging.js (contains code that calls the 2 files below and is the one required by Adobe to be the first line of script to be called inside <head> tag)
2. s-code-content-xxx-staging.js (contains var s = new AppMeasurement);
3. satellite--xxx-staging.js (contains the direct call rule fired by the page that has undefined because variable s is also undefined - please see image above)

If there is NO value like in the screenshot above,its sequence is this (based on the logs i inserted)

1. satelliteLib-xxx-staging.js
2.  satellite--xxx-staging.js 

3. s-code-content-xxx-staging.js

The Direct Call Rule code snippet below in the screenshot is found inside satellite-xxx-staging.js and at this time window.s is called, it is still undefined because this file was called earlier earlier than s-code-content-xxx-staging.js

 

Hope to get a solution for this. Thank you so much!

Regards,
Peter

Replies

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

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

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

15-07-2016

Hi Peter, 

Please share your DTM Account Login details as well as test url of the website in a private message so that we can debug the issue at our end. 

Thanks & Regards

Parit Mittal