Announcement

Collapse
No announcement yet.

Updated Google Analytics Code (will it work)

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

    #16
    I wonder if someone could gently explain to me if I should use the new google analytics code previously mentioned... as the old code does still appear to be working.

    I want to track 'conversions' and I have set up a 'goal' on google for /receipt.html.

    Do I replace all the old code in
    Design : Library > Google Analytics Markup > Google Analytics Tracking Code
    With the new code below?


    Code:
    <script type="text/javascript">
    
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '<actinic:variable name="GoogleAnalyticsNumber" />']);
      _gaq.push(['_trackPageview','<actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22">/receipt.html</actinic:block>']);
    
      (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>
    Arka Tribal Jewellery

    Comment


      #17
      and whats all the talk about altering the receipt page?
      Arka Tribal Jewellery

      Comment


        #18
        Originally posted by drounding View Post
        If you are using the same layout across all pages then 'Google Analytics Variable Setup' needs to go before the INNERLAYOUT and 'Google Analytics Order Transmission' needs to go after the INNERLAYOUT.

        Essentially the variables that will contain the ecommerce data need to be defined before they can be set and transmitted.
        any Idea how to edit these? so the same data is passed to analtics with the Async code? Cheers, Lee

        Google Variable Setup
        ---------------------------

        <actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsGoogleAnalyticsEnabled%22%20%2f%3e%20%3d%3d%20true%29%20AND%20%28%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%20%3d%3d%20%22Receipt%22%29" >
        <script type="text/javascript">
        <!--
        var act_order, act_item, act_ordernumber, act_productname, act_price, rConverDot, rRemoveEncoded;
        act_item = "";
        act_ordernumber = "<actinic:variable name="TheOrderNumber" />";
        rConverDot = new RegExp(".", "g");
        rRemoveEncoded = new RegExp("&#\\d*;", "g");
        //-->
        </script>
        </actinic:block>


        Google ananlytics Order Transmissio
        -----------------------------------------
        <actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsGoogleAnalyticsEnabled%22%20%2f%3e%20%3d%3d%20true%29%20AND%20%28%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%20%3d%3d%20%22Receipt%22%29" >
        <script type="text/javascript">
        var pageTracker = _gat._getTracker("<actinic:variable name="GoogleAnalyticsNumber" />");
        pageTracker._initData();
        pageTracker._trackPageview();

        eval(act_order);

        eval(act_item);

        pageTracker._trackTrans();
        </script>
        </actinic:block>
        http://www.novadetox.co.uk

        Comment


          #19
          google analytics error

          Originally posted by graphicz View Post
          Here it is with Norman's correction:
          You do get a javascript error if you use the Analytics number variable rather than entering the number itself
          I guess this is one of those Actinic errors one ignores and doesn't let the client see!
          Code:
          <script type="text/javascript">
          
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', '<actinic:variable name="GoogleAnalyticsNumber" />']);
            _gaq.push(['_trackPageview','<actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Receipt%22">/receipt.html</actinic:block>']);
          
            (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>
          I now have a error after setting up google analytics ("unterminated string constant") but i'm using v9
          Is this the error that is mentioned in this post?
          I also get a "Done but with errors on the page" message in the bottom LH in IE when uploaded live.
          Is there a fix?

          Comment


            #20
            Google Analytics

            Originally posted by Duncan Rounding View Post
            If you are using the same layout across all pages then 'Google Analytics Variable Setup' needs to go before the INNERLAYOUT and 'Google Analytics Order Transmission' needs to go after the INNERLAYOUT.

            Essentially the variables that will contain the ecommerce data need to be defined before they can be set and transmitted.

            Yhea but i think the code in these two variables Google Analytics Order Transmission and Google Analytics Variable Setup has to change when you implement the new google tracking code? at the moment Ive added the new tracking code but the two variables need editing can you help?

            thanks Lee
            http://www.novadetox.co.uk

            Comment


              #21
              hi anyone sussed this out ??

              tracking code latest version google?
              http://www.novadetox.co.uk

              Comment

              Working...
              X