The Google Analytics e-commerce reports contain two specific reports that I believe are critical to understanding the behavior of site visitors: Days to Purchase and Visits to Purchase. These reports are the only way to measure the online sales cycle using Google Analytics.
But, as their names imply, these reports are focused on commerce. But not all websites are commerce based. What if we have a lead gen website? We want to measure how long it takes to get a lead, not make a purchase.
Herein lies the problem: there is no “time to conversion” or “visits to conversion” report in Google Analytics.
To get around this little issue EVERYONE should use GA e-commerce tracking to measure conversions, regardless of site purpose.
The Reports
Before I talk about how to set up e-commerce tracking for a non-commerce site let’s discuss the Visits to Purchase and Time to Purchase reports and how they can be used. Remember, in this application of e-commerce tracking “purchases” are really just conversions.
Here’s the first report we want to use, the Visits to Purchase report.
The Visits to Purchase report shows how many visits a visitor generated before they converted. The chart above shows that most visitors convert on the first visit. This is good. It means that visitors come to the site, find what they need and convert. This can also be very bad, it means that we have one chance to get someone to convert. If they do not convert on the first visit then we may not get another chance.
Let’s pair this data with the Time to Purchase report to better understand how much time passes between a visitor’s initial visit and their “conversion” visit.
The data indicates that everyone converts on Day 0, or the current day. This makes sense since most everyone converts on their first visit.
But what if most conversion occurred on the second visit? If conversions happen on the second visit, but still on Day 0, it means that visitors are probably doing some research prior to conversion and are checking another site on the same day before returning to our site to convert.
Knowing how many visits to a site it takes to convert a visitor is very actionable. What if the data indicates that visitors convert after the third visit? This means that we need to get a visitor back the site a third time to have any chance for a conversion. We may change our keyword bidding strategy to target visitors that are further along in the conversion cycle or we might try to collect an email address to send them additional information via email.
The key concept is that this data explains how many times we need to get the visitor to return to the site in order to generate a conversion.
If we do not using the e-commerce code to track “conversions” then we do not have access to this information.
One More Reason to use E-Commerce
There is one other reason why I like to use e-commerce tracking to track conversions. Google Analytics will only track one conversion per visit. If a visitor converts multiple time at the same goal Google Analytics will only count one conversion.
However, GA will track multiple purchases per visit. Is this a big deal? Not really. But if you want to make the data as accurate as possible, and have a goal that can be achieved multiple times per visit, then try using a transaction to track it.
Plus, using e-commerce to track conversions adds an extra “goal” to each profile, bringing the total to 5. Woo hoo!
Installation & Setup
There are three basic steps necessary to use the e-commerce tracking code on a non e-commerce site. While the steps are similar to those described in my previous post on installation there is one big difference. Let’s walk through each step.
Step 1: Activate the Reports
The first step in setting up GA e-commerce tracking is enabling the e-commerce reports. Log into GA and edit the profile settings. Specify that your site is an e-commerce site. This enables the e-commerce reports.
Remember, the e-commerce reports is a profile setting that is “off” by default. You’ll need to activate the reports for each new profile you create.
Step 2: Tag your Receipt Page
I know this seems like a silly step, but make sure you add the GA tracking code you your receipt page. You must have the standard GA tracking code on your receipt page in order to track purchases.
Step 3: Install the Code
This is where the installation differs from the standard installation. To measure purchases with Google Analytics you need to add the following code to your thank you page. The code does not need to be modified in any way.
You'll notice that I added the e-commerce code to the regular GA page tag, but you can add it anywhere on the page. I just like keeping things together, it seems more organized to me.
You'll also notice there is a lot of missing information in the above code. I've added the bare minimum for the tracking to still work. Don't worry about the missing data, GA will still track a transaction, i.e. a conversion, and we will be able to use the Visits to Purchase and Time to Purchase reports.
That's it. Once the code has been added you'll start to see some data in your Visits to Purchase and Days to Purchase reports.
Got an interesting story to share about your e-commerce implementation? I would love to hear about it below in a comment.
Remember, this is part 3 in a multi-part series on e-commerce tracking. You may be interested in parts 1, 2 and 4:
Google Analytics E-Commerce Tracking Pt. 1: How It Works
Google Analytics E-Commerce Tracking Pt. 2: Installation & Setup
Google Analytics E-Commerce Tracking Pt. 4: Tracking Lead Gen Forms
This is a good idea — one that I’ve been considering for awhile, but haven’t tried yet.
A couple of thoughts…
Why not assign dollar values your ecomm goal by giving the “transaction” a fixed dollar amount?
And how about using different “product” names for different goals? That would bypass GA’s 4-goal limit.
Dave Lenef
PrairieWeb Internet Marketing
http://www.pwim.com
Hi David,
Great idea re: the use of transaction value and products. In fact, that’s what I will cover in the 4th and final part of this series.
Thanks for the comment,
Justin
Hi Justin,
Thanks for writing this, I’ve been using GA E-Commerce for a while now. One issue I’ve been having is being able to track transactions to the actual product sold – linking it to the AdWords campaign. You don’t cover the product data portion of the E-Commerce section too much in this post – any insight on this?
Product performance >> Product Overview is where I’m really wanting to get more info on. When I click on a product from there and then Segment it by Campaign – the data is bogus / inflated.
Are you experiencing this? Any ideas there, could it be a tracking code implementation issue? Do your numbers look right when you segment by campaign? Maybe it’s a bug in GA e-commerce tracking too…
Thanks in advance for any ideas!
Jonathan,
I know what you’re talking about. Segmenting report data isn’t true segmentation, it’s just changing the view of the data. What I ususally do is create an AdWords profile with a filter that attaches the keyword to the product name. That way I can see exactly what keywords are driving specific product sales.
Maybe I’ll write up a quick post about the above settings. It’s a handy profile to have…
Thanks for the comment.
Justin
Hey Justin,
Great series! I’m always finding incredibly useful posts here, and this one is rad. I’m looking forward to trying this out with some of our lead gen. clients. Again, thanks.
Thanks Josh! If you have any questions or other feedback please let me know.
Justin
Hi Justin…
So glad to see you’re back!
:)
Wanted to clear out 2 things…
1. What is the meaning of this Js?
“pageTracker._setLocalRemoteServerMode();”
2. Why there is a need to create a fake ID order? and what are these actually mean?
var timeObj = new Date;
var unixTimeMs = timeObj.getTime();
var unixTime = parseInt(unixTimeMs / 1000);
var orderID = pageTracker._visitCode() + ‘-‘ + unixTime;
Thank you so much for these great posts…
Hi Amit,
It’s good to be back and interacting with you guys! To answer your questions:
1. This line of code tells GA to send the data to your local server in addition to the Google servers. I usually have GS send data to my server in case I ever want to use Urchin to process it.
2. You don’t need to create a unique order ID, but I wanted to start rolling out some code that will appear in part 4.
Thanks for reading and thanks for the comment.
Justin
Justin,
Glad to have you back! Great, informative post! I am using GA in combination with Google Checkout. However, I do not have a shopping cart, just a few buy-it-now buttons. Therefore, I don’t have access to a “receipt page”. I followed instructions on this Google Help page (http://code.google.com/apis/checkout/developer/checkout_analytics_integration.html) but for some reason it does not track every single transaction, there are some that are left out. Any ideas why?
hi, Justin, great to see you back!
Here’s a question: If I buy on day 1, day 2 AND day 3, do I show up 3 times? My hunch is ‘yes’.
It would be great to be able to choose whether to show repeat purchases or not.
daniel
Hi Rob,
We’ve helped a lot of clients with the integration of Google Checkout and Google Analytics and we’ve always seen GA track about 95% of checkout orders. If you’re missing 1 or 2 out of 100 then I wouldn’t worry about it. But if you’re not getting about 95% accuracy then you should double check that you’ve followed the steps exactly.
Sorry I don’t have an exact answer, but it should work for you. I think we’ve seen every GA/Checkout integration possible, and almost all of them end up working.
Justin
Daniel,
Yes, you are correct. If a visitor makes a purchase on day 1, day 2 and day 3 you will see 3 transactions in Google Analytics.
If you’re interested in tracking repeat purchases you could use GA’s custom segmentation feature. In fact, I have a blog post queued up about the exact topic. Look for it next week.
Thanks for reading,
Justin
Justin,
Thanks for the response, I’m anxious to get something going that helps me get product detail reports that show correct revenue generated segmentation data.
Why doesn’t GA do this correctly? So you’re saying it’s not a tracking code implementation problem? Wish I could show you screen shots of what I’m experiencing.
Thanks for continuing the dialog, this blog is so valuable with that interaction!
Jonathan
Hi Jonathan,
It’s tough to say what the exact problem is without seeing it, but it usually isn’t the e-commerce code. The code usually works or it doesn’t/ So, if you are getting data then there is probably some other issue or, as I mentioned, segmenting the data in GA can sometimes lead to strange results.
Justin
Hi (again) Justin
When you are using this method, would you also track “traditional” goals, or would you just stick to one version to avoid confusion for the client even if me misses some data?
As you write:
This means that we can have different numbers using goals and e-commerce for the same “transaction”.
Also, if we look ahead, when events are released, they can’t be tracked as “traditional” goals (correct med if I’m wrong) since they aren’t pageviews. But, events can be tracked as e-commerce. This can also make a difference between the numbers in goals and e-commerce.
How do/would you handle this?
Hi Eivind,
Great comment. In reality, it’s up to all of us, as analysts, to explain the data that we work with. If you’re using e-commerce to track something that would normally be a “goal”, then it’s important to explain to users/stakeholders, what the data means.
If you do get into a situation, where you have a difference in the number of transactions and goals, due to the setup, then it would be a good idea to explain how your implementation is leveraging GA as a framework to generate useful data.
Another good idea is to configure any “advanced” tracking, like using e-commerce for goals, in a separate profile, to avoid confusing users.
Regarding event tracking, it’s not really meant for e-commerce. While it can be used to track e-commerce (and just about anything else), it’s best to use e-commerce tracking for e-commerce.
Thanks again for the great comment.
Justin
Thanks for your answer Justin.
To elaborate a little bit about why I mentioned e-commerce tracking in the same sentence as event tracking.
In his latest book, Brian Clifton discusses why you should/could use e-commerce tracking on a non-commerce site. One of the examples he gives is about tracking e-mail clicks as e-commerce. He track the clicks as virtual page views.
I track different things as virtual page views, which isn’t really page views (ex. clicks on outgoing links). The problem are that bounce rate and page views gets skewed, and you have to add extra filters and profiles to deal with it.
So to be specific. I’m not sure if I think it’s “correct” to track e-mail clicks as virtual page views. I think it’s better to track this as an event, even if this probably isn’t “correct” either.
Eivind,
Thanks for for the clarification. I agree that one needs to be cautious when creating lots of virtual pageviews. As you point out, many metrics can become skewed when you start adding trackPageview() to things that are not necessarily a pageview.
I think the fundamental thing to understand is how GA data is effected when virtual pageviews, e-commerce or event tracking is used.
Thanks for adding to the discussion, I think you bring up some excellent points.
Justin
Sorry if this is a repeat post. I thought I posted it before, but I can’t find it.
In one of your comments, you said:
“What I ususally do is create an AdWords profile with a filter that attaches the keyword to the product name. That way I can see exactly what keywords are driving specific product sales.
Maybe I’ll write up a quick post about the above settings.”
I would be very interested in this information, as we have microsites that promote specific products, and we want to tie sales of those specific products to visits to the microsite. The standard reports showing overall purchases by visitors to the microsites don’t tell us enough about the success of these microsites, particularly since most of our customers came to the site to purchase other products.
Thanks for your help!
Dan
Dan,
Thanks for the reminder, I’ll try to get something out soon.
Justin
Hi Justin,
Thanks for the great post!
I have no doubts that Google offers a great Free Analytics tool.
Before buying into those expensive tool, one should ideally give Google Analytics a try.
At the same time, one tricky thing if you don’t use Google Analytics is that you don’t know the referring URLs of conversions with Google Content using third party tracking. Many times Google will redirect traffic from Google Content network (Adsense) through its server so those URLs will appear as Googlesyndication on third party tracking (HBX for example).
However, as i mentioned before on my blog, i still advise not to use Google Analytics on mass scale.
The reason is because Google ultimately is a Media Owner and advertisers are buyers.
Google (just like any other Media Owner) faces the problem of deciding how much to charge for a single click it delivers to maximize the profit and at the same time make advertisers happy.
Well if only Google knows how much advertisers in each vertical, in each country, region make out of every single dollar they spend online. In other words, if only Google knows exactly what advertisers Return on Ad Spend is.
With Google Analytics, Google potentially (if it hasn’t done so) can know exactly how much advertisers are willing to pay.
Further more, Google is a PUBLICLY traded Company.
Just my 2 cent,
Chandler
Hi Chandler,
Thanks for sharing your thoughts. However, I disagree regarding Google’s use of data to potentially manipulate the advertising pricing that runs through their system. The downside of such activity is far greater than the upside.
I do agree that Google should provide more transparency into the traffic coming from AdSense. It would be so much better to see the actual site where the visitor clicked rather than ‘(content network)’ in the reports. Hopefully, in the near future, Google releases some AdSense specific reporting that provides more insight into AdSense.
Thanks for sharing your thoughts, I appreciate it.
Justin
Hi Justin,
I am trying to set up ecommerce tracking for the charity where I work.
We are using WorldPay. This is a link to a custom installation I made for taking single gift donations.
http://www.careinternational.org.uk/lote/index-cld-main.htm
Where you say on part 2 of this post “you must create server side code that outputs the transaction data in the format above”…
…how would I go about creating that code?
And, is this the correct way in which I should apply it to my thank you page – I am calling the value of the field so if the donation amount field is named: :
Then I am trying to ‘catch’ this in my thank you page like this:
pageTracker._addItem(
“”, // Order ID
“”, // SKU
“”, // Product Name
“”, // Category
“”, // Price
“”, // Quantity
);
Please can you give me any quick tips or pointers as I am finding nothing after extensive searching?
Thanks so much,
James Elliot on behalf of CARE International.
Hi James,
If you’re using a third party provider, and it sounds like you are, then you need to contact the provider and request that they add the server level code. My gut tells me that if they do not have a GA module then it may not be possible to track the transactions. But check with them just to be sure.
Justin
Thank you so much! I’ve been looking for this for so long. By the way, any luck passing SKUs or product categories? I can’t seem to get them to show up in reports. Thanks.
hey, I realize this might be a stupid question but I’ll ask it anyways. After you install the google script, google analytics will only track visits from the time you installed the script, right? (so I can’t track what happened say a week ago before I installed the script…)
Hi Kevin,
Correct. Google Analytics will only track track data from the date of installation forward.
Thanks for the question,
Justin
You are awesome!!! I’ve been trying for 3 days to get some code that will pass back one parameter to Analytics, and this is the first thing that worked. Thank you, thank you, for sharing your work!!!
Just I think my codes are not working on the comment but I think you know which parts are different form the usual.
can anybody tell me how much it takes to show the data after installing the ecommerce code to my website pls …soon….
SAntosh,
You should see the ecommerce data soon, within 24 hours. Google Analytics processes your ecommerce data at the same time that it processes your clickstream data. If you’re not seeing data then there may be an issue with your implementation.
Thanks for the question,
Justin
On the above code, is it missing a at the end? Just want to make sure.
Will try that one more time is it missing the closing of the script tag?
?
Hey Brad,
Yes, the code was missing the closing tag. Thanks for pointing that out!
Best,
Justin
This is awesome, I have read all parts of this topic. Thank you very much for sharing these great information. I like Dave’s comment on how to bypass GA’s 4 goals limit
Li Ma from Chicago
Great blog post (even if it was from a few years ago). Just wondering whether you have the code which is outlined on this page converted for use with the async java tracking method?
Andrew, thanks! I have not updated the post to work with the new Async tracking code. You might want to check this article on the Google Code site.
Thanks Justin for the post. I’m doing som research on this, that is how to use Google Analytics for ecommerce websites in the most effective way. :)
I think the most difficult thing, for me is to track goals, with URL that needs regular expressions experience. Do you have any post on Goal tracking? :)