Announcement

Collapse
No announcement yet.

Eileen's guide to Google Analytics with V8

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

    Eileen's guide to Google Analytics with V8

    I've got Google Analytics successfully tracking line items and order totals and goals. Here is how I got it to work: (nb I am using the 'smart' theme with this site)
    Note: to avoid script errors, it is necessary to use actinic 'block if' statements

    For this example, your corresponding Google Goal url will be: /receipt.html and your funnel could be:
    Step1 url: /Checkout Page 0.html = Select Invoice location
    Step2 url: /Checkout Page 1.html = Invoice Address
    Step3 url: /Checkout Page 2.html = Select Payment Method
    Step4 url: /PSP Bounce Page.html = go to PSP


    In Actinic Design View,
    select the Content page

    1) select the 'Works Best With...' layout code
    2) Just before the </head> insert the following (of course replacing the xx's with your own account number:

    Code:
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    _uacct = "UA-xxxxxxx-x";
    Immediately following the previous code, we need an actinic block if statement.
    3) enter this code:
    Code:
    urchinTracker('<actinic:variable name="PageType" />.html');
    4) Hilite the urchinTracker line and right click, select Insert Block and in the Condition Editor box, paste this:

    Code:
    (<actinic:variable name="PageType" /> != "Section")
    5) Press 'OK' to close the window. You will see your urchinTracker statement surrounded by a green 'block if' construct.

    Immediately following the /block, we need a new line and another block if.
    6) Enter this code:
    Code:
    urchinTracker();
    7) hilight the urchinTracker() line and right click, select Insert Block and in the Condition Editor box, paste this:

    Code:
    (<actinic:variable name="PageType" /> == "Section")
    8) Press 'OK' to close the window. You will see your urchinTracker statement surrounded by a green 'block if' construct.

    9) following the /block, close the script with :

    Code:
    </script>
    That's it for the Header section.
    10) Now Change the body tag
    from:
    <body onload="<actinic:variable name="OnLoadScript" value="PreloadImages" />">
    To:
    Code:
    <body onload="<actinic:variable name="OnLoadScript" value="PreloadImages" />; javascript:__utmSetTrans()">
    11) and follow it immediately with:

    Code:
    <script type="text/javascript">
    <!--
    var utmt, utmi, utmordernumber, utmprice, utminvoice, utmquantity, utmprodref, utmproduct;
    utmi = "";
    // -->
    </script>
    Your code should now look like this:

    12) click 'Apply'

    That's it for the Content Page

    Now, switch to the Receipt Page
    13) Just before the </head> in the Receipt Page Layout, insert the following (of course replacing the xx's with your own account number:
    Code:
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-xxxxxxx-x";
    urchinTracker('receipt.html');
    </script>
    14) make the <body> statement look like this:
    Code:
    <body OnLoad="javascript:__utmSetTrans() ;">
    15) insert this code immediately after the <body> statement:
    Code:
    <script type="text/javascript">
    <!--
    var utmt, utmi, utmordernumber, utmprice, utminvoice, utmquantity, utmprodref, utmproduct;
    utmi = "";
    -->
    </script>
    16) Follow this with code to capture the order number and invoice address:
    Code:
    <script type="text/javascript">
    <!--
    utmordernumber = "<Actinic:Variable Name="TheOrderNumber"/>";
    utminvoice = "<Actinic:Variable Name="InvoiceAddress3"/>|<Actinic:Variable Name="InvoiceAddress4"/>|UK";
    -->
    </script>
    17) we need to turn the code from step 16 into a block if. Hilite the code, right click and in the Condition Editor window, paste:
    Code:
    (<actinic:variable name="IsEditableShoppingCart" />  == false)
    18) press OK to close the window
    19) just prior to the </body> statment, insert the following (again replacing the UA-XXXXXXX-X with your own account):

    Note: for debugging purposes, I have included two document.write statements. If you want to see the data you will be sending to Google, use the line with the 'textarea cols="80" rows="10" ' else, comment that line out and uncomment the other line.

    Code:
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-xxxxxxx-x";
    urchinTracker();
    document.write('<form  name="utmform"><textarea cols="80" rows="10" id="utmtrans">' + utmt + utmi + '</textarea></form>');
    /* document.write('<form style="display:none;" name="utmform"><textarea id="utmtrans">' + utmt + utmi + '</textarea></form>');*/
    </script>
    Your code show now look like this:
    20) Click Apply to save your changes.
    21) Still on the Receipt Page, navigate to Checkout Shopping Cart Grid
    (Receipt Page Layout/Receipt Page Bulk/Checkout Shopping Cart Grid)

    after <ActinicEFAULTTAXZONEMESSAGE/>

    insert:
    Code:
    	<script type="text/javascript">
    	<!--
    	utmt = "UTM:T|" + utmordernumber + "|Main Store|<actinic:variable name="Total" />|<actinic:variable name="Tax1" />|0.00|" + utminvoice;
    	-->
    	</script>
    then select that new code and turn it into a 'block if' with the condition being
    Code:
    (<actinic:variable name="IsEditableShoppingCart" />  == false)
    click Apply to save your changes

    22) Still on the Receipt Page, use the Design Tree to navigate to the Product Line Row. (Receipt Page Bulk/Checkout Shopping Cart Grid/Order line List/Product Line Row)
    23) prior to the <td for cost, insert the following block of code:
    Code:
    <script type="text/javascript">
    <!--
    utmprice = "NETQUOTEVAR:PRICE";	
    utmi += " UTM:I|" + utmordernumber + "|" + utmprodref + "|" + utmproduct + "||" + utmprice + "|" + utmquantity ; 
    -->
    </script>
    24) Hilite the new code in step 22 and turn it into a block if by right clicking and, select Insert Block and in the Condition Editor paste:
    ( <actinic:variable name="IsEditableShoppingCart" /> == false )
    25) Click Apply to save your changes


    26) Still on the Receipt Page, use the Design Tree to navigate to the Cart Product Details. (Receipt Page Bulk/Checkout Shopping Cart Grid/Order line List/Product Line Row/Cart Product Details)
    27) Immediately after <Actinic:XMLTEMPLATE NAME="ProductLine"> insert the following:
    Code:
    <script type="text/javascript">
    <!--
    utmquantity = "NETQUOTEVAR:QUANTITY";
    utmprodref = "NETQUOTEVAR:PRODREF";
    utmproduct = "NETQUOTEVAR:PRODUCTNAME";
    -->
    </script>
    28) Now, we must turn that code into a block if. Hilite the new code, right click and select 'Insert Block', and in the Condition Editor window, paste this:
    Code:
    (<actinic:variable name="PageType" /> != "Shopping Cart")
    29) press OK
    30) press Apply to save your changes
    31 ) update your Actinic web site

    remember, it takes several hours for your data to appear in Google Analytics.
    Eileen Eby
    http://www.wildbirdfood.uk.com

    #2
    Eileen,

    Excellent Post !! Will come in handy for a good many users. Thank you.
    Bruce King
    SellerDeck

    Comment


      #3
      hi thanks for that idiots guide
      hopefully this idiot has implemented it properly ill let you know

      many thanks

      Gareth
      Remembering the road to Actinic enlightenment is a long and sometimes painful one.
      Current project:
      cheapadulttoys4u.co.uk
      cheaplingerie4u.co.uk
      Something for the Missus,Something for the Weekend

      Comment


        #4
        Thats great Eileen - I am trying to make our 8.5 go live today and this was another chore to copy from 7.5.

        However do I read it right and your funnel is just from Checkout to receipt?

        Up to now I have used landing to receipt in which case the urchinTracker is on each page of brochure and catalog.

        Comment


          #5
          Hi Alistair...
          we haven't got any Brochure pages on our Actinic site....
          If you want to track them with Analytics, you will need to add the urchinTracker code to the 'Works best with.... Brochure Pages' prior to the </head> as well.

          My example tracks all standard catalog pages.

          For a funnel, you probably only want to track the payment process. The idea of the funnel is to see where you lose your customers, and how many make it to the goal.

          I haven't put our site live yet.. hopefully will do this week

          regards
          Eileen Eby
          http://www.wildbirdfood.uk.com

          Comment


            #6
            Hi Eileen

            That is indeed what I have done.

            I had the basic analytics (no order details) working fine on 7.5 site so I have basically used your more detailed approach across our 8.5.

            It should be online in an the next couple of hours.

            To add to my confusion I also have Google order tracking running.

            Up to now I have only used the basket drop out (which is frankly not very telling as it matches the expected norm) but in future we want to know the path people take through our site to get there or indeed to where they pick the phone up!

            Comment


              #7
              Hi Eileen

              What do you get or expect to get in the debug pane. I am getting;

              "undefined UTM:I|<order #>|<product code>|<product description>|<blank space>|<price>|<qty>"

              Which all looks fine except for the "undefined"?

              Comment


                #8
                Hi Alistair,
                I'm so sorry! I left out the snippet for the UTM:T line.

                I've incorporated the correction into my original post at "step 21"

                please note: I haven't got the code working yet if there is no tax. Instead I'm seeing NETQUOTEVAR:TAX1 and google converts that to 1 GBP.

                If you would like to have a play with my own test site and to compare my output source with your own, please visit http://www.eby.org.uk/acatalog/test/...rd_Tables.html
                Eileen Eby
                http://www.wildbirdfood.uk.com

                Comment


                  #9
                  Thanks Eileen - Great Job - Excellent Support

                  Another thing you should be aware of is that (certainly as far as my V7.5 implementation of Analytics went) if you run all or part of your site under SSL then the address to Google Analytics from those pages becomes;

                  https://ssl.google-analytics.com

                  I have used that in mine this a.m. I'll let you know if that doesn't work.

                  The tax bit will be useful if you crack it but we know all non EU and Channel Island sales are ex VAT.

                  Comment


                    #10
                    Hi Eileen

                    Looked at the results this morning and it is all there - orders, product and so on.

                    I have a lot of order numbers from our previous and up to yesterday p.m. without product info but after that we have product info.

                    If I get a minute I will look into non VAT and shipping.

                    Comment


                      #11
                      super!
                      I don't think I'll get a chance to put our V8 site live until 2 weeks from now - too few hours in a day!

                      cheers
                      Eileen Eby
                      http://www.wildbirdfood.uk.com

                      Comment


                        #12
                        I haven't got the code working yet if there is no tax.
                        I'm not sure what this means, can we use the above if all prices within catalog are vat inc,

                        ie do not use VAT features within actinic at all. An item is priced at £2.95 full stop - only postage is added

                        Comment


                          #13
                          Hi Jo
                          If you have no tax to show at all, I'd say just leave out that parm altogehter.
                          for the wildbirdfood site, we have some products with tax, some without.

                          I need to find a parm or 'if' statement to use when there is sometimes no tax.. just haven't got time yet to play with it.

                          cheers
                          Eileen Eby
                          http://www.wildbirdfood.uk.com

                          Comment


                            #14
                            WOW!
                            Thanks for this info.

                            I have just done it, but actinic is now saying about the spaces in the webpage names i.e Checkout Page 0.html, bounce SSL.html......... when i upload.
                            I have done this right?

                            Answer:
                            This is alright, just really old browsers wont be able to read the pages.

                            Also, in GA, what do i set the 'match type' for under additional settings when creating a goal? at the moment i have it as head match

                            Paul

                            Answer:
                            I changed it to "excat match"
                            "If my answers frighten you then you should cease asking scary questions"

                            Comment


                              #15
                              Hi Eileen
                              I have noticed something strange in the debug plane:

                              UTM:T|TTTEST20000521|Main Store|£2,873.97|£428.04|0.00|Test<BR>||UK
                              UTM:I|TTTEST20000521|568/18.25|18.25" Swatkins Ultimate Golf Champions Claret Jug||<font color=red>£1,871.28</font>|1 UTM:I|TTTEST20000521|731C|13.75cm(5.5") Gold & Gold tipped Footballer||<font color=red>£1.92</font>|300
                              I have ordered 2 products, but the price field is showing the font colour command
                              <font color=red>£****</font>
                              Any ideas?
                              thanks in advance

                              Paul

                              UPDATE:
                              Ignore this now, i have found out that its a revised script that has done this.
                              "If my answers frighten you then you should cease asking scary questions"

                              Comment

                              Working...
                              X