Adobe Analytics performanceTiming plug in

Tealium Expert
Tealium Expert

Has anyone implemented the Adobe Analytics performanceTiming plug in via TiQ?

I've got it working on a client using DTM, but get nothing back on a client using Tealium.

Having stepped through the code a few times on each one, I think it comes down to this:

The performanceTiming function contains this:

(function anonymous(v) {
    var s = this;
    if (v)
        s.ptv = v;
    if (typeof performance != 'undefined') {
        if (performance.timing.loadEventEnd == 0) {
            s.pi = setInterval(function() {
            }, 250);
        if (!s.ptc || s.linkType == 'e') {
        } else {
            s[s.ptv] = '';

On line 6 it checks to see if performance.timing.loadEventEnd == 0.  When this loads via DTM, this is true, so it goes into the performanceWrite() function and does it's stuff.  But in Tealium this is never 0, so that bit never gets called.  

Is this because TiQ loads async, so this code isn't running early enough?



Adobe Analytics performanceTiming plug in

Tealium Expert
Tealium Expert

I changed the if statement to 


and it seems to work ok now, populating on the page view calls.

Adobe Analytics performanceTiming plug in

Tealium Employee

Hi Ben, yes this looks indeed like a timing challenge. Depending on how you scoped the extension, a tag container's default "fire" mechanism is at dom ready, which means that performance.timing.loadEventEnd is already set when your code snippet runs. First, try scope the extension to the Adobe tag and change the tag container's wait flag to "no" and see if that makes a difference. If this does not work, then try "bundle" the tag (so it will be embedded in utag.js and hence fire at the earliest convenience) and if that does not work either, then maybe you can get away with removing the condition check altogether and let the busy loop kick in immediately:

if (performance.timing.loadEventEnd == 0) { .. }

If you are still having problems, I'd be happy to take a stab at the challenge, if you PM me with your account/profile and website URL to where the setup is currently in place and I'll take a look.