Skip to content

Instantly share code, notes, and snippets.

@adastreamer
Last active March 15, 2016 14:31
Show Gist options
  • Save adastreamer/e5c40bccde5200d4af1f to your computer and use it in GitHub Desktop.
Save adastreamer/e5c40bccde5200d4af1f to your computer and use it in GitHub Desktop.
<script type="text/javascript">
window.gaInit = function() {
$.getScript('//www.google-analytics.com/analytics.js'); // jQuery shortcut
window.ga = window.ga || function () { (ga.q = ga.q || []).push(arguments) }; ga.l = +new Date;
ga('create', 'UA-69738551-3', 'auto');
ga('require', 'linkid');
return ga;
};
window.gaTrack = function(path, title) {
var track = { page: path, title: title };
ga = window.ga || gaInit();
ga('set', track);
ga('send', 'pageview');
};
window.gaInit();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment