Tuesday, 27 December 2011

Getting Started with Google Analytics

Using E-commerce Tracking
Overview of E-commerce Tracking
Objective: In this module, you'll learn about e-commerce reports and how they show important commerce-related metrics like transactions and revenue. If your site sells products or services online, you can use these reports to track sales activity and performance.
Enabling E-commerce Reporting in the Profile
In order to use E-commerce reporting, you'll need to do three things.
Step 1: Enable E-commerce reporting within your Analytics website profile.
At the top of the Profile Settings page, you'll see a section called 'Main Website Profile Information.' Click 'Edit' at the top right corner of the section. Select 'Yes' in the "E-commerce Website" section and save your changes.
Step 2: Add or make sure that you've added the Google Analytics Tracking Code to your receipt page or Transaction Complete page.
Make sure that the Google Analytics Tracking Code is on your receipt page. You should probably place it near the top of the page because the code you add in Step 3 needs to appear after the Google Analytics Tracking Code.
As with the other pages on your site, you can use a server-side include or other template driver for dynamically generated pages. Another option is to simply copy and paste the code into your HTML for static pages.
Step 3: Tracking your receipt page
You'll need to add extra e-commerce code to your receipt page to track transaction details, which is outlined in the next section.
About the Receipt Page Format
In order to add your e-commerce code to your receipt page, please follow the instructions below.
The standard Google Analytics Tracking Code should be at the top. Then, there is a call to the _addTrans() method. The call to _addTrans() tells Google Analytics that a transaction has occurred. The arguments to _addTrans() provide details about the transaction -- for example an Order ID, the total order amount, and the amount of tax charged. After the call to _addTrans(), there must be at least one call to the _addItem() method. This call provides Google Analytics with details about the specific item purchased. Finally, there is a call to the trackTrans() method which sends all the data to Google Analytics.
This following code is an example of the code for e-commerce. Please do not paste the code below on to your actual site as the examples within the code's e-commerce fields will probably not fill your own business needs.
<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-12345-1"); pageTracker._initData(); pageTracker._trackPageview(); pageTracker._addTrans(
"1234", // order ID - required
"Mountain View", // affiliation or store name
"11.99", // total - required
"1.29", // tax
"5", // shipping
"San Jose", // city
"California", // state or province
"USA" // country
);

pageTracker._addItem(

"1234", // order ID - required
"DD44", // SKU/code
"T-Shirt", // product name
"Green Medium", // category or variation
"11.99", // unit price - required
"1" // quantity - required
);

pageTracker._trackTrans();

</script>
Managing Multiple Google Analytics Accounts
Overview of Managing Multiple Google Analytics Accounts
Objective: This module will teach you how to create and delete multiple accounts, and how to navigate your way around your accounts once you have administrative access to them.

2 comments:

  1. Toyota Solara AC Compressor
    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

    ReplyDelete

Search Engine Submissions
If you wish get high ranking in Google. So you need to check our Link Building Service