lamiastella

Google analytics

Jul 29th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script async="" src="//www.google-analytics.com/analytics.js"></script>
  2.  
  3. <script>  
  4. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  5.   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  6.   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  7.   })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  8.  
  9.   var GA_LOCAL_STORAGE_KEY = 'ga:clientId';
  10.   if (window.localStorage) {
  11.     ga('create', 'UA-366077-13', {
  12.       'storage': 'none',
  13.       'clientId': localStorage.getItem(GA_LOCAL_STORAGE_KEY)
  14.     });
  15.     ga(function(tracker) {
  16.       localStorage.setItem(GA_LOCAL_STORAGE_KEY, tracker.get('clientId'));
  17.     });
  18.     ga('send', 'pageview', '/[fiddle]/[revision]/'); // where `url_structure` is for example `/[user]/[fiddle]/[revision]/embedded/js,css/`
  19.   }
  20. </script>
Add Comment
Please, Sign In to add comment