News for hackers. Stuff that matters.
Re:Deconstructing the Google Analytics tracking script by tkazec on Thursday June 29, 2017 @06:46AM (#14662151)
Documented, including the official unminified source, in Google's analytics.js reference: https://developers.google.com/analytics/devguides/collection...
Re:Deconstructing the Google Analytics tracking script by keganunderwood on Thursday June 29, 2017 @07:05AM (#14662223)
Would be nice if they included what variable names they use inside google instead of just i s o g r a m.
Re:Deconstructing the Google Analytics tracking script by onion2k on Thursday June 29, 2017 @07:45AM (#14662414)
They explain what the variables mean in the function header block;

   * @param {Window}        i The global context object.
   * @param {HTMLDocument}  s The DOM document object.
   * @param {string}        o Must be 'script'.
   * @param {string}        g Protocol relative URL of the analytics.js script.
   * @param {string}        r Global name of analytics object. Defaults to 'ga'.
   * @param {HTMLElement}   a Async script tag.
   * @param {HTMLElement}   m First script tag in document.
It might be easier to read the code if they used different names, but any good refactoring tool will replace them with your own names without any problems.
Re:Deconstructing the Google Analytics tracking script by austinjp on Thursday June 29, 2017 @07:36AM (#14662349)
I've noticed several minified JavaScripts that have the variables spell words like the i s o g r a m here. Haven't bookmarked any so I can't find an immediate example. I thought it was just a curiosity, but I think the frequency is increasing. I wonder why. Just for giggles? Or is there any particular reason?
Re:Deconstructing the Google Analytics tracking script by fenwick67 on Thursday June 29, 2017 @09:12AM (#14662978)
kanyewest.com replaces the letters with "k,a,n,y,e"

    !function(k,a,n,y,e){k.GoogleAnalyticsObject=n;k[n]||(k[n]=function(){
    (k[n].q=k[n].q||[]).push(arguments)});k[n].l=+new Date;y=a.createElement('script');
    e=a.scripts[0];y.src='//www.google-analytics.com/analytics.js';
    e.parentNode.insertBefore(y,e)}(window,document,'ga');

    ga('create', 'UA-34495711-11', 'auto');
    ga('send', 'pageview');
Re:Deconstructing the Google Analytics tracking script by che_shirecat on Thursday June 29, 2017 @09:40AM (#14663185)
that's hilarious, I wonder who makes/manages celebrity sites like that.
Re:Deconstructing the Google Analytics tracking script by fancy_pantser on Thursday June 29, 2017 @12:45PM (#14664704)
Lane Goldberg in this case.

http://www.builtbylane.com/

Re:Deconstructing the Google Analytics tracking script by acdx on Thursday June 29, 2017 @08:23AM (#14662626)
Using 1-character variable names saves a small amount of network bandwidth on a massive scale (for every site that uses Google Analytics). You then might as well make the 1-character variable names spell out a word, and that word has to be an "isogram" in order to provide unique variable names.
Re:Deconstructing the Google Analytics tracking script by Theodores on Thursday June 29, 2017 @08:00AM (#14662504)
Here is an example for you:

   (function(h,o,t,j,a,r){
        h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
        h._hjSettings={hjid:1,hjsv:5};
        a=o.getElementsByTagName('head')[0];
        r=o.createElement('script');r.async=1;
        r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
        a.appendChild(r);
    })(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
https://docs.hotjar.com/v1.0/docs/understanding-the-tracking...

I believe that Google set a trend, 'HotJar' is a newbie on the block. If anyone can find an example that predates 'urchin.js' (or wherever this started) please share!

Re:Deconstructing the Google Analytics tracking script by tmm on Thursday June 29, 2017 @10:01AM (#14663356)
I don't know where it started for software, but I can give you an example that predates the web.

In the 80s and early 90s my mother was an interior designer at a high end furniture store. There were no prices on the floor models because most things could be customized (fabric, arm shape, wood, etc) before delivery. However there was a base price that the designer could use to (I guess) keep people within their budget.

They used a ten-letter isogram to print the base price covertly on the furniture labels so that associates could figure it out without going to the back office and looking it up in the computer.

The last word I remember them using was Cumberland. C=0, d=9. So if the base price for a dining room table was $15,840 the tag would have urnec written on it somewhere.

Re:Deconstructing the Google Analytics tracking script by dsfyu404ed on Thursday June 29, 2017 @12:02PM (#14664327)
Used car dealers do that. There's usually an alphanumeric that tells the salesperson how much they paid for the car and some other stuff.
Re:Deconstructing the Google Analytics tracking script by kamakazizuru on Thursday June 29, 2017 @10:09AM (#14663428)
that's the kinds of insightful comments I come here for. Side note, I remember in a gift / greeting card shop growing up, everything had long numbers printed on a little sticker on the back, turns out the price was just the last 4 numbers (divided by 1000).
Re:Deconstructing the Google Analytics tracking script by forgot-my-pw on Thursday June 29, 2017 @11:50AM (#14664215)
Re:Deconstructing the Google Analytics tracking script by zdkl on Thursday June 29, 2017 @07:49AM (#14662436)
Increased FUD compared to using the plain alphabet maybe?
Re:Deconstructing the Google Analytics tracking script by eli on Thursday June 29, 2017 @09:03AM (#14662916)
More in the spirit of an easter egg than FUD, I think.
Re:Deconstructing the Google Analytics tracking script by aiiane on Thursday June 29, 2017 @11:58PM (#14668552)
Who says there are different variable names used inside Google? This is a single-function code snippet that is entirely public.