Skip to content

Instantly share code, notes, and snippets.

@rbg246
Created November 30, 2015 09:28
Show Gist options
  • Save rbg246/e7aceddba5a1ad948577 to your computer and use it in GitHub Desktop.
Save rbg246/e7aceddba5a1ad948577 to your computer and use it in GitHub Desktop.
Prints a list of universal analytic ids found on a site
function checkAnalytics () {
var ids = ga.getAll();
var len = ids.length;
console.log('Universal Analytics');
console.log('ids', ids);
console.log('=======================================================');
console.log('Number of Universal Analytics IDs found : ' + ids.length);
console.log('=======================================================');
console.log('Universal Analytics IDs');
console.log('=======================================================');
while (len--) {
console.log(ids[len].get('trackingId'));
}
}
checkAnalytics()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment