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?
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.
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:
However, in the page load rule section, the following snippet within the Custom Page Code section has no effect:
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?