Skip to content

Instantly share code, notes, and snippets.

@KELiON
Created January 18, 2013 07:31
Show Gist options
  • Save KELiON/4562940 to your computer and use it in GitHub Desktop.
Save KELiON/4562940 to your computer and use it in GitHub Desktop.
Google analytics: track page view
var trackPageView = function(url) {
if (typeof _gat === 'undefined') {
_gaq.push(['_setAccount', googleAccountId]);
_gaq.push(['_trackPageview', url]);
} else {
var pageTracker = _gat._getTracker(googleAccountId);
pageTracker._trackPageview(url);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment