JS tracker js-0.13-1 doesn't send events


#1

Hi, first of all - the problem seems to be floating - it is reproduced approximately 1 of 5 times. We have defined click handler on a link which add an event to async queue:

function sendSnowplowEvent(category, action, label, property, value) {
  window._snaq = window._snaq || [];
    trackStructEvent = ['trackStructEvent',
        category,
        action,
        label,
        property,
        value];

    window._snaq.push(trackStructEvent);
}

Usually it works fine but from time to time I can see that after page load events are not getting sent - they are just stacked in window._snaq and nothing seems to be happening further (I’m judging from Firebug Net console - no requests to tracker nor queue is getting processed). After page reload everything might start working again - events are sent and not stacked but getting sent right after click is performed.
What it could be connected with and what is the best way to debug the problem?


#2

Hi @loonydevil,

This seems like either JS tracker is not being loaded and proxy keeps events, waiting for Snowplow library either your proxy is being overwritten. Basically in most cases snowplow creates array (window._snaq) and overwrites it with Snowplow tracker object, overloading push method (of course all the events, collected by tracker are sent with push method).


#3

Hi @grzegorzewald, thanks for your reply! Could you suggest how to debug the second case (the proxy being overwritten)? The tracker is being loaded (at least I see snowplow.js loaded). But what really puzzles me that the issue is reproduced not every time… Maybe it really somehow depends on the order of loading or so.


#4

Hi @loonydevil,

I would start with 3rd parties - we had some issues with Criteo recently (when they started to use Snowplow, we had some library collisions) - you may look for sp.js in sources or any parts of js code in libraries. Next, I would suggest to analyze your code - if there are no duplicates in creating proxy.

I would also suggest to move to 2.5.x+ version…


#5

Thanks, @grzegorzewald! It seems that I narrowed problem and it’s not in snowplow - sometimes our code indeed doesn’t load snowplow’s script. But that’s completely diffeent story. Thanks for your cooperation!