Hello,
I’m integrating the JS tracker on my web site and i encounter difficulties with the addGlobalContext method.
For now, my implementation is quite simple :
<script type="text/javascript">
(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","https://d1fc8wv8zag5ca.cloudfront.net/2.10.0/sp.js","snowplow"));
window.snowplow("newTracker", "xxxx_tracker","//dev-snowplow.xxxxx.fr", {
appId: 'xxxx_useraccount',
discoverRootDomain: true,
eventMethod: 'get',
forceSecureTracker: true,
respectDoNotTrack: true,
});
window.snowplow('setDebug', true)
window.snowplow('addGlobalContexts', [
{
"data": {
"environment" : window._Y_.environment,
}
}
]);
window.snowplow('enableActivityTracking', 30, 10);
window.snowplow('trackPageView');
</script>
I think i’m missing something here because neither in the request neither in metabase do i see my context sent. Do i really need a schema even if i don’t need to make filter on my context ? What am i doing wrong ?
Thank you very much for your help.