Skip to content

Instantly share code, notes, and snippets.

@kosperera
Last active April 30, 2019 08:13
Show Gist options
  • Save kosperera/409052996ceaeceff60c3da887af4856 to your computer and use it in GitHub Desktop.
Save kosperera/409052996ceaeceff60c3da887af4856 to your computer and use it in GitHub Desktop.
Show Google Analytics Tracker data.
function showmethemoney(asjson) {
var a = ga.getAll();
a.forEach(function(g) {
var json = {
gid: g.get('_gid'),
trackingId: g.get('trackingId'),
clientId: g.get('clientId'),
cookieDomain: g.get('cookieDomain'),
location: g.get('location'),
data: JSON.parse(JSON.stringify(g.b.data.values))
};
console.log(asjson ? JSON.stringify(json) : json);
});
}
@kosperera
Copy link
Author

How to run

  • Goto the website
  • Open Developer Tools > Console
  • Copy Paste the code snippet
  • Call showmethemoney()

To get the output as JSON string

  • Call showmethemoney(asjson = true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment