Delay Firing Calls in Adobe Analytics

Have you ever had values that you needed to send to Adobe Analytics via a call but needed to delay the firing of the tag until they were available (but before window onunload)? This post will describe how to delay the firing of a call so that you can grab those needed values and send over to Adobe accordingly.

What you will need to do is create a setTimeOut function in JavaScript and wrap your call within it.  Then set the timeout to be whatever period needed (for this example it will be 3 seconds).  Once three seconds passes, the call will fire and your tracking will be good to go.  Below is an example of this:


//code for delaying
var ddrValue = window.location.href;
var datalayerName = digitaldata.getName;

if (ddrValue.indexOf(‘foobar’) > -1) {

//Adobe Analytics call


s.eVar90 = datalayerName.toLowerCase();,’o’,’eVar90 tracked’);
}, 3000);

That’s really it! By doing this, you will be able to delay your call as little or as long as you might need so that the data necessary to pass to Adobe will be available.