JS error with javascript tracker

Hi there!

I have noticed a very frustrating issue with the js tracker when used in the head area. I see a bunch of errors and also no cookies are generated. I do see it callign the pixel with the query parameters, but no ajax-driven event and form trackers work anymore.

Here’s the error I get on page load:

Uncaught TypeError: Cannot read property 'split' of undefined at v (sp.js:30) at u (sp.js:31) at new d.InQueueManager (sp.js:31) at new f.Snowplow (sp.js:57) at Object.17../snowplow (sp.js:31) at c (sp.js:9) at e (sp.js:9) at sp.js:9

The page view events do fire though, as I can see from the network activity and loading of the pixel. However, any custom events throw undefined errors and do not fire off the pixel. Has anyone experienced this? I also don’t see any sp_ cookies being generated on the site (searching using chrome tools). I am using the stock js tracker implementation ie:

<!-- Snowplow starts plowing -->
<script type="text/javascript" async=1>
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;n.src=w;g.parentNode.insertBefore(n,g)}}    (window,document,"script","http://d1fc8wv8zag5ca.cloudfront.net/2.7.0/sp.js","snowplow"));

window.snowplow('newTracker', 'scala', 'statscollector-dev.site.com', {
                      appId: 'ih.www.local',
                      platform: "web"
                    });

window.snowplow('trackPageView');
</script>
<!-- Snowplow stops plowing -->

I have trying to debug this for a few days but no luck :frowning:
Thanks very much!

Hello @kjain,

Thanks for you super-detailed report, this is indeed extremely interesting and frustrating. By any chance, do you have a public page with tracker throwing this exception?

As far as I can see problem may be in this InQueue line. I hardly can imagine what could cause error in this very early step of event tracking, but if you can provide console output for input it would be very helpful.

1 Like

Hi Anton

Thanks for your help and apologies for the delay in getting back!
I believe that the issue is external (javascript error on the site itself) which led to the sp.js breaking and not getting the data needed as you pointed out above.

Thanks!