Tracking new elements in the source code

roberty10279373

29-12-2017

Hi.  We added some new elements on the source code.  See below:

var dtmAnalyticsData = {"channel":"REVIEWS","url":"\/2017\/12\/delta-one-lax-jfk-flight-review\/","pageName":"delta-one-lax-jfk-flight-review","author":"Daryl Chua","eVar20":"business class, Delta, Delta Air Lines, Flight Review, Flight Reviews","eVar21":"12252017","eVar22":0,"eVar23":1413,"eVar24":"","eVar25":"Delta, Delta SkyMiles"};

I added data elements and set up page load tracking for the items listed as evar 21, evar 22, evar 23, evar 24, evar 25.  However, I'm not seeing them in the adobe analytics reporting interface.  Please help.

-Robert

Accepted Solutions (0)

Answers (17)

Answers (17)

aseelund

05-01-2018

your data elements should be referencing specific objects on your data layer, not treating the whole data layer as a string.

Assuming that dtmAnalyticsData is your data layer, does it follow any specification?

example: https://www.w3.org/2013/12/ceddl-201312.pdf

in your data elements, you can reference by `JS Object` to window.dtmAnalyticsData.{specific_key} to return a value.

Then in your rule, configure an evar, prop to use those data elements.

joshd7227840

MVP

08-01-2018

The Data Element name. Look at my 2nd posted screenshot in previous post.  That ss shows what is in _satellite.dataElements in the js console.

I have done some more poking and I can verify you don't actually have quotes in the DE name (it looks the same from the js object dump but it's not actually access the same, so i was able to verify you actually don't have quotes in the DE name).

But there is definitely a trailing space. I don't think that's technically a problem though.  I do see that the Rule config correctly shows the trailing space in %Funnel Level % reference.  But you should probably remove it anyways, because you probably won't notice it later on down the road if you need to reference it w/ js code in a custom code block in the future.

So I think overall the only issue left with eVar24 not popping in the AA call is that window.dtmAnalyticsData.eVar24 simply has no value on this page (it's an empty string). Because if I put this into the js console:

dtmAnalyticsData.eVar24 = 'foo';

_satellite.pageBottom();

I see eVar24 pop in the AA request.

roberty10279373

08-01-2018

Hi Josh,

So when you mention the "Funnel Level " data element in quotes are you

referring to the data element name or path?

-Robert

On Mon, Jan 8, 2018 at 3:16 PM, joshd7227840 <forums_noreply@adobe.com>

joshd7227840

MVP

08-01-2018

Yes, at a minimum, you are missing a number of things, which I detailed above.

I looked at your page again and it looks like you fixed the evar vs. eVar reference, and I do see that eVar25 now pops in the AA request.

But I see that you have not fixed the issue with wrapping your "Funnel Level " Data Element in quotes and the trailing space after it, so I do not see eVar24 pop.  But the page doesn't show that there is even a value in dtmAnalyticsData.eVar24 anyways (it's just an empty string), so AA's eVar24 wouldn't get popped anyways.

roberty10279373

08-01-2018

Hi Josh,

So this is the source code I'm dealing with:

var dtmAnalyticsData =

{"channel":"REVIEWS","url":"\/2017\/12\/delta-one-lax-jfk-flight-review\/","pageName":"delta-one-lax-jfk-flight-review","author":"Daryl

Chua","eVar20":"business class, Delta, Delta Air Lines, Flight Review,

Flight

Reviews","eVar21":"12252017","eVar22":0,"eVar23":1413,"eVar24":"","eVar25":"Delta,

Delta SkyMiles"};

The way I defined the data element for eVar 20, eVar 24, and eVar 25

follows this structure on DTM:

window.dtmAnalyticsData.eVar20

Is there something I'm missing?

-Robert

On Mon, Jan 8, 2018 at 1:49 PM, joshd7227840 <forums_noreply@adobe.com>

joshd7227840

MVP

08-01-2018

Okay so a couple of things I see.

First, here is what I see on the page for dtmAnalyticsData:

chrome_2018-01-08_15-30-21.png

And here are the Data Elements I see:

chrome_2018-01-08_15-33-36.png

So firstly, you originally mentioned setting up DE's referencing eVar21-25, but I only see DE's for evar24 and evar25.  So it looks like you are missing DE's for eVar21-23.

Secondly, for the ones you have created (eVar24-25), you reference them as evar24 and evar25, but they are eVar24 and eVar25 (capital "V").  Javascript variables are case-sensitive.

Thirdly, the one for eVar25 you have labeled as "Funnel Level ". So it looks like you included quotes in your DE name.  Firstly,  it's not following the same convention as your other DE names, and it will make for clunkier code if trying to reference it in javascript. You'd have to do

_satellite.getVar('"Funnel Level "')

or

_satellite.getVar("\"Funnel Level \"")

I haven't tested it, but this also is likely going to cause problems in the %data_element_name% field syntax, as well.  Because I look at the output rule code and it looks like DTM strips the quotes from the reference:

chrome_2018-01-08_15-44-37.png

So long story short, you should probably remove the quotes (and trailing space) from your DE name.

And lastly, as mentioned before, you do not have DE's setup for eVar21-23. And I cannot see in the output DTM code that you have anything setup to pop them, either. I found no rules in the output DTM referencing eVar21-23.

You may or may not still have issues with timing, but you will need to fix the above stuff first.  So do these and then we'll go from there, if necessary.

.josh

joshd7227840

MVP

08-01-2018

Okay so if the Data Element is type JS Object and that is indeed what you are pointing at, then at face value, the issue is not with your Data Element, but somewhere else.

Next likely culprit is there may be a timing issue between where/when dtmAnalyticsData is on your page vs. when you are trying to reference your Data Element in whatever rule. 

Kinda getting into "Can't help without being able to see it on a site" territory, though..

roberty10279373

08-01-2018

I believe that's what I did. Here's the data element:

window.dtmAnalyticsData.evar20

It was based on this source code:

var dtmAnalyticsData =

{"channel":"REVIEWS","url":"\/2017\/12\/delta-one-lax-jfk-flight-review\/","pageName":"delta-one-lax-jfk-flight-review","author":"Daryl

Chua","eVar20":"business class, Delta, Delta Air Lines, Flight Review,

Flight

Reviews","eVar21":"12252017","eVar22":0,"eVar23":1413,"eVar24":"","eVar25":"Delta,

Delta SkyMiles"};

roberty10279373

08-01-2018

Hi Josh,

I think that was a typo. The data element does not have the dot between

dtm and Analytics.

-Robert

On Mon, Jan 8, 2018 at 9:06 AM, joshd7227840 <forums_noreply@adobe.com>

roberty10279373

08-01-2018

HI Jantzen,

Here's the source code:

var dtmAnalyticsData =

{"channel":"REVIEWS","url":"\/2017\/12\/delta-one-lax-jfk-flight-review\/","pageName":"delta-one-lax-jfk-flight-review","author":"Daryl

Chua","eVar20":"business class, Delta, Delta Air Lines, Flight Review,

Flight

Reviews","eVar21":"12252017","eVar22":0,"eVar23":1413,"eVar24":"","eVar25":"Delta,

Delta SkyMiles"};

From here, I'm trying to create a data element for evar20, evar24, and

evar25. Initially, I created them using this format:

dtm.AnalyticsData.evar20

However, this doesn't work.

-Robert

On Fri, Jan 5, 2018 at 12:36 PM, Jantzen.Belliston <forums_noreply@adobe.com

roberty10279373

03-01-2018

Based on the feedback from adobe client care the issue stems from the data

element. I believe the proper syntax is dtmAnalyticsData=xyz but what

happens when the source code has multiple objects in the same string?

Multiple parameters are being passed separated by a comma.

Robert

On Tue, Jan 2, 2018 at 8:01 AM Jantzen.Belliston <forums_noreply@adobe.com>

jantzen_belliston-Adobe

Community Manager

02-01-2018

If you are not seeing the expected values in your Analytics request, they definitely won't show up in reporting. This is likely because of an implementation issue. Have you tried calling the data elements you created directly in the console to see if they contain the expected value?

You can call Data Elements directly in the console using:

_satellite.getVar("Element Name");