Skip to content

Instantly share code, notes, and snippets.

@JacobLett
Forked from huobazi/GA.js
Last active April 1, 2016 18:05
Show Gist options
  • Save JacobLett/20081fbcb398f472a7746a984817c6a0 to your computer and use it in GitHub Desktop.
Save JacobLett/20081fbcb398f472a7746a984817c6a0 to your computer and use it in GitHub Desktop.
Classic Google Analytics code - ga.js
// Google Analytics
(function(window, document, undefined) {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XXX']);
_gaq.push(['_setDomainName', 'XXX']);
_gaq.push(['_trackPageview', document.location.pathname +
document.location.search + document.location.hash]);
(function(d, t) {
var ga = d.createElement(t);
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == d.location.protocol ?
'//ssl' : '//www') + '.google-analytics.com/ga.js';
var s = d.getElementsByTagName(t)[0];
s.parentNode.insertBefore(ga, s);
})(document,'script');
})(this, this.document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment