Skip to content

Commit 090d313

Browse files
authored
Merge pull request snowplow#736 from snowplow/develop
Develop
2 parents ed751aa + ead40bf commit 090d313

18 files changed

Lines changed: 425 additions & 278 deletions

.travis.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,28 @@ before_script:
2626
script:
2727
- cd core && grunt intern && cd ..
2828
- grunt travis
29+
before_deploy:
30+
- grunt default
2931
deploy:
3032
- provider: script
3133
skip_cleanup: true
3234
script: ./.travis/deploy.py
3335
on:
34-
condition: '"$(.travis/is_core_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
36+
condition: '"$(.travis/is_correct_core_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
3537
tags: true
36-
- provider: script
38+
# - provider: script
39+
# skip_cleanup: true
40+
# script: ./.travis/deploy.py
41+
# on:
42+
# condition: '"$(.travis/is_tracker_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
43+
# tags: true
44+
- provider: releases
3745
skip_cleanup: true
38-
script: ./.travis/deploy.py
46+
api_key:
47+
secure: juUw//XdoRAb494NvxNTghZC7TBJLBx8WdAZsrSGp+6Sf7yPZ6skDt/+qU2VgrG/4RBWUwl3lnAWobiY6ZQQSD95lQDyVM9IdC9JHchhVav1nHBrcJWubEKN/R0Ri/3XjLFJ/LFlkdOteYYPVZR6MGehRR9Gsnazavk9+0x6c1A=
48+
file: $TRAVIS_BUILD_DIR/dist/sp.js
3949
on:
40-
condition: '"$(.travis/is_tracker_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
50+
condition: '"$(.travis/is_correct_tracker_release_tag.sh $TRAVIS_TAG)" == "" && $? == 0'
4151
tags: true
4252
env:
4353
global:
@@ -52,7 +62,7 @@ env:
5262
# AWS_SECRET_KEY
5363
- secure: C+PTon3PsELG2bFlAZ5qfinWVih8XxlZV45Gk2W5i2CK1AROJ60lnfhgYZM4YidIRcA/V/zbm8tDgZbA8i/MVKcO5f1qbD5Skyo2fEFRlXoSWhtwaScViihN338U/SsEviKThIGSSLgdfsQ0CW7TYxvetFSwXFyZPPrYrenF3dk=
5464
# NPM_AUTH_TOKEN
55-
- secure: Dtc3aFnUfquuC+E3ZOvs57SZy3Sp+3QdXQHR0xjekvpF4FgaKvDpISBfLTCs1ODuHZ+K1pPn9/i4yGNE7ei8z3VTbRY4nYPM5VG7jlqwP1iaFqRopnQmpV9c7yhMSHKhXrSWj/Gwo/9UHpia6muQUSK4hbPvhZMf0Rd3s06Z07M=
65+
- secure: PwIU7BHXhpHUhFh/sxRO1o9awiTKJ5PNrSgeTytp2CcE22q0yx/q5cKJp/gPWiY0l0sKSrNjcV/s0hifg3d8q4YcTa3JEK6Ap71ehOsCIJQD897cgTMqgawkdspeyZL8OPPAs0hMwHFAASm7RDTe4zz1rYMFs2+DYLbIKu0Ki8I=
5666
- AWS_S3_BUCKET=snowplow-static-js
5767
- AWS_REGION=eu-west-1
5868
- AWS_CF_DISTRIBUTION=E1RICD7QD0F2KE
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
tag=$1
4+
cicd=${tag:0:4}
5+
release=${tag:5}
6+
coreVersion=$(node -e 'const {version} = require("./core/package.json"); console.log(`${version}`);')
7+
8+
if [ "${cicd}" == "core" ]; then
9+
if [ "${release}" == "" ]; then
10+
echo "Warning! No release specified! Ignoring."
11+
exit 2
12+
elif [ "${release}" != "${coreVersion}" ]; then
13+
echo "Tagged version ${release} does not equal core package version ${coreVersion}"
14+
exit 1
15+
fi
16+
exit 0
17+
else
18+
exit 1
19+
fi
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
tag=$1
4+
release=$tag
5+
trackerVersion=$(node -e 'const {version} = require("./package.json"); console.log(`${version}`);')
6+
7+
if [ "${release}" == "" ]; then
8+
echo "Warning! No release specified! Ignoring."
9+
exit 2
10+
else
11+
if [ "${release:0:4}" == "core" ]; then
12+
echo "Core relase, not tracker"
13+
elif [ "${release}" != "${trackerVersion}" ]; then
14+
echo "Tagged version ${release} does not equal tracker package version ${trackerVersion}"
15+
fi
16+
fi
17+
exit 0

CHANGELOG

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 2.11.0 (2019-08-28)
2+
---------------------------
3+
Core: Send focus_form 'type' field as 'elementType' (#731)
4+
Update Sauce Connect version (#735)
5+
Add GDPR context (#645)
6+
Rotate npm token (#737)
7+
Deploy tracker asset directly to Github Tagged release rather than cloudfront (#741)
8+
Ensure that the intended version is deployed (#739)
9+
110
Version 2.10.2 (2019-02-07)
211
---------------------------
312
Update integration template to set eventMethod arg to get (#713)
@@ -358,7 +367,7 @@ Added examples of tracker namespacing (#159)
358367
Split async.html into async-small.html, async-medium.html (#160)
359368
Linked the Technical Docs and Setup Guide images to the appropriate pages (#164)
360369
Made JS invocation tag part of the build process (#158)
361-
Fixed warnings generated by the Closure Compiler, thanks @steve-gh! (#170)
370+
Fixed warnings generated by the Closure Compiler, thanks @steve-gh! (#170)
362371
Added untracked files which should be ignored to .gitignore (#173)
363372
Removed ads/sync.html (#182)
364373
Updated ads/async.html (#183)
@@ -412,7 +421,7 @@ Added getting started info for developers to README, thanks @pkallos! (#129)
412421

413422
Version 0.14.1 (2014-03-12)
414423
---------------------------
415-
Fixed bug where fromQuerystring was matching fragments instead of just the querystring (#116)
424+
Fixed bug where fromQuerystring was matching fragments instead of just the querystring (#116)
416425

417426
Version 0.14.0 (2014-02-12)
418427
---------------------------

core/lib/core.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -845,21 +845,17 @@ export function trackerCore(base64: boolean, callback?: (PayloadData) => void) {
845845
tstamp?: Timestamp): PayloadData {
846846

847847
let event_schema = '';
848+
let event_data:any = {formId, elementId, nodeName, elementClasses, value};
848849
if (schema === 'change_form'){
849850
event_schema = 'iglu:com.snowplowanalytics.snowplow/change_form/jsonschema/1-0-0';
851+
event_data.type = type
850852
} else if (schema === 'focus_form') {
851853
event_schema = 'iglu:com.snowplowanalytics.snowplow/focus_form/jsonschema/1-0-0';
854+
event_data.elementType = type
852855
}
853856
return trackSelfDescribingEvent({
854857
schema: event_schema,
855-
data: removeEmptyProperties({
856-
formId: formId,
857-
elementId: elementId,
858-
nodeName: nodeName,
859-
type: type,
860-
elementClasses: elementClasses,
861-
value: value
862-
}, {value: true})
858+
data: removeEmptyProperties(event_data, {value: true})
863859
}, context, tstamp);
864860
},
865861

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snowplow-tracker-core",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"devDependencies": {
55
"@types/es6-shim": "0.31.34",
66
"@types/node": "^9.6.7",

core/tests/unit/core.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* JavaScript tracker core for Snowplow: tests/integration.js
3-
*
3+
*
44
* Copyright (c) 2014-2016 Snowplow Analytics Ltd. All rights reserved.
55
*
66
* This program is licensed to you under the Apache License Version 2.0,
@@ -220,7 +220,7 @@ define([
220220
schema: 'iglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0',
221221
data: {
222222
impressionId: impressionId,
223-
costModel: costModel,
223+
costModel: costModel,
224224
cost: cost,
225225
targetUrl: targetUrl,
226226
bannerId: bannerId,
@@ -291,14 +291,14 @@ define([
291291
schema: 'iglu:com.snowplowanalytics.snowplow/ad_conversion/jsonschema/1-0-0',
292292
data: {
293293
conversionId: conversionId,
294-
costModel: costModel,
294+
costModel: costModel,
295295
cost: cost,
296296
category: category,
297297
action: action,
298298
property: property,
299299
initialValue: initialValue,
300300
advertiserId: advertiserId,
301-
campaignId: campaignId
301+
campaignId: campaignId
302302
}
303303
};
304304
var expected = {
@@ -414,9 +414,9 @@ define([
414414
formId: formId,
415415
elementId: elementId,
416416
nodeName: nodeName,
417-
type: type,
418417
elementClasses: elementClasses,
419-
value: value
418+
value: value,
419+
elementType: type
420420
}
421421
};
422422

@@ -445,9 +445,9 @@ define([
445445
formId: formId,
446446
elementId: elementId,
447447
nodeName: nodeName,
448-
type: type,
449448
elementClasses: elementClasses,
450-
value: value
449+
value: value,
450+
type: type
451451
}
452452
};
453453

@@ -743,5 +743,5 @@ define([
743743
assert(!('ttm' in result), 'ttm should absent');
744744
}
745745
});
746-
746+
747747
});

examples/ads/async.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
22
"http://www.w3.org/TR/html4/loose.dtd">
3-
<!--
3+
<!--
44
! Copyright (c) 2012 Snowplow Analytics Ltd. All rights reserved.
55
!
66
! This program is licensed to you under the Apache License Version 2.0,
@@ -38,16 +38,16 @@ <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.10.2/sp.js","adTracker"));
41+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.11.0/sp.js","adTracker"));
4242

4343
window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
4444
'encodeBase64': false
4545
});
4646

47-
window.adTracker('trackAdImpression:' + rnd,
47+
window.adTracker('trackAdImpression:' + rnd,
4848

4949
'67965967893', // impressionId
50-
'cpa', // costModel - 'cpa', 'cpc', or 'cpm'
50+
'cpa', // costModel - 'cpa', 'cpc', or 'cpm'
5151
10, // cost - requires costModel
5252
'http://www.example.com', // targetUrl
5353
'23', // bannerId
@@ -57,11 +57,11 @@ <h1>Asynchronous ad tracking examples for snowplow.js</h1>
5757
);
5858

5959
function clickHandler() {
60-
window.adTracker('trackAdClick:' + rnd,
60+
window.adTracker('trackAdClick:' + rnd,
6161

6262
'http://www.example.com', // targetUrl
6363
'12243253', // clickId
64-
'cpm', // costModel
64+
'cpm', // costModel
6565
0.5, // cost
6666
'23', // bannerId
6767
'7', // zoneId
@@ -75,7 +75,7 @@ <h1>Asynchronous ad tracking examples for snowplow.js</h1>
7575
document.body.appendChild(button);
7676
button.onclick = function() {
7777

78-
window.adTracker('trackAdConversion:' + rnd,
78+
window.adTracker('trackAdConversion:' + rnd,
7979

8080
'743560297', // conversionId
8181
'cpm', // costModel
@@ -110,14 +110,14 @@ <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.10.2/sp.js","adTracker"));
113+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.11.0/sp.js","adTracker"));
114114

115115
window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
116116
'encodeBase64': false
117117
});
118118

119119
window.adTracker('trackAdImpression:' + rnd, '17320923496', 'cpm', 6.5, 'http://www.example.com', '127', '', '');
120-
120+
121121
function clickHandler() {
122122
window.adTracker('trackAdClick:' + rnd, 'http://www.example.com', '', 'cpm', 6.5, '127', '', '', '17320923496', '');
123123
}
@@ -141,8 +141,8 @@ <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.10.2/sp.js","adTracker"));
145-
144+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.11.0/sp.js","adTracker"));
145+
146146
window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
147147
'encodeBase64': false
148148
});

examples/web/async-large.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
22
"http://www.w3.org/TR/html4/loose.dtd">
3-
<!--
3+
<!--
44
! Copyright (c) 2012-2013 Snowplow Analytics Ltd. All rights reserved.
55
!
66
! This program is licensed to you under the Apache License Version 2.0,
@@ -23,7 +23,7 @@
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.10.2/sp.js","snowplow_1"));
26+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.11.0/sp.js","snowplow_1"));
2727

2828
window.snowplow_1('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker
2929
encodeBase64: false, // Default is true
@@ -83,7 +83,7 @@
8383
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
8484
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
8585
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
86-
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.10.2/sp.js","snowplow_2"));
86+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.11.0/sp.js","snowplow_2"));
8787

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

examples/web/async-medium.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
22
"http://www.w3.org/TR/html4/loose.dtd">
3-
<!--
3+
<!--
44
! Copyright (c) 2012-2013 Snowplow Analytics Ltd. All rights reserved.
55
!
66
! This program is licensed to you under the Apache License Version 2.0,
@@ -24,7 +24,7 @@
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.10.2/sp.js","new_name_here"));
27+
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.11.0/sp.js","new_name_here"));
2828

2929
window.new_name_here('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', {
3030
encodeBase64: false,

0 commit comments

Comments
 (0)