Skip to content

Commit

Permalink
Merge branch 'feature/2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderdean committed Nov 5, 2014
2 parents bb88faf + fc1d865 commit 19af1d0
Show file tree
Hide file tree
Showing 23 changed files with 1,117 additions and 1,079 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
Version 2.1.0 (2014-11-05)
--------------------------
Added automated form submission tracking (#252)
Stopped outbound queue from triggering multiple times per event (#251)
Added PerformanceTiming context using HTML5 Web Performance API (#248)
Added ability to execute a custom callback once sp.js is loaded (#246)
Added internal site search event (#241)
Started using grunt-cloudfront-clear for CloudFront cache invalidation (#230)
Renamed /dist to /deploy (#216)
Moved context querystring to end of JS-generated beacons (#204)
Added guard to wait until outbound queue is empty before unloading (#202)
Added event_id generation (#190)
Added content field to link click events (#187)
Replaced "Getting started" with Vagrant-using "Contributing quickstart" (#169)
Added async-large.html (#162)
Improved F rating for tracker.js in CodeClimate (#150)
Added trackAddToCart and trackRemoveFromCart events (#97)
Added further Intern unit tests (#76)
Added social tracking features (#12)
Improved efficiency of enableLinkClickTracking (#254)
Integrated the Tracker Core (#255)
Removed deprecated trackImpression method (#256)
Added forceSecureTracker boolean option to the argmap, thanks @kujo4pmZ! (#247)
Moved link click tracking into its own file (#266)
Made IP address regex more strict (#267)
Updated expected browser fingerprints in functional detectors test (#275)
Added check to ensure outQueue is an array, thanks @kevinsimper! (#277)

Version 2.0.2 (2014-10-20)
--------------------------
Changed default configCookiePath to "/" (#250)
Expand Down
58 changes: 24 additions & 34 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports = function(grunt) {
dest: 'src/js/lib_managed/lodash.js',
options: {
exports: 'node',
include: 'isArray, isFunction, isString, isObject, isDate, isUndefined, isNull, map, compact, isEmpty',
include: 'isArray, isFunction, isString, isObject, isDate, isUndefined, isNull, map, filter, find, compact, isEmpty, clone',
flags: ['debug']
}
}
Expand All @@ -91,7 +91,7 @@ module.exports = function(grunt) {
browserify: {
main: {
files: {
'dist/bundle.js': ['src/js/init.js']
'deploy/bundle.js': ['src/js/init.js']
}
},
test: {
Expand All @@ -103,14 +103,14 @@ module.exports = function(grunt) {
},

concat: {
dist: {
deploy: {
options: {
'report': 'gzip',
'banner': '<%= banner %>',
'process': true
},
src: ['dist/bundle.js'],
dest: 'dist/snowplow.js'
src: ['deploy/bundle.js'],
dest: 'deploy/snowplow.js'
},
tag: {
options: {
Expand All @@ -122,15 +122,15 @@ module.exports = function(grunt) {
},

min: {
dist: {
deploy: {
options: {
linebreak: 1000,
report: 'gzip'
},
files: [
{
src: 'dist/snowplow.js',
dest: 'dist/sp.js'
src: 'deploy/snowplow.js',
dest: 'deploy/sp.js'
}
]
},
Expand All @@ -153,7 +153,6 @@ module.exports = function(grunt) {
runType: 'client',
config: 'tests/intern.js',
suites: [
'tests/nonfunctional/payload.js',
'tests/nonfunctional/in_queue.js',
'tests/nonfunctional/proxies.js'
]
Expand All @@ -172,7 +171,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-yui-compressor');
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-invalidate-cloudfront');
grunt.loadNpmTasks('grunt-cloudfront-clear');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('intern');
grunt.loadNpmTasks('grunt-lodash');
Expand All @@ -198,7 +197,7 @@ module.exports = function(grunt) {
},
upload: [
{
src: 'dist/sp.js',
src: 'deploy/sp.js',
dest: '<%= pkg.version %>/sp.js'
}
]
Expand All @@ -211,41 +210,32 @@ module.exports = function(grunt) {
},
upload: [
{
src: 'dist/sp.js',
src: 'deploy/sp.js',
dest: '<%= pkg.pinnedVersion %>/sp.js'
}
]
},
});

grunt.config('invalidate_cloudfront', {
options: {
key: '<%= aws.key %>',
secret: '<%= aws.secret %>',
distribution: '<%= aws.distribution %>'
grunt.config('cloudfront_clear', {
pinned: {
resourcePaths: ['<%= pkg.pinnedVersion %>/sp.js'],
secret_key: '<%= aws.secret %>',
access_key: '<%= aws.key %>',
dist: '<%= aws.distribution %>'
},
not_pinned: {
files: [
{
src: ['<%= pkg.version %>/sp.js'],
dest: ''
}
]
},
pinned: {
files: [
{
src: ['<%= pkg.pinnedVersion %>/sp.js'],
dest: ''
}
]
resourcePaths: ['<%= pkg.version %>/sp.js'],
secret_key: '<%= aws.secret %>',
access_key: '<%= aws.key %>',
dist: '<%= aws.distribution %>'
}
});
});

grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify:main', 'concat:dist', 'min:dist']);
grunt.registerTask('publish', 'Upload to S3 and invalidate Cloudfront (full semantic version only)', ['upload_setup', 'lodash', 'browserify:main', 'concat:dist', 'min:dist', 's3:not_pinned', 'invalidate_cloudfront:not_pinned']);
grunt.registerTask('publish-pinned', 'Upload to S3 and invalidate Cloudfront (full semantic version and semantic major version)', ['upload_setup', 'lodash', 'browserify:main', 'concat:dist', 'min:dist', 's3', 'invalidate_cloudfront']);
grunt.registerTask('default', 'Build lodash, Browserify, add banner, and minify', ['lodash', 'browserify:main', 'concat:deploy', 'min:deploy']);
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_clear:not_pinned']);
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_clear']);
grunt.registerTask('test', 'Intern tests', ['browserify:test', 'intern']);
grunt.registerTask('travis', 'Intern tests for Travis CI', ['lodash','browserify:test','intern']);
grunt.registerTask('tags', 'Minifiy the Snowplow invocation tag', ['min:tag', 'concat:tag']);
Expand Down
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@ With this tracker you can collect user event data (page views, e-commerce transa

## Developers

### Getting started
Make sure you have `node` and `npm` installed and in your `$PATH`.
* Install npm deps: `npm install`
* Install `grunt-cli`: `(sudo) npm install -g grunt-cli`
* Set up an `./aws.json` file using the example `./aws.sample.json`
* If you just want to concat + minify you don't need to fill out the
`aws.json` file with valid credentials.
* Build the package (default task concatenates and minifies) `grunt`
### Contributing quickstart

```
git clone --recursive https://github.com/snowplow/dev-environment.git && cd dev-environment
vagrant up && vagrant ssh
ansible-playbook /vagrant/ansible-playbooks/snowplow-javascript-tracker.yml --inventory-file=/home/vagrant/ansible_hosts --connection=local
cd /vagrant
git clone https://github.com/snowplow/snowplow-javascript-tracker.git
cd snowplow-javascript-tracker
sudo npm install
```

Set up an `./aws.json` file using the example `./aws.sample.json`. If you just want to concat + minify without uploading then you don't need to fill out the `aws.json` file with valid credentials.

Build the package (default task concatenates and minifies) using `grunt`.

## Testing

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/ads/async.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1>Asynchronous ad tracking examples for snowplow.js</h1>
;(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.0.2/sp.js","adTracker"));
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","//d1fc8wv8zag5ca.cloudfront.net/2.1.0/sp.js","adTracker"));

window.adTracker('newTracker', rnd, 'd3rkrsqld9gmqf.cloudfront.net', {
'encodeBase64': false
Expand Down
Loading

0 comments on commit 19af1d0

Please sign in to comment.