Announcement

Collapse
No announcement yet.

Bug: Google Analytics fails on home page.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Bug: Google Analytics fails on home page.

    Actinic is inserting a spurious acatalog/ into the code generated by layout Google Analytics Tracking Code when generating the home page.

    This means that the Google Analytics JavaScript file will not be loaded and Analytics won't be recording home page visits.

    This only happens on the sites home page (which is one you'd really want tracked).

    The problem comes from layout Google Analytics Tracking Code and the line:
    Code:
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    Actinic sees src= then "google-analytics.com/ga.js and thinks this is a reference to a local file so it sticks in the acatalog/ on the home page only.

    The fix is to replace the ga.js with ga%2Ejs as follows:
    Code:
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga%2Ejs' type='text/javascript'%3E%3C/script%3E"));
    In fact it wouldn't hurt to escape the equals sign too and be double-sure.
    E.g.
    Code:
    document.write(unescape("%3Cscript src%3D'" + gaJsHost + "google-analytics.com/ga%2Ejs' type='text/javascript'%3E%3C/script%3E"));
    This has been mentioned before but I see it's still in V10.0.2 Beta 2 so it looks overdue for fixing.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    #2
    Thanks for raising this Norman. We've reproduced and logged it and hopefully it will be fixed in the maintenance release we're just starting.

    Chris

    Comment


      #3
      Hi Norman,

      Thanks for your post. I have raised a bug and should be fixed shortly.

      Regards,
      Sumiya
      Actinic QA

      Comment


        #4
        Google have modified the Analytics code:
        <script type="text/javascript">

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


        unfortunately Actinic V10.2 does the same with this script and adds /acatalog to the script

        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + 'acatalog/.google-analytics.com/ga.js';

        Comment


          #5
          _gaq.push(['_setDomainName', 'roundstooldistribution.co.uk']);
          _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);
          })();

          What do i need to change here? is it remove the + sign before google analytics?
          Rounds Tool Distribution
          Power Tools, Hand Tools and Workwear
          http://www.roundstooldistribution.co.uk

          Comment


            #6
            There was a typo in my post #1 (I've corrected it now). It should read:

            The fix is to replace the ga.js with ga%2Ejs
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              I have changed the code but it still doesn't show homepage visitors.

              Ok just reloaded the site a second time it is working now
              Rounds Tool Distribution
              Power Tools, Hand Tools and Workwear
              http://www.roundstooldistribution.co.uk

              Comment

              Working...
              X