DTM: Custom Page Code does not load properly

kasper_rasmusse

15-10-2015

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

Accepted Solutions (1)

Accepted Solutions (1)

Answers (5)

Answers (5)

claudios1578915

15-10-2015

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.

anthony_avolio1

15-10-2015

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