Your Google Analytics Questions Answered

Your Google Analytics Questions Answered

I’m very pleased at the level of response to my post Tell Us! What Are You Looking For in Your Analytics? where I opened the proverbial floor to questions about getting the most out of your Google Analytics. So in no particular order here are my answers to the most commonly asked questions I received.

Most of your questions were to do with using Analytics to track website revenue/income.  You can do this in a few ways depending on your website. If you have an online store, you can do straight up E-Commerce Tracking, a 2-step process that involves editing some HTML.  If you don’t have an online store, but want to attach dollar values to certain goals, you can use normal Goal Tracking.

Now, I’m going to take you through how to set up both E-Commerce and normal Goal Tracking.

How Do I Set Up E-Commerce Tracking?

As mentioned, this is a 2 step process. First, we have to enable E-Commerce Tracking in Analytics, and then add a special tracking code to the purchase receipt/invoice page of your shopping cart.

Step 1 – Enabling E-Commerce Tracking

Sign in to your account

Click Edit next to the profile on which you’d like to enable E-Commerce Tracking.

On the Profile Settings page, click Edit next to Main Website Profile Information.

Change the E-Commerce Website radio button from No to Yes.

Step 2 – Adding the E-Commerce Code

Now you need to find your tracking code so you can place it on your receipt/invoice page. Many popular e-commerce platforms do this for you automatically (such as Magento), and many others have modules or plugins available that can be downloaded to find and place this code.

Here are the relevant plugins and guides for the most popular e-commerce systems currently on the web:

OsCommerce: How to setup E-Commerce tracking in Analytics

Zen Cart: Zen Cart Analytics Module

Volusion: Analytics Setup Module

If your online store is not one of those mentioned above, and you can’t find a plugin or module to do take care of installing your E-Commerce Tracking code for you, you’ll have to do it manually. Here’s where the HTML editing comes in.

On your receipt/page you have to add a few lines of JavaScript code:

Important Note: These values are placeholder values, and should be replaced with values from your E-Commerce System. Make sure to change UA-XXXXX-X to your Analytics ID

<head>

<title>Receipt for your clothing purchase from Acme Clothing</title>

<script type="text/javascript">

var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-XXXXX-X']);

_gaq.push(['_trackPageview']);

_gaq.push(['_addTrans',

'1234',           // order ID - required

'Acme Clothing',  // affiliation or store name

'11.99',          // total - required

'1.29',           // tax

'5',              // shipping

'San Jose',       // city

'California',     // state or province

'USA'             // country

]);

There are 3 parts to the E-Commerce Tracking Code. The first part tells Analytics that a transaction has occurred. For this, we set it up so your e-commerce system provides Analytics with a Transaction ID and the total amount:

<head>

<title>Receipt for your clothing purchase from Acme Clothing</title>

<script type="text/javascript">

var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-XXXXX-X']);

_gaq.push(['_trackPageview']);

_gaq.push(['_addTrans',

'1234',           // order ID - required

'',  // affiliation or store name

'11.99',          // total - required

'',           // tax

'',              // shipping

'',       // city

'',     // state or province

''             // country

]);

The next part of the code tells Analytics about each item in the order. This lets us see which keywords drive the sales of which products:

// add item might be called for every item in the shopping cart

// where your ecommerce engine loops through each item in the cart and

// prints out _addItem for each

_gaq.push(['_addItem',

'1234',           // order ID - required

'DD44',           // SKU/code - required

'T-Shirt',        // product name

'Green Medium',   // category or variation

'11.99',          // unit price - required

'1'               // quantity - required

]);

Though there is the option to get really detailed here, we don’t have to tell Analytics everything about each item. The order ID, SKU or product code, price and quantity are enough for Analytics to track the individual products.

Here’s an example of a minimalist tracking code:

_gaq.push(['_addItem',

'1234',           // order ID - required

'DD44',           // SKU/code - required

'',        // product name

'',   // category or variation

'11.99',          // unit price - required

'1'               // quantity - required

]);

The last step is submitting the transaction to Analytics via the line of code below:

_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers

When we add all of these parts of the tracking code together, your receipt/invoice page should look something like the following:

<head>

<title>Receipt for your clothing purchase from Acme Clothing</title>

<script type="text/javascript">

var _gaq = _gaq || [];

_gaq.push(['_setAccount', 'UA-XXXXX-X']);

_gaq.push(['_trackPageview']);

_gaq.push(['_addTrans',

'1234',           // order ID - required

'',  // affiliation or store name

'27.98',          // total - required

'',           // tax

'',              // shipping

'',       // city

'',     // state or province

''             // country

]);

_gaq.push(['_addItem',

'1234',           // order ID - required

'DD12',           // SKU/code - required

'',        // product name

'',   // category or variation

'15.99',          // unit price - required

'1'               // quantity - required

]);

_gaq.push(['_addItem',

'1234',           // order ID - required

'DD44',           // SKU/code - required

'T-Shirt',        // product name

'Green Medium',   // category or variation

'11.99',          // unit price - required

'1'               // quantity - required

]);

_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers

(function() {

var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

})();

</script>

</head>

<body>

Thank you for your order.  You will receive an email containing all your order details.

</body>

</html>

How to I Assign Dollar Values to My Goals?

Let’s say you don’t have an online store but you do know that each newsletter signup earns you $50. You can assign dollar values to goals like this. When you are setting up your Analytics goals, just set the dollar amount as the goal value as shown in the screenshot below:

 

Entering any numerical value into this box will cause Analytics to allocate a dollar amount to that completed goal.

If you need help on how to setup goals, see this article from Google.

Well that’s all from me this week!

If you’ve got any more burning questions then let me know in the comments and I’ll get back to you with an answer!

 

E-Web Marketing
Follow us
E-Web Marketing

We’ve been in the digital marketing field for over 18 years and worked with hundreds of Australian (and international) businesses to grow their web presence. Specialising in SEO, search ads (PPC), social media, content marketing, email marketing and conversion rate optimisation.

Get your 100% free SEO Analysis

*required

100% Free. No obligation. Done by a human.