Advertisement
Guest User

analytics

a guest
Dec 14th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- Google Analytics -->
  2. <script>
  3. /**
  4.  * Creates a temporary global ga object and loads analytics.js.
  5.  * Parameters o, a, and m are all used internally. They could have been
  6.  * declared using 'var', instead they are declared as parameters to save
  7.  * 4 bytes ('var ').
  8.  *
  9.  * @param {Window}        i The global context object.
  10.  * @param {HTMLDocument}  s The DOM document object.
  11.  * @param {string}        o Must be 'script'.
  12.  * @param {string}        g Protocol relative URL of the analytics.js script.
  13.  * @param {string}        r Global name of analytics object. Defaults to 'ga'.
  14.  * @param {HTMLElement}   a Async script tag.
  15.  * @param {HTMLElement}   m First script tag in document.
  16.  */
  17. (function(i, s, o, g, r, a, m){
  18.   i['GoogleAnalyticsObject'] = r; // Acts as a pointer to support renaming.
  19.  
  20.   // Creates an initial ga() function.
  21.   // The queued commands will be executed once analytics.js loads.
  22.   i[r] = i[r] || function() {
  23.     (i[r].q = i[r].q || []).push(arguments)
  24.   },
  25.  
  26.   // Sets the time (as an integer) this tag was executed.
  27.   // Used for timing hits.
  28.   i[r].l = 1 * new Date();
  29.  
  30.   // Insert the script tag asynchronously.
  31.   // Inserts above current tag to prevent blocking in addition to using the
  32.   // async attribute.
  33.   a = s.createElement(o),
  34.   m = s.getElementsByTagName(o)[0];
  35.   a.async = 1;
  36.   a.src = g;
  37.   m.parentNode.insertBefore(a, m)
  38. })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
  39.  
  40. // Creates a default tracker with automatic cookie domain configuration.
  41. ga('create', 'UA-XXXXX-Y', 'auto');
  42.  
  43. // Sends a pageview hit from the tracker just created.
  44. ga('send', 'pageview');
  45. </script>
  46. <!-- End Google Analytics -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement