Issue 120301 - Wrong Google Analytics codes on MWiki
Summary: Wrong Google Analytics codes on MWiki
Status: CLOSED FIXED
Alias: None
Product: Infrastructure
Classification: Infrastructure
Component: Website general issues (show other issues)
Version: 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-17 21:36 UTC by Rob Weir
Modified: 2017-05-20 10:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rob Weir 2012-07-17 21:36:40 UTC
The MWiki pages have the following at the bottom of each page:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1087265-7']);
  _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>


This is incorrect.  The account number there (UA-1087265-7) is a legacy account, not the one used used by the rest of the website.  Until this is fixed we have no accurate stats on wiki usage in relationship to the rest of the website.

The correct code to use is:

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-30193653-1']);
    _gaq.push(['_setDomainName', 'openoffice.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>


Please use this code fragment.  Ideally it should be placed before the closing </head> of each page.  But where it is at the bottom will work as well.
Comment 1 jan iversen 2012-11-25 22:13:58 UTC
Changed the UA code, it needs to be tested
Comment 2 Rob Weir 2012-11-26 12:49:11 UTC
I verified that information from the wiki is now flowing properly to the Google Analytics account.