Skip to content

Commit b46adf7

Browse files
committed
Merge branch 'feature/2.5.0'
2 parents d881df9 + 592b51f commit b46adf7

File tree

13 files changed

+170
-99
lines changed

13 files changed

+170
-99
lines changed

CHANGELOG

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
Version 2.5.0 (2015-07-22)
2+
--------------------------
3+
Generated a unique session ID for each new session (#347)
4+
Added a page view UUID (#369)
5+
Maintained visit count when cookies are disabled (#388)
6+
Bumped payload_data schema to 1-0-3 (#385)
7+
Added Grunt task to build the tracker skipping the lodash and minification tasks (#382)
8+
Added ability to configure the session cookie timeout in the argmap (#383)
9+
Removed deprecated performanceTiming argument to trackPageView (#375)
10+
Added ability to pass a context-generating function to trackPageView (#372)
11+
Removed configWriteCookies setting (#390)
12+
Updated browser feature detection tests (#378)
13+
114
Version 2.4.3 (2015-04-15)
215
--------------------------
316
Added License button to README (#357)

Gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ module.exports = function(grunt) {
259259
grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify:main', 'concat:deploy', 'min:deploy']);
260260
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify:main', 'concat:deploy', 'min:deploy', 's3:not_pinned', 'cloudfront:not_pinned']);
261261
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify:main', 'concat:deploy', 'min:deploy', 's3', 'cloudfront']);
262+
grunt.registerTask('quick', 'Build snowplow.js, skipping building lodash and minifying', ['browserify:main', 'concat:deploy']);
262263
grunt.registerTask('test', 'Intern tests', ['browserify:test', 'intern']);
263264
grunt.registerTask('travis', 'Intern tests for Travis CI', ['lodash','concat:test', 'browserify:test','intern']);
264265
grunt.registerTask('tags', 'Minifiy the Snowplow invocation tag', ['min:tag', 'concat:tag']);

examples/ads/async.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h1>Asynchronous ad tracking examples for snowplow.js</h1>
3838
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
3939
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
4040
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
41-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","adTracker"));
41+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","adTracker"));
4242

4343
window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
4444
'encodeBase64': false
@@ -110,7 +110,7 @@ <h1>Asynchronous ad tracking examples for snowplow.js</h1>
110110
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
111111
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
112112
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
113-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","adTracker"));
113+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","adTracker"));
114114

115115
window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
116116
'encodeBase64': false
@@ -141,7 +141,7 @@ <h1>Asynchronous ad tracking examples for snowplow.js</h1>
141141
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
142142
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
143143
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
144-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","adTracker"));
144+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","adTracker"));
145145

146146
window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
147147
'encodeBase64': false

examples/web/async-large.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
2424
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
2525
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
26-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","snowplow_1"));
26+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","snowplow_1"));
2727

2828
window.snowplow_1('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker
2929
encodeBase64: false, // Default is true
3030
appId: 'CFe23a', // Site ID can be anything you want. Set it if you're tracking more than one site in this account
3131
platform: 'mob',
3232
crossDomainLinker: function (link) {return link.id === 'legal'}, // Add duid and timestamp to the link with id "legal"
3333
contexts: {
34+
webPage: true,
3435
performanceTiming: true
3536
}
3637
});
@@ -82,7 +83,7 @@
8283
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
8384
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
8485
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
85-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","snowplow_2"));
86+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","snowplow_2"));
8687

8788
window.snowplow_2('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker
8889
encodeBase64: false, // Default is true

examples/web/async-medium.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
2525
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
2626
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
27-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","new_name_here"));
27+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","new_name_here"));
2828

2929
window.new_name_here('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', {
3030
encodeBase64: false,
3131
appId: 'CFe23a',
3232
platform: 'mob',
3333
cookieName: '_cf_3489563', // Cookie names should be unique to prevent mix-ups
3434
contexts: {
35+
webPage: true,
3536
performanceTiming: true
3637
}
3738
});

examples/web/async-small.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
2424
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
2525
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
26-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js","snowplow"));
26+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js","snowplow"));
2727

2828
window.snowplow('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker
2929
encodeBase64: false, // Default is true
3030
appId: 'CFe23a', // Site ID can be anything you want. Set it if you're tracking more than one site in this account
3131
platform: 'mob',
3232
contexts: {
33+
webPage: true,
3334
gaCookies: true,
3435
performanceTiming: true
3536
}

examples/web/sync.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<!-- Snowplow starts plowing -->
2121
<script type="text/javascript">
22-
var spSrc = ('https:' == document.location.protocol ? 'https' : 'http') + '://d1fc8wv8zag5ca.cloudfront.net/2.4.3/sp.js';
22+
var spSrc = ('https:' == document.location.protocol ? 'https' : 'http') + '://d1fc8wv8zag5ca.cloudfront.net/2.5.0/sp.js';
2323
document.write(unescape("%3Cscript src='" + spSrc + "' type='text/javascript'%3E%3C/script%3E"));
2424
</script>
2525
<script type="text/javascript">

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snowplow-tracker",
3-
"version": "2.4.3",
3+
"version": "2.5.0",
44
"devDependencies": {
55
"JSON": "~1.0.0",
66
"browser-cookie-lite": "~0.3.1",
@@ -19,7 +19,8 @@
1919
"murmurhash": "0.0.2",
2020
"semver": "~2.2.1",
2121
"sha1": "git://github.com/pvorb/node-sha1.git#v1.0.0",
22-
"snowplow-tracker-core": "0.3.0"
22+
"snowplow-tracker-core": "0.3.0",
23+
"uuid": "^2.0.1"
2324
},
2425
"contributors": [
2526
"Alex Dean",

src/js/in_queue.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
var
3838
lodash = require('./lib_managed/lodash'),
3939
helpers = require('./lib/helpers'),
40+
uuid = require('uuid'),
4041

4142
object = typeof exports !== 'undefined' ? exports : this; // For eventual node.js environment support
4243

@@ -48,8 +49,9 @@
4849

4950
object.InQueueManager = function(TrackerConstructor, version, mutSnowplowState, asyncQueue, functionName) {
5051

51-
var trackerDictionary = {},
52-
usedCookieNames = {};
52+
// Page view ID should be shared between all tracker instances
53+
var pageViewId = uuid.v4(),
54+
trackerDictionary = {}
5355

5456
/**
5557
* Get an array of trackers to which a function should be applied.
@@ -110,12 +112,7 @@
110112
*/
111113
function createNewNamespace(namespace, endpoint, argmap) {
112114
argmap = argmap || {};
113-
if ((!argmap.writeCookies) && (argmap.cookieName in usedCookieNames)) {
114-
argmap.writeCookies = false;
115-
} else {
116-
usedCookieNames[argmap.cookieName] = true;
117-
}
118-
trackerDictionary[namespace] = new TrackerConstructor(functionName, namespace, version, mutSnowplowState, argmap);
115+
trackerDictionary[namespace] = new TrackerConstructor(functionName, namespace, version, pageViewId, mutSnowplowState, argmap);
119116
trackerDictionary[namespace].setCollectorUrl(endpoint);
120117
}
121118

src/js/out_queue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
*/
315315
function encloseInPayloadDataEnvelope(events) {
316316
return json2.stringify({
317-
schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-2',
317+
schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-3',
318318
data: events
319319
});
320320
}

0 commit comments

Comments
 (0)