10 Nov 2024
Support Center
»
Knowledgebase
»
How do track my sales using Google Analytics?
How do track my sales using Google Analytics?
Solution
Google provides you with a code snippet to be placed on the Thank-You page (completed.html) of your cart to track sales through Google Analytics.
This code looks something similar to this:
<body onLoad="javascript:__utmSetTrans()">
<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>
The shopping cart requires some slight adjustments to track sales information within it's system.
Please make the changes outlined below, or simply copy and paste the snippet below into the completed.html page found in the /content/skins area of File Manager.
MAKE SURE YOU REPLACE YOUR TRACKER ID WITH THE CODE PROVIDE FEOM YOUR GOOGLE ACCOUNT.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._addTrans(
"{$order_id}", // Order ID
"{$affiliation}", // Affiliation
"{$order_amount}", // Total
"{$tax}", // Tax
"{$shipping_amount}", // Shipping
"{$city}", // City
"{$region}", // State
"{$country}" // Country
);
{foreach from=$items item="item"}
pageTracker._addItem(
"{$order_id}", // Order ID
"{$item.sku}", // SKU
"{$item.product_name}", // Product Name
"{$item.catalog_name}", // Category
"{$item.price}", // Price
"{$item.quantity}" // Quantity
);
{/foreach}
pageTracker._trackTrans();
</script>
Article Details
Article ID:
20
Created On:
06 Oct 2008 03:00 PM
User Comments
Add a Comment
Sharing is good. If you have a comment about this entry, please feel free to share. The comments might be reviewed by our staff, and may require approval before being posted. Questions posted will not be answered. Please submit a Ticket for support requests.
Image Verification Required
Please enter the characters that appear to the right in the space provided. This is just to verify that you are a human.
Fullname:
Email: (Optional)
Comments:
Back
Login
[Lost Password]
Email:
Password:
Remember Me:
Search
-- Entire Support Site --
Knowledgebase
Troubleshooter
Article Options
Add Comment
Print Article
PDF Version
Email Article
Add to Favorites
Home
|
Register
|
Submit a Ticket
|
Knowledgebase
|
Troubleshooter
|
News
Language:
English (U.S.)
Portugues
Help Desk Software
Help Desk Software By Kayako SupportSuite v3.70.02