Announcement

Collapse
No announcement yet.

Daves guide to Google Analytics with Actinic

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

    Daves guide to Google Analytics with Actinic

    Hi,
    The following describes what I have done to get Google Analytics working with Actinic. Use it at your own risk and keep in mind that if you've edited your template files the following may not be 100% compatible.

    1) Place the following code in Act_BrochurePrimary.html, Act_Primary.html and Act_PrimaryCheckout.html using your own Google Analytics number where indicated. This code needs to go in the <HEAD> section.

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "YOUR GOOGLE ANALYTICS NUMBER";
    urchinTracker();
    </script>


    2) Place the following code in Act_ReceiptPrimary.html using your own Google Analytics number where indicated. This code needs to go in the <HEAD> section. Note that receipt.html is a non-existent file.

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "YOUR GOOGLE ANALYTICS NUMBER";
    urchinTracker('receipt.html');
    </script>


    3) Edit the Onload control in the <BODY> tag of Act_ReceiptPrimary.html to include javascript:__utmSetTrans().

    For example:

    OnLoad="NETQUOTEVAR:ONLOAD"

    should look like this afterwards...

    OnLoad="NETQUOTEVAR:ONLOAD ; javascript:__utmSetTrans() ;"

    4) Place the following code at the bottom of Act_ReceiptPrimary.html. This needs to go just before the </BODY> tag.

    <form style="display:none" name="utmform">
    <textarea id="utmtrans"></textarea>
    </form>
    <script language="JavaScript" type="text/javascript">
    <!--
    var realprice = NETQUOTEVAR:ACTINICORDERTOTAL / 100;
    var line1 = 'UTM:T|NETQUOTEVAR:THEORDERNUMBER|affiliation|' + realprice + '|tax|shipping|city|state|NETQUOTEVAR:INVOICECOUNTRY';
    var line2 = 'UTM:I|NETQUOTEVAR:THEORDERNUMBER|NETQUOTEVAR:PRODUCTREFERENCE|NETQUOTEVAR:PRODUCTNAME|category|price|quantity';
    document.getElementById('utmtrans').value = line1 + '\n' + line2;
    //-->
    </script>


    5) Now you need to set up your Receipt goal in Google Analytics. You can call it what you like. I call mine 'Receipt'.

    Goal Name: Receipt
    Goal URL: /receipt.html

    ...check the ACTIVE GOAL checkbox to ON

    Step 1 URL: http://www.yoursite.com/cgi-bin/ca000001.pl
    Step 1 Name: Basket

    ...the Step 1 part is optional but it's useful to know that someone went to their basket. If you use this, tick the REQUIRED STEP checkbox. Don't forget to change www.yoursite.com to your own site.

    NOTE: If your cgi-bin directory has a different name you'll need to change this accordingly. Also if your script number is different you'll need to change this too. (eg ca000002.pl).

    Set Match Type to HEAD
    Set Goal value to 0

    Lastly you need to go into your Google Analytics Profile Settings and set E-COMMERCE WEBSITE to YES.

    That's it. Leave it a day or two while Google collects data then check to see if it's working.

    Added 20/07/06:
    ______________________________________________________________
    WARNING: If you are using your own secure server (not Actinic's Shared SSL) for the checkout pages, additional steps may be required. Your visitors may be presented with security warnings if you do not complete these additional steps. Further details can be found in the Google Analytics Help:

    http://www.google.com/support/analyt...y?answer=26915

    Be sure to test your checkout process carefully after making any changes.

    Dave
    Last edited by domino1; 20-Jul-2006, 04:14 PM. Reason: Added footnote

    #2
    Wonderful stuff. Thanks Dave. I'm sure this will prove very useful.

    Comment


      #3
      Works perfectly! Definately one for the new Advanced User Guide, been trying to get this working for ages!

      Dave
      Cheers

      David
      Located in Edinburgh UK

      http://twitter.com/mcfinster

      Comment


        #4
        not perfect

        this solution isn't perfect because:

        1. only the total value is tracked. no tax, no shipping, no city, no product name, etc.

        2. always report to analytics one line of utm:i regardless of how many items in the cart.

        3. if you choose 3rd party psp, and when customer goes through psp's gateway but don't claim a receipt after psp tells he/she payment acknowledged, your receipt has no chance to present to customer, neither to analytics.

        Comment


          #5
          Originally posted by anqi
          this solution isn't perfect
          Don't think there was a claim it was perfect - just that the above works perfectly!

          Do you know of a solution to implement the issues you have raised?


          Bikster
          SellerDeck Designs and Responsive Themes

          Comment


            #6
            no.

            i can solve problem 1 & 2.

            can't solve 3

            Comment


              #7
              i can solve problem 1 & 2.
              care to share the solution?

              Comment


                #8
                Originally posted by anqi
                i can solve problem 1 & 2.
                If you could post the solutions that would be great and hopefully inspire someone else to resolve the third.


                Bikster
                SellerDeck Designs and Responsive Themes

                Comment


                  #9
                  <body onLoad="javascript:__utmSetTrans()">

                  <script type="text/javascript">
                  <!--
                  var utmt, utmi, utmordernumber, utmprice, utminvoice;
                  utmi = "";
                  utmordernumber = "NETQUOTEVAR:THEORDERNUMBER";
                  utminvoice = "NETQUOTEVAR:INVOICEADDRESS3|NETQUOTEVAR:INVOICEADDRESS4|NETQUOTEVAR:INVOICECOUNTRY";
                  -->
                  </script>


                  <Actinic:XMLTEMPLATE NAME="ShoppingCart">
                  <Actinic:XMLTEMPLATE NAME="OrderLine">
                  <script type="text/javascript">
                  <!--
                  utmt = "UTM:T|" + utmordernumber + "|Main Store|NETQUOTEVAR:TOTAL|NETQUOTEVAR:TAX1| NETQUOTEVAR:SHIPPING|" + utminvoice;
                  utmprice = "NETQUOTEVAR:PRICE";
                  -->
                  </script>

                  <Actinic:XMLTEMPLATE NAME="ProductLine">
                  <script type="text/javascript">
                  <!--
                  utmi += " UTM:I|" + utmordernumber + "|NETQUOTEVAR:PRODREF|NETQUOTEVAR:PRODUCTNAME|STOCK BAGS|" + utmprice + "|NETQUOTEVAR:QUANTITY";
                  -->
                  </script>
                  </Actinic:XMLTEMPLATE>
                  </Actinic:XMLTEMPLATE>
                  </Actinic:XMLTEMPLATE>


                  <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
                  </script>
                  <script type="text/javascript">
                  _uacct="UA-xxxx-x";
                  urchinTracker();
                  document.write('<form style="display:none;" name="utmform"><textarea id="utmtrans">' + utmt + utmi + '</textarea></form>';
                  </script>
                  </body>


                  amend order04 to the above structure (irrelavant codes are omitted) after upload.

                  because analytics is so popular, why not integrate it into actinic v8? then problem 3 is not a problem at all.

                  Comment


                    #10
                    Thanks for posting the update


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      Hi An Qi.

                      Not bad. But I bet you can't put a fruit pastille in your mouth without chewing it.

                      Joking aside... Thanks for sharing your code. I'll give it a try when I get a chance.

                      Comment


                        #12
                        OK I will ask for the numpties (like myself) out there. Do you simply paste the full code as shown into Act_Order04.html (or Act_ReceiptPrimary.html) or is the code overwriting something that is already there?

                        Dave
                        Cheers

                        David
                        Located in Edinburgh UK

                        http://twitter.com/mcfinster

                        Comment


                          #13
                          irrelevant codes omitted: it means i only illustrate the positions to put in the analytics codes (make notice of <actinic:....>). of course order04 has its own codes to display receipt. if you simply copy and paste the above codes, your customer will get a blank page, only analytics get notified of this order.

                          please modify order04.html (after upload). don't modify Act_order04.html, because it will make analytics working in an unpredictable way.

                          Comment


                            #14
                            Daves guide to Google Analytics with Actinic

                            Can we start a posting of the month award?

                            If so Dave's first posting on this thread should be a clear winner for this month.

                            Thanks

                            Mike
                            Mike Julien

                            www.wheesh.com

                            Comment


                              #15
                              you can rate the thread, see thread tools at the top of the page

                              Comment

                              Working...
                              X