DTM Numeric and Currency Events

Avatar

Avatar

morgana29751040

Avatar

morgana29751040

morgana29751040

24-08-2016

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?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

morgana29751040

Avatar

morgana29751040

morgana29751040

09-11-2017

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);

Answers (6)

Answers (6)

Avatar

Avatar

jakea85004189

Avatar

jakea85004189

jakea85004189

09-11-2017

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

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

09-11-2017

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

Avatar

jakea85004189

Avatar

jakea85004189

jakea85004189

08-11-2017

This is not an answer

Avatar

Avatar

jakea85004189

Avatar

jakea85004189

jakea85004189

08-11-2017

i do

Avatar

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570

Avatar

jantzen_belliston-Adobe

Community Manager

Total Posts

(val/1000)?string[".0"]}K

Likes

308

Correct Answer

570
jantzen_belliston-Adobe
Community Manager

13-12-2016

Hi Morgan,

Did you still need assistance with this issue?

Thanks,
Jantzen

Avatar

Avatar

taciac

Avatar

taciac

taciac

13-09-2016

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