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

SOLVED

DTM: Custom Page Code does not load properly

kasper_rasmusse
Level 2
Level 2

We are having some difficulties using the Custom Page Code for Adobe Analytics in a Page Load Rule. 

The general setup is as follows:
    - A fresh s_code is hosted with DTM (Managed). 
    - The Load order for this general Adobe Analytics tag is set to bottom, as its dependent on DOM elementets (tracking object = s). 

Now we want to assign an action to a specific page, fx. a product view. For this we create a new Page Load Rule (Load Order = Bottom of page), and because DTM currently does not support the s.products in the UI, we are going to write the behavior in the Custom Page Code under the Adobe Analytics tab. However, the data assigned to the s object in this script, is not send with the pageView tracking - in fact, it is not visible at all. Using the predefined fields in the UI (eVar, prop events, etc.) data is perfectly send with the pageView tracking - the error only occurs using the Custom Page Code. 

Using the debugger - _satellite.setDebug(true) - it seems like the Page Load Rule is handled first, and then the s object is overwritten with the general Analytics code afterwards?

We have also tried using "s=window.s", but it casts a undefined exception when accessing the s object. Experimenting with alert boxes etc. i can see the load order as:
    - Page Load Rule for product views (set variables)
    - Load Adobe Analytics tag (set variables)
    - Track pageView

Have anyone else faced similar problems? When is the s object actually loaded and accessible?

Regards

1 Accepted Solution
anthony_avolio1
Correct answer by
Level 1
Level 1

This bug appears to have been fixed in the 1/16/2014 release. The problem I described above is no longer happening to me.

Thanks,

Anthony

View solution in original post

6 Replies
anthony_avolio1
Level 1
Level 1

I'm experiencing the same issue - inconsistent behavior in the Custom Page Code section of Adobe Analytics at the Tool-level vs. Page Load Rule-level.

In the installed tool section, placing the following snippet within the Custom Page Code section successfully populates prop4 in the analytics call:

if(true) s.prop4="prop4text";

However, in the page load rule section, the following snippet within the Custom Page Code section has no effect:

if(true) s.prop3="prop3text";

In order to keep the total number of rules more manageable, I was hoping to perform some logical tests within the Custom Page Code section of a page-level rule in order to set additional Analytics values. Is this possible?

Thanks,

Anthony

toby_ho
Level 1
Level 1

Is "s = windows.s" a typo? It should be "s = window.s". If it had been a typo it would explain the undefined excption.

claudios1578915
Level 1
Level 1

Hello everyone,

we are experiencing the same problem.

We have debugged the code and it seem that the code added through the Custom Page Code section of a Page Load Rule is wrapped in a function with only one parameter ("t") but this fuction is called by another one which pass it 2 parameters and the second one is the SiteCatalyst Tracking Object, not the first one.

To me this is a bug of the product.

Do you think i'm right or i made some mistakes?

Thanks,

Claudio.

kasper_rasmusse
Level 2
Level 2

Thank you and yes, it was a typo in my question. 

toby_ho
Level 1
Level 1

Could you please send me?

  1. The URL to the page you are testing
  2. The URL to the rule in the DTM admin console
anthony_avolio1
Correct answer by
Level 1
Level 1

This bug appears to have been fixed in the 1/16/2014 release. The problem I described above is no longer happening to me.

Thanks,

Anthony

View solution in original post