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
Immediately following the previous code, we need an actinic block if statement.
Immediately following the /block, we need a new line and another block if.
That's it for the Header section.
Your code should now look like this:
That's it for the Content Page
Now, switch to the Receipt Page
Your code show now look like this:
remember, it takes several hours for your data to appear in Google Analytics.
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:
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";
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 :
9) following the /block, close the script with :
Code:
</script>
10) Now Change the body tag
from:
<body onload="<actinic:variable name="OnLoadScript" value="PreloadImages" />">from:
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>
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.
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>
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:
then select that new code and turn it into a 'block if' with the condition being
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:
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>
Code:
(<actinic:variable name="IsEditableShoppingCart" /> == false)
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)
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
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.
Comment