Javascript - when a tracking call has completed? | Community
Skip to main content
pwolly-cr
Level 2
September 22, 2020
Solved

Javascript - when a tracking call has completed?

  • September 22, 2020
  • 1 reply
  • 2212 views
Hello!
Does anyone know if there is a reliable way in javascript to detect whether the adobe analytics page tracking call (s.t()) has completed?  Currently, we are attempting to test for this via the below javascript (that tries to determine the state of the image beacon added to the page):
 
var pageViewComplete = function(){
    var pageViewPixel = window.s_i_scglobal;
    if (pageViewPixel && pageViewPixel.src && (pageViewPixel.src.indexOf('/b/ss/') >= 0) && pageViewPixel.complete){
      return true;
    }
    return false;
  };
 
We have noted that on occasion, the page view is recorded via an AJAX post to our adobe server vs the inclusion of the <img> tag, so the above code doesn't not always work.
 
Is there any Adobe supported way to test for this?
 
Thanks!
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Brian_Johnson_

@pwolly-cr  - Have you considered s.registerPostTrackCallback?

https://docs.adobe.com/content/help/en/analytics/implementation/vars/functions/registerposttrackcallback.html

1 reply

Brian_Johnson_
Brian_Johnson_Accepted solution
Level 8
September 22, 2020
yuhuisg
Community Advisor
Community Advisor
September 23, 2020
@17382264 out of curiosity, why do you need to call a s.tl() immediately after a s.t() ?