Many people have trouble setting up E-Commerce Tracking within Google Analytics. In this post, I will run through what E-Commerce tracking is, with a step by step guide on how to integrate it with your Google Analytics, in order to get an accurate gauge of how much money your website is directly producing.
What is E-Commerce Tracking?
If your business is selling products online, reporting product purchases and purchase value are essential to understanding, benchmarking and measuring performance. Your website can understand the success of your marketing efforts by linking them with the number of purchases, subsequently tracking the return on investment (ROI).
If you can analyse your user behaviour and your marketing performance, you will be able to optimise the user experience and ultimately increase business revenue.
Setting up E-Commerce Tracking
- Within your Analytics account, select Admin, and choose the view you want to use to measure transactions.
- Under the ‘View Column’ column, select E-Commerce Settings.
- Click the Enable E-Commerce toggle ON.
- Click Next step.
- Click Submit.
- Add Conversion code onto the conversion complete page.
Additional code to go into the ‘Thank You’ Page
For many platforms, you will also need to add additional code to the Transaction completion page, in order for Google Analytics to pick up the required information from the page.
The sample code is displayed below, although the parts in red will need to be changed to dynamic code, which will depend on the structure and setup of your website:
‘transactionId’: ‘98765‘, // Transaction ID – this is normally generated by your system.
‘transactionAffiliation’: ‘Sugarbush Mt.‘, // Affiliation or store name
‘transactionTotal’: ‘89.00‘, // Grand Total
‘transactionTax’: ‘5.99‘ , // Tax.
‘transactionShipping’:’0′, // Shipping cost
‘sku’: ‘LTAFD‘, // SKU/code.
‘name’: ‘One Day Adult Lift Ticket‘, // Product name.
‘category’: ‘Lift Tickets‘, // Category or variation.
‘price’: ‘89.00‘, // Unit price.
The above code needs to be placed just above the closing body tag for best results.
Common Issues with E-Commerce Tracking
If you have already set up E-Commerce Tracking and have concerns that it is not picking up all of the data required, you should check the following common errors:
- Is the E-Commerce tracking code firing multiple times? It’s not uncommon for the user to refresh the confirmation page or to save it as a bookmark after they have made a transaction. This can present a challenge as the same transaction data is being sent to Google Analytics every time the confirmation page is loaded, meaning that duplicate results may appear in the reports. A way to resolve this is to set a flag once the E-Commerce tracking has been sent. A ‘flag’ typically involves adding code to incorporate an extra column to mark a user as ‘tracked’ in the e-commerce transaction history database (more info here). Once the flag has been set, if the same confirmation page is hit again, if that user info comes up as ‘tracked’ in the database the E-Commerce tracking isn’t fired and instead it’s just recorded as a page view.
- Google Analytics code in the wrong place on the page According to Google Analytics, its script should be placed after the opening <body> tag. Many things can go wrong with the script, depending on its location. One of the worst cases would occur when a user leaves a page before the code can fire, preventing tracking. The other end of this spectrum is that you could be sending the tracking code before the e-commerce data has loaded onto the page, causing the e-commerce data to be blank or report an error.
If you have any questions about E-Commerce Tracking or Google Analytics in general, please drop me a line at Ash@searchscientist.co.uk or give us a call at 02890683790.