- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
07-05-2019 05:54 AM
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() { s.performanceWrite() }, 250); } if (!s.ptc || s.linkType == 'e') { s.performanceRead(); } else { s.rfe(); 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?
07-05-2019 07:42 AM
I changed the if statement to
if(true)
and it seems to work ok now, populating on the page view calls.
07-08-2019 11:46 PM - edited 07-09-2019 12:06 AM
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.
Copyright All Rights Reserved © 2008-2023