Skip to content

Instantly share code, notes, and snippets.

@marinhero
Last active February 8, 2017 17:50
Show Gist options
  • Save marinhero/415c5a934621aff2d925a1dabe0075b3 to your computer and use it in GitHub Desktop.
Save marinhero/415c5a934621aff2d925a1dabe0075b3 to your computer and use it in GitHub Desktop.
An Example of the analytics.js module in the beacon.
define(['jquery'], function(jq){
//Edited for readability purposes
var $ = jq.noConflict(true);
var initialize = function() {
pixel();
google();
};
var pixel = function() {
var pixel_url = "https://ourtrackingurl";
$.get(pixel_url).fail(function(error) {
console.log('Wootric: Error: tracking pixel -> ', error.statusText);
});
}
};
var google = function() {
// GA tracker settings
ga('wootricTracker.send', 'pageview');
};
return { initialize: initialize };
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment