Highlighted

Dynamic Tag Management (DTM): Page Load events issues and storing page name, props, evars in Data Elements

kjph2

15-10-2015

This is a two part question:

1.

I'm unable to get pageload actions to fire through DTM. Page event works fine - does exactly what I expect it to do. But I'm not able to get pageload to work at all. Here is my current setup http://screencast.com/t/S17YM2Eo3TC

When I use the debugger extension in chrome I can see that the rule is firing http://screencast.com/t/r3u7UBVIwhq

However, evar53 is not set when I check in omnibug. And like I said, when I do this through an event rule instead, evar53 shows up in omnibug. 

The s code is installed already on the website, and I have marked this in the settings http://screencast.com/t/5Wxwm2BCN4YH

So both event rules and page load rules are firing, but I can't get the action to execute from the pageload rule (but fine from the event rule)  - anyone have any ideas why this might happen?

 

2. 

How do I reference adobe variables through data elements? I want to set up a few traffic variables that are combinations of other variables (page name + other traffic variables). How can I reference those in data elements? I've tried setting up  a JS Object data element, but I'm not able to get the right path. Is this the correct approach? In this case, what do I need to put as path to pull the page name? For an evar/sprop?

 

Thanks

Replies

Highlighted

Rahsing

15-10-2015

Hi,

You can reference adobe variables thru data elements by specifying the data element being referenced under the 'Set As' option. 

For eg:- if you're trying to capture the page name, you can create a JS object to capture this by document.title and then reference this particular element (The syntax is %<element name>%).

You could try the data element method to see if your page load rule works too.

Here's some documentation for your reference.

Let me know if this helps

Rahul

Highlighted

AllDayDev

Employee

15-10-2015

From looking at this, nothing seems obviously wrong from a configuration/settings perspective.

I looked at your page (via the link you posted on Twitter) and the right tags are in place - but I wonder if the issue is that you have the browser loading the s_code js file after the DTM js file.

Maybe try moving the DTM js file tag which you currently have right after the opening <head> tag instead to right before the closing </head> tag. (Or, at least, move the DTM js file tag to somewhere after the s_code js file tag, but still between <head> and </head>.)

 

- Carey

Highlighted

kjph2

15-10-2015

Thanks for the reply Carey. From the look s of it, the <script language="JavaScript" type="text/javascript" src="/scripts/s_code.js"></script> is loaded at the bottom of the page, so it's not in the header at all. Could this be the issue? Can we move the s_code script line up to the header without any issue?

Highlighted

kjph2

15-10-2015

Rahsing wrote...

Hi,

You can reference adobe variables thru data elements by specifying the data element being referenced under the 'Set As' option. 

For eg:- if you're trying to capture the page name, you can create a JS object to capture this by document.title and then reference this particular element (The syntax is %<element name>%).

You could try the data element method to see if your page load rule works too.

Here's some documentation for your reference.

Let me know if this helps

Rahul

 

My question is how to define the JS object to capture. I have set up a data element that is referencing the document.title, css selectors etc and it works fine in event rules, but I'm trying to figure out how to capture Adobe variables, and how to get page rules to do anything at all.

So there's two things

  1. What path do I need to use to capture adobe variables? I have not been able to find this in the documentation.
  2. My page load action does not execute, regardless if I use data elements or try to directly set it. I have reviewed the documentation and need further assistance to get it working. My pageload set up is here http://screencast.com/t/S17YM2Eo3TC (I have also tried the same setup but with data elements with no success)

Any help would be appreciated.

Thanks

Highlighted

AllDayDev

Employee

15-10-2015

Not sure how your page is structured on your backend, but when I load the following page, I definitely see the s_code js file between <head> and </head>:

https://www.publicstorage.com/storage-search-landing.aspx

See:
[img]dtmbeforescode.png[/img]

Thus, the browser is loading it after DTM (and loading it before even it loads the page content in <body>).

To more directly answer your question - I believe you can load s_code from within <head> with no issues, but let me ping an implementation expert to confirm.

Highlighted

Rahsing

15-10-2015

Hi,

Have a look at the example here to see if it helps (look under 'How to Collect Values from JavaScript Variables')

Kind Regards

Rahul

Highlighted

Gigazelle

Employee

15-10-2015

Hi Kiowa,

If you're using DTM and a legacy s_code.js implementation simultaneously, you will only be able to use and modify page event image requests. Because the page load image request is commonly sent before the DTM library loads, timing the injection of the variables you want is not realistic, nor was DTM designed with that functionality in mind.

If you would like to use DTM to manage page load variables, you're going to want migrate to a full DTM implementation without the s_code.js appmeasurement library.

Highlighted

kjph2

15-10-2015

Can you provide we with an example of the path for a JS object that captures the value of an evar set on a page?

I got this to work now. Pageload still an issue though

Thanks

Highlighted

kjph2

15-10-2015

@Gigazelle

 

So DTM load page rules do not work with legacy s_code.js implementation period? Strange this isn't mentioned in any of the reference videos, they make it sound like s_code implementation through DTM is completely optional. Or when you say page event image requests, are you referring to grabbing values from Adobe variables like evars?

 

My current situation is that data elements pulling in evar values are working fine with old s_code.js for my staging library (by setting path to s.pageName for instance). Pageload rules however only work when I implement s_code through DTM. I thought this was because of the current placement of the loading of s_code.js, but you are saying pageload rules and legacy implementation of s_code.js are completely incompatible? 

 

Thanks for the response btw