Created
December 10, 2013 09:54
-
-
Save pherrymason/7888249 to your computer and use it in GitHub Desktop.
Analytics Tracking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trackEvent( zone ){ | |
// If ga is available & loaded. | |
if( typeof(ga)!=='undefined' ){ | |
// https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide | |
// Use universal analytics @todo | |
} | |
else | |
{ | |
var _gaq = window._gaq || []; // For tracking analytics | |
_gaq.push(['_trackEvent', category, action, value]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trackPageView( url ){ | |
if (typeof(ga)!=='undefined'){ | |
ga('send','pageview',{ | |
'page':url | |
}); | |
} | |
else { | |
var _gaq = _gaq || []; // For tracking analytics | |
_gaq.push(['_trackPageView', url] ); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment