Do you sell products online? Do you know how much product was sold to a customer that found your website from a Search Engine? A banner ad? Social Media?
If you answered “no” to any of these questions then you need to set up Google Analytics ecommerce tracking right now. With a correctly set up ecommerce tracking script you can obtain a very detailed overview of your revenue and how customers found your website when purchasing products.
These insights allow you to make decisions on where you budget your time and money finding more customers from these sources. There are two parts to correctly implementing ecommerce tracking.
Google Analytics Tracking Script
The first step is to make sure that you have Google Analytics tracking installed on every page of your website. You can get the code from the Admin section of your Google Analytics account under the Tracking Info tab. Your code should look something like this:
If your shopping cart is on a subdomain then you must make sure the setting “Subdomains of [your-domain]” set to On. It adds the line:
_gaq.push(['_setDomainName', 'your-domain.com']);
This is critical to tracking visitors across subdomains, if you have your shopping cart on something like order.your-domain.com then this line is required. Otherwise you don’t need it but I like to add it anyway, who knows if you’re going to have a subdomain in the future. This will save you the trouble of going back and updating it later.
If you do not including that line and your shopping cart is on a subdomain then every referring source will say it came from your-domain.com because Google Analytics does not know that the two domains are related without that line.
The script can be placed before the closing head tag of your website.
Google Analytics Ecommerce Tracking Script
Next up is adding the conversion code to what I’ll refer to as your “confirmation” page. The “confirmation” page is the page on your site that you send customers to AFTER a payment has been processed and completed successfully.
Each website will have this set up a little differently depending on your business but Google has an excellent guide to adding the conversion script that can be found here.
Once this is set up you will need to wait a few hours for sales to start processing through Google Analytics. You can view all the data that Google Analytics allows under the Conversions section in the Ecommerce link. From here you can see every source that sends you sales and how well you are converting them. Imagine that you have a banner ad on a popular website that you’re spending $5,000 per month on and have noticed an increase in sales but you weren’t able confirm where they were coming from. With Ecommerce tracking you can see exactly how many sales came from that banner ad and determine if you’re making ROI on these banners.
One important note on Source tracking: Google tracks sales by a “last source” attribution. This means that Google attributes a conversion to the last method in which a user found your website. For example, if a customer saw a banner ad on a website and clicked that to get you your site, decided they weren’t ready to purchase yet and left. Then three days later they decided they were ready to purchase and Google’d your websites named and clicked a listing to your website and purchased a product, Google will show “Organic Search” as the conversion source. This is important to keep in mind because while it’s great that you scored a sale from Organic Search, it would be more important to know that the banner ultimately led to the conversion.
To learn more about attribution modeling view Google’s Support Post on the subject.
Have any questions on best implementation strategies? Leave a comment below!