Google Analytics Scripts GA.JS - DEPRECATED ANALYTICS.JS - CURRENT VERSION According to Google: " The above code does four main things: 1) Creates a The function above is an *anonymous*, *self-invoking* function: A function, wrapped in parenthesis, and followed by another set of parenthesis containing the parameter values. This function will run automatically immediately upon loading. (function (i, s, o, g, r, a, m) { ... })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); So, to make this a little more readable: we can replace each of the parameters: i, s, o, g, r with their corresponding values: window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'. (Note that a and m parameters do not have input values as they will be set in the function itself.) Replacing those parameter variables with their passed values yields the following function: Looking at this function line-by-line: 1) window['GoogleAnalyticsObject'] = 'ga'; Creates a property of the browser window, called GoogleAnalyticsObject, and abbreviated to the name of 'ga'. 2) window['ga'] = window['ga'] || function () { (window['ga'].q = window['ga'].q || []).push(arguments) }, window['ga'].l = 1 * new Date(); Defines a global function (function attached to the browser window) named 'ga' (if it does not already exist). This function pushes its arguments in a queue Array (named q - get it? the ga.q (funny)), which is created if it does not already exist ([] indicates an empty array). It then assigns to a property called 'l' the current timestamp (which is multiplied by 1 to force it as an integer). 3) a = document.createElement('script'), Creates a new script tag (to be later inserted into the HTML document. 4) m = document.getElementsByTagName('script')[0]; Finds the first script tag. 5) a.async = 1; Sets the newly created script tag to asynchronous execution. 6) a.src = '//www.google-analytics.com/analytics.js'; Sets the src attribute of this script tag. Note that no protocol (http or https) is specified in the URL, which allows for the script to be loaded using the current browser protocol. 7) m.parentNode.insertBefore(a, m) The new script tag is inserted into the document before the first script tag and is loaded by the browser. 8) ga('create', 'UA-xxxxxxxx-x', 'xxxxxx.com'); Adds a request to the google analytics queue (ga.q) to create a google analytics tracker object. 9) ga('send', 'pageview'); Adds a request to the google analytics queue (ga.q) to send the pageview info to google analytics to be tracked. ----------- To recap: according to Google: " 1) Creates a