From ca2879cbb1daea120d89228d40cdea1d77a14053 Mon Sep 17 00:00:00 2001 From: Fred Blundun Date: Tue, 11 Aug 2015 17:06:54 +0100 Subject: [PATCH 1/5] Bumped version to 2.5.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fecb96d2..2a2d7526a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snowplow-tracker", - "version": "2.5.1", + "version": "2.5.2", "devDependencies": { "JSON": "~1.0.0", "browser-cookie-lite": "~0.3.1", From feb8a3655ff75f1a9c09a9c9b500d0346340d82e Mon Sep 17 00:00:00 2001 From: Fred Blundun Date: Tue, 11 Aug 2015 17:09:02 +0100 Subject: [PATCH 2/5] Prevented the tracker from setting cookies on initialization if "useCookies" is disabled (fixes #403) --- src/js/tracker.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/tracker.js b/src/js/tracker.js index 6ab492d55..244ec1aa3 100644 --- a/src/js/tracker.js +++ b/src/js/tracker.js @@ -579,11 +579,13 @@ idCookieComponents[5] = idCookieComponents[4]; } - setSessionCookie(); - // Update currentVisitTs - idCookieComponents[4] = Math.round(new Date().getTime() / 1000); - idCookieComponents.shift(); - setDomainUserIdCookie.apply(null, idCookieComponents); + if (configUseCookies) { + setSessionCookie(); + // Update currentVisitTs + idCookieComponents[4] = Math.round(new Date().getTime() / 1000); + idCookieComponents.shift(); + setDomainUserIdCookie.apply(null, idCookieComponents); + } } /* From a8c9a47f0ca006aff68527ea86f730490c2d0870 Mon Sep 17 00:00:00 2001 From: Fred Blundun Date: Tue, 11 Aug 2015 17:10:46 +0100 Subject: [PATCH 3/5] Updated examples to use version 2.5.2 --- examples/ads/async.html | 6 +++--- examples/web/async-large.html | 4 ++-- examples/web/async-medium.html | 2 +- examples/web/async-small.html | 2 +- examples/web/sync.html | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/ads/async.html b/examples/ads/async.html index 5c7f5364b..491ad3e71 100644 --- a/examples/ads/async.html +++ b/examples/ads/async.html @@ -38,7 +38,7 @@

Asynchronous ad tracking examples for snowplow.js

;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","adTracker")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","adTracker")); window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', { 'encodeBase64': false @@ -110,7 +110,7 @@

Asynchronous ad tracking examples for snowplow.js

;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","adTracker")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","adTracker")); window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', { 'encodeBase64': false @@ -141,7 +141,7 @@

Asynchronous ad tracking examples for snowplow.js

;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","adTracker")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","adTracker")); window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', { 'encodeBase64': false diff --git a/examples/web/async-large.html b/examples/web/async-large.html index 1d2e73468..694300947 100644 --- a/examples/web/async-large.html +++ b/examples/web/async-large.html @@ -23,7 +23,7 @@ ;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.1/sp.js","snowplow_1")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","snowplow_1")); window.snowplow_1('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker encodeBase64: false, // Default is true @@ -83,7 +83,7 @@ ;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.1/sp.js","snowplow_2")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","snowplow_2")); window.snowplow_2('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker encodeBase64: false, // Default is true diff --git a/examples/web/async-medium.html b/examples/web/async-medium.html index 3969af580..d4bae6799 100644 --- a/examples/web/async-medium.html +++ b/examples/web/async-medium.html @@ -24,7 +24,7 @@ ;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.1/sp.js","new_name_here")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","new_name_here")); window.new_name_here('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { encodeBase64: false, diff --git a/examples/web/async-small.html b/examples/web/async-small.html index 9eaea35a3..886708ba0 100644 --- a/examples/web/async-small.html +++ b/examples/web/async-small.html @@ -23,7 +23,7 @@ ;(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","//d1fc8wv8zag5ca.cloudfront.net/2.5.1/sp.js","snowplow")); + n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.2/sp.js","snowplow")); window.snowplow('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker encodeBase64: false, // Default is true diff --git a/examples/web/sync.html b/examples/web/sync.html index 94d23f7d1..8f7b3f2e6 100644 --- a/examples/web/sync.html +++ b/examples/web/sync.html @@ -19,7 +19,7 @@