Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11686

Update Google analytics code to the latest standard Google recomends

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      ... or maybe even better allow adding code manually. Right now the recommendation are:

      Copy the following code, then paste it onto every page you want to track immediately before the closing </head> tag.

      Single domain

      <script type="text/javascript">
      
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-XXX-X']);
        _gaq.push(['_trackPageview']);
      
        (function() {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
      
      </script>
      

      Domain with subdomains

      <script type="text/javascript">
      
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-XXX-X']);
        _gaq.push(['_setDomainName', '.XXX.org']);
        _gaq.push(['_trackPageview']);
      
        (function() {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
      
      </script>
      

      Multiple top-level domains

      <script type="text/javascript">
      
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-XXX-X']);
        _gaq.push(['_setDomainName', 'none']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview']);
      
        (function() {
          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
      
      </script>
      

        Attachments

          Activity

          zaytsev Yury Zaytsev created issue -
          zaytsev Yury Zaytsev made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          redsolo redsolo made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 141929 ] JNJira + In-Review [ 189884 ]

            People

            • Assignee:
              redsolo redsolo
              Reporter:
              zaytsev Yury Zaytsev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: