Un-obfuscating the GA.JS file | Analytics Pros

Un-obfuscating the GA.JS file

Posted by Caleb Whitmore on April 24, 2009

Quick post!

Need to read the Google Analytics GA.JS script easily?

If you’ve done much Google Analytics technical work you’ll know that figuring out the Google Analytics ga.js script is really hard thanks to the obfuscation/optimization it has been run through.   This trick won’t completely un-obfuscate the script, but it will make it a heck of a lot easier to read.

So, to see a readable version of the ga.js script, simply copy the script (click here, the select all, copy), and go to the JavaScript Beautifier, paste the script in, and voila.  Now you can much more easily track down a method definition to, say, figure out why cookies aren’t being set in your custom implementation the way you want them to be set.


Thanks to Fuor Digital (Chicago-based Digital Media Specialists) via Twitter (@fuordigital) for the Tweet passing on a link for 28 really useful web development tools that included a link to an online JavaScript “beautifier”.

UPDATE:  Found some additional JavaScript testing, validation, fomat checking, compacting, and compression!

Print Friendly