Making WordPress.org

Changeset 6466


Ignore:
Timestamp:
01/30/2018 04:07:17 PM (7 years ago)
Author:
obenland
Message:

Trac: Update Google Analytics snippet.

Props SergeyBiryukov, westonruter.
Fixes #2074.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/site.html

    r6446 r6466  
    280280    <py:if test="project_slug == 'core'">
    281281        <script type="text/javascript">
    282         var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    283         document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
     282        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     283            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     284            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
     285        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
     286
     287        ga('create', 'UA-52447-27', 'auto');
     288        ga('send', 'pageview');
    284289        </script>
    285         <script type="text/javascript">
    286         try {
    287         var pageTracker = _gat._getTracker("UA-52447-27");
    288         pageTracker._trackPageview();
    289         } catch(err) {}</script>
    290290    </py:if>
    291291
Note: See TracChangeset for help on using the changeset viewer.