Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

DTM Numeric and Currency Events

Avatar

Level 2

We have several business requirements that call for tracking several of the things we are measuring as a Numeric or Currency event. We are using DTM to deploy Adobe and documentation here is anemic at best in describing how to implement these events in DTM. 

Example 1:

Track the loan amount a customer selects when applying for a loan as a currency event. I currently have this in the custom code section for a direct call rule tracking the submission of that step in the loan process:

var loanamountselected = _satellite.getVar('LoanAmountSelected'); s.events="event11="+loanamountselected;

'LoanAmountSelected' is a data element I have created that store the amount. 

 

Example 2: 

Track page load time as a numeric event so that I can make calculated metrics off of the page load time. Currently I have implemented the getLoadTime plugin and the appendList plugin int he custom code section in the general Adobe Tool settings. 

I have a Global page load rule that fires at the top of every page that then contains the following:

if(s_getLoadTime())s.events=s.apl(s.events,'event30='+s_getLoadTime(),',',1);

 

Both of these are not returning any data. How should they be correctly implemented?

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi All,

The fix for both scenarios below:

You need to declare all of the events/evar you are tracking in the Adobe Analytics section, then in the custom code section. This is redundant because you can declare the events, and evars in the designated sections in DTM, but for whatever reason this works.

In the following example I have numeric events 9,10,11 and a counter event20 firing on a rule.

s.linkTrackVars="events,eVar5,eVar6,eVar10";

s.linkTrackEvents="event9,event10,event11,event20";

var event11varname = _satellite.getVar('dtmelementevent11');

var event10varname=  _satellite.getVar('dtmelementevent10');

var event9varname = _satellite.getVar('dtmelementevent9');

s.events= "event11="+event11varname+", event10="+event10varname+", event9="+event9varname+",event20";

The following example for getLoadTime. This is implemented in the custom code setting that is in the tool setting for Adobe Analytics in which you can declare global page code.

/*

* Copyright 2011-2013 Adobe Systems, Inc.

* s_getLoadTime v1.36 - Get page load time in units of 1/10 seconds

*/

function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}

/*

* Utility Function: split v1.5 (JS 1.0 compatible)

*/

s.split=new Function("l","d",""

+"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"

+"++]=l.substring(0,i);l=l.substring(i+d.length);}return a");

/*

* Plugin Utility: apl v1.1

*/

s.apl=new Function("l","v","d","u",""

+"var s=this,m=0;if(!l)l='';if(u){var i,n,a=s.split(l,d);for(i=0;i<a."

+"length;i++){n=a[i];m=m||(u==1?(n==v):(n.toLowerCase()==v.toLowerCas"

+"e()));}}if(!m)l=l?l+d+v:v;return l");

/*

* Custom event saving getLoadTime

*/

if(s_getLoadTime())s.events=s.apl(s.events,'event30='+s_getLoadTime(),',',1);

View solution in original post

7 Replies

Avatar

Level 9

Hi Morgan,

Is this live on your page? If so, can you either post a link or send me a link to your website in a private message?

Thanks!

Tacia

Avatar

Level 10

Hi Morgan,

Did you still need assistance with this issue?

Thanks,
Jantzen

Avatar

Level 10

Jake Appellof

If you have a question, can you please open a new thread and provide the details about your question and implementation? This question was asked and likely abandoned by another user.

Cheers,
Jantzen

Avatar

Correct answer by
Level 2

Hi All,

The fix for both scenarios below:

You need to declare all of the events/evar you are tracking in the Adobe Analytics section, then in the custom code section. This is redundant because you can declare the events, and evars in the designated sections in DTM, but for whatever reason this works.

In the following example I have numeric events 9,10,11 and a counter event20 firing on a rule.

s.linkTrackVars="events,eVar5,eVar6,eVar10";

s.linkTrackEvents="event9,event10,event11,event20";

var event11varname = _satellite.getVar('dtmelementevent11');

var event10varname=  _satellite.getVar('dtmelementevent10');

var event9varname = _satellite.getVar('dtmelementevent9');

s.events= "event11="+event11varname+", event10="+event10varname+", event9="+event9varname+",event20";

The following example for getLoadTime. This is implemented in the custom code setting that is in the tool setting for Adobe Analytics in which you can declare global page code.

/*

* Copyright 2011-2013 Adobe Systems, Inc.

* s_getLoadTime v1.36 - Get page load time in units of 1/10 seconds

*/

function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}

/*

* Utility Function: split v1.5 (JS 1.0 compatible)

*/

s.split=new Function("l","d",""

+"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"

+"++]=l.substring(0,i);l=l.substring(i+d.length);}return a");

/*

* Plugin Utility: apl v1.1

*/

s.apl=new Function("l","v","d","u",""

+"var s=this,m=0;if(!l)l='';if(u){var i,n,a=s.split(l,d);for(i=0;i<a."

+"length;i++){n=a[i];m=m||(u==1?(n==v):(n.toLowerCase()==v.toLowerCas"

+"e()));}}if(!m)l=l?l+d+v:v;return l");

/*

* Custom event saving getLoadTime

*/

if(s_getLoadTime())s.events=s.apl(s.events,'event30='+s_getLoadTime(),',',1);

Avatar

Level 2

Thanks for the tip. That's pretty much what I ended up doing