Skip to content

Instantly share code, notes, and snippets.

@John2496
Created June 10, 2013 14:31
Show Gist options
  • Select an option

  • Save John2496/5749137 to your computer and use it in GitHub Desktop.

Select an option

Save John2496/5749137 to your computer and use it in GitHub Desktop.
if (typeof console === "undefined"){
console = {};
console.log = function(){
return;
}
}
Tracking = {
logAction : function(category, action, label)
{
if (typeof label == 'undefined') {
label = '';
}
label += "";
_gaq.push(['_trackEvent', category, action, label]);
console.log("Tracking - Category: " + category + ", Action: " + action + ", Label: " + label);
}
};
// Example Usage
Tracking.logAction("Game", "Start Button Click")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment