Like Google Analtics, Google urchin tracks E-commerce features and requires specific inserts. Urchin can automatically detect and record transactions and product information by adding some simple features to the receipt page (the order provides a success prompt). The required information is placed in a hidden form that is parsed into transaction and product information.
First, enable E-commerce tracking
The first step in tracking E-commerce transactions is to enable the e-commerce report for the selected profile. To enable e-commerce reporting, use the following procedure:
Log in to Urchin.
Click Modify next to the configuration file that you want to enable.
On the Site Profile Settings page, click Modify next to main site configuration information.
Change the e-commerce Web site radio button from No to Yes.
Second, the receipt page format
The second step is to ensure that the tracking code is added to the receipt page in a standard format. You can use a server-side code module or you can enter HTML code directly:
<script src= "/urchin.js" type= "text/javascript> </script>
Next, write the following line in the receipt page code. All content in parentheses should be replaced with an actual value (an E-commerce Web site is usually a variable name), as described in the following parameter data:
<form style= "Display:none" name= "Utmform" >
<textarea id= "Utmtrans" >
Utm:t[order-id][affiliation][total][tax] [Shipping][city][state][country]
Utm:i[order-id][sku/code][productname][category][price][quantity]
</textarea>
</form>
Finally, make sure to call the Utmsettrans function after the form is submitted to record the transaction. The easiest way to do this is by starting the body OnLoad event within the tag:
<body onload= "Javascript:__utmsettrans ()" >
If you cannot modify the tag, you can call the Utmsettrans function within a separate script tag, provided you make sure that the function is called after the form:
<script type= "Text/javascript" >__utmsettrans ();</script>
Note: When setting values for a form, do not include square brackets. Also, do not separate the thousands in the totals, taxes, and freight fields with commas, and the numbers after the comma are ignored.
Example
Utm:t34535main Store111108.068467.0610.00san Diegocausa
Utm:i34535xf-1024urchin t-shirtshirts11399.009
Utm:i34535cu-3424urchin Drink HolderAccessories20.002
There are two types of rows in a hidden form: The transaction line and the project row. For each transaction, there should be only one transaction line, which is indicated by "T" followed by "UTM:". This row specifies the total amount of the transaction, including all taxes or freight and other information. For each item in the receipt, create a project line that is represented by "I". The project line can include the product name, code, unit price, and quantity. There are no restrictions on the number of items per transaction.
Parameter information:
Transaction line variables
[Order-id] Your internal unique order ID number
[Affiliation] optional partner or store affiliate
Total transaction amount (in United States dollars)
Tax on [tax] transactions
Freight for [shipping] Transactions
[City] associated with a transaction
[State/region] State/Province
[Country] Country/region
Project Row variables
[Order-id] Your internal unique order ID number (should be the same as the transaction line)
[Sku/code] Product SKU Code
[Product Name] Product name or description
Categories of [Category] products or similar products
[Price] Product cost
[Quantity] Number of bookings
about how to process across domains
Typically, the above basic approach already completes the urchin e-business tracking configuration, but sometimes it encounters cross-domain situations:
1. Cross-domain (e.g. www.example.com to buy.example.com)
This is a good case, just add a statement that defines the primary domain, and the following is the common Code section that you add:
<script src= "/urchin.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" >_udn= "mystore.com";</script>
2. Cross-primary domain (e.g. www.example.com to www.shop.com)
In this case, you need to add the following line (shown in bold) to your store site and the tracking code for your Shopping cart page:
<script src= "/urchin.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" >
_udn= "None";
_ulink=1;
</script>
Change the link between the main web site and the secure Web site to use Utmlinker as shown below. If your current link is as follows:
<a href= "Https://www.securecart.com/?store=parameters" > Buy Now </a>
Change it to:
<script type= "Text/javascript" >
document.write (' <a href= ' javascript:__utmlinker (' https://www.securecart.com/?store=parameters '); " > Buy Now </a> ');
</script>
<noscript>
<a href= "Https://www.securecart.com/?store=parameters" > Buy Now </a>
</noscript>
Whether or not the user has JavaScript enabled, the above code can provide a link for the user. In particular, note that when an apostrophe appears in a linked or linked text, it should be escaped with a backslash. Important: If your Web page contains calls to Urchintracker (), Utmlinker (), Utmsettrans (), or utmlinkpost (), you need to place the Google Analytics (profiling) trace code in the HTML Above these calls in the code. In such cases, the trace code can be placed anywhere between the start tag and the JavaScript call.
If you use a form to send information to a shopping cart, use the Utmlinkpost () function. It attaches the Cookie data to the URL of the form that is provided.
<form action= "HTTP://newdomain.com/form.cgi" onsubmit= "Javascript:__utmlinkpost (This)" >
Even in method= "get", you can work properly.
Important: If your Web page contains calls to Urchintracker (), Utmlinker (), Utmsettrans (), or utmlinkpost (), you need to place the Google Analytics (profiling) trace code in the HTML Above these calls in the code. In such cases, the trace code can be placed anywhere between the start tag and the JavaScript call.
Article Source: Search marketing Art, reprint please indicate the source. Original: http://www.searchmarketingart.com/how-do-i-track-e-commerce_transactions.html