Hi Guys,
Have been putting my head into setting up this for a long time now. I made an e-Commerce website using Magento, and then I am adding JS tracker to this after setting up & running my Snowplow Mini instance on AWS. Everything shows up perfectly on Snowplow, even the Example Events are working fine, but I don’t know why using JS tracker I am unable to end events to my Snowplow Mini collector so as to subsequently display it in Kibana Discover
I am adding the below JS in my in my Magento application. I even tried using this JS tracker code in other web applications, it still does not work. Would be great if anyone can help me here, I’m stuck.
<!-- Snowplow starts plowing -->
<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","http://d1fc8wv8zag5ca.cloudfront.net/2.10.0/sp.js","snowplow"));
var collector = "ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com";
window.snowplow('newTracker','rt',collector,{
appId: "snw6"
});
snowplow(function () { console.log("sp.js has loaded"); });
snowplow('enableActivityTracking', 10, 10);
console.log("Adding Item");
snowplow('addItem',
'000000002', // order ID - required
'WS08-XS-Blue',
'Minerva LumaTech™ V-Tee', // product name
'Blue XS', // category or variation
'32.00', // unit price - required
'1' // quantity - required
);
window.snowplow('trackPageView');
console.log("Success")
</script>
<!-- Snowplow stops plowing -->
Really don’t know where am going wrong.
Thanks
Kuzhal