Roman
Roman

Reputation: 1

s.tl() call not setting eVar

I am trying get an s.tl() to pass an eVar but the call is firing without passing the eVar and I can't work out why, I have used the same code via another load rule on the same page which works.

Working code

   setTimeout(function(){
   s.linkTrackVars='eVar17';
   s.eVar17 = _satellite.data.customVars.HL_AB; 
   s.tl(true,'o','Hook Logic'); },5000);

Non working code

setTimeout(function(){
s.linkTrackVars='eVar38';
s.eVar38 = _satellite.data.customVars.GOOG_AS;
s.tl(true,'o','AdSense Tracking'); }, 5000);

I have even tried to send the data over as context data, also changed to a JS var instead of a DTM var but nothing, it is as if the s.linkTrackVar line is being treated as blank, as even if the var was empty it would still set as null.

However I am getting the var to return in the console, so I added a timeout to make sure it was available when the call runs.

Any ideas?

Upvotes: 0

Views: 1112

Answers (1)

HigherAbstraction
HigherAbstraction

Reputation: 1089

In your test where the pixel isn't showing eVar38, are you definitely certain that _satellite.data.customVars.GOOG_AS is not either undefined or empty? I'd suggest you add the following to your setTimeout function immediately before the s.tl:

_satellite.notify("GOOG_AS custome var is '" + _satellite.data.customVars.GOOG_AS + "'", 1);

Then run your test again, with DTM debugging on, and see if the value is blank. I think the most likely scenario is that this variable is either undefined or blank, in which case it will not get passed as a query parameter in the s.tl() tracking call.

Upvotes: 2

Related Questions