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

contextData in DTM

Avatar

Avatar
Validate 1
Level 2
time42580181
Level 2

Likes

21 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
time42580181
Level 2

Likes

21 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
time42580181
Level 2

15-10-2015

Hi

We have a number of sites that use s.contextData on the page and we use the s_code to pick up the value and write it into props and evars etc.  Some are also using processing rules as well.

Using DTM and AppMeasurement.js we're unable to get contextdata to work.  We have a block of code on the page as follows:

<script type="text/javascript"> if(s){ s.contextData["page"] = "product.category"; } </script>

It seems to be getting re-initialised when the DTM code actually loads and we're therefore unable to use it.  Is this correct?  Does DTM and AppMeasurement still support contextData in this manner?

Any advise would be appreciated.

Thanks
Tim

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Employee
Ben_Bytheway
Employee

Likes

40 likes

Total Posts

62 posts

Correct Reply

22 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Employee
Ben_Bytheway
Employee

Likes

40 likes

Total Posts

62 posts

Correct Reply

22 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Ben_Bytheway
Employee

15-10-2015

@Tim

Have you put a breakpoint in your code and verified that the code is being reached?

My two thoughts are:

1) Your script tag above is placed before your DTM container in the <head> and your s object is created.  So, your condition if (s) evaluates to false, and no context data is added to your s object.

2) Your code is in fact lower than your DTM container, but is being run before your tool because your tool is set to fire at pagebottom or somewhere after that.  

You can always put that javascript snippet in the "Custom Page Code" section in your tool and this will ensure that it will be run after your s object is initialized:

 

[img]DTM - Custom Page Code.PNG[/img]

Answers (1)

Answers (1)

Avatar

Avatar
Boost 3
Level 2
shawncreed1
Level 2

Likes

3 likes

Total Posts

25 posts

Correct Reply

12 solutions
Top badges earned
Boost 3
Boost 1
Affirm 5
Affirm 3
Affirm 10
View profile

Avatar
Boost 3
Level 2
shawncreed1
Level 2

Likes

3 likes

Total Posts

25 posts

Correct Reply

12 solutions
Top badges earned
Boost 3
Boost 1
Affirm 5
Affirm 3
Affirm 10
View profile
shawncreed1
Level 2

15-10-2015

Tim,

DTM doesn't do anything that would reset/re-initialize contextData, and Appmeasurement still supports it as far as I know.

This is a situation where it would be helpful for us to get some additional information so we can investigate further and see what might be going on. Can you please e-mail Adobe ClientCare (clientcare@adobe.com) with as much detail as possible, including the URL(s) where you are testing, the company/property/rule(s) involved, etc?

Best,
Shawn