• 1. About this Book
  • 2. 10 Reasons why Ecommerce Businesses Need to Have Google Analytics Set Up Correctly
  • 3. Quick Overview of Your Google Analytics Admin - Before You Set Up Your Ecommerce
  • 4. Setting Up Your “All Web Site Data” View in Google Analytics
  • 5. What the Heck are Parameters... And What do I do with the "Exclude Query Parameters" Field in Google Analytics?
  • 6. Adding Filtered Google Analytics Views Gives You Access to Better Marketing Data
  • 7. Setting up an “Include My Domain” Filter in Google Analytics
  • 8. Using Google Analytics Filters to Rid Yourself of Rage-Inducing Referral Spam
  • 9. Formulating Your IP Address Filter in Google Analytics
  • 10. Ensuring that Your Google Analytics Data is Accurate by Applying Lowercase Filters
  • 11. How to Remove Slashes From The End of your URLs in Google Analytics
  • 12. Fixing the Problem of Parameters in your Ecommerce URLS in Google Analytics
  • 13. Acquiring Your Ecommerce Store’s Unique Parameter List for Google Analytics
  • 14. How to Turn your Ecommerce Parameters into Custom Dimensions in Google Analytics
  • 15. Using your Parameter Custom Dimensions to Discover Ecommerce Opportunities
  • 16. Key Google Analytics Settings You Might Have Overlooked for your Ecommerce Configuration
  • 17. What are the Google Analytics Ecommerce Settings For and How are They Set Up?
  • 18. How to Turn on Ecommerce Tracking in Google Analytics
  • 19. Google Analytics Enhanced Ecommerce on popular Ecommerce Platforms
  • 20. Manually Adding Google Analytics Standard Ecommerce Transaction Tracking Code
  • 21. Manually Adding Google Analytics Enhanced Ecommerce Transaction Tracking Code
  • 22. Implementing Enhanced Ecommerce Features to Collect Game Changing Data For Your Ecommerce Store
  • 23. How Do You Use the Ecommerce Reports Built into Google Analytics?
  • 24. What is the Google Analytics Ecommerce Overview Report and What Should You Use It For?
  • 25. What is the Shopping Behavior Report and What Should You Use It For?
  • 26. The Importance of the Checkout Behavior Report in Google Analytics
  • 27. What is the Product Performance Report Used for in Google Analytics?
  • 28. This post has been deleted
  • 29. How can you see Individual Ecommerce Transactions in Google Analytics?
  • 30. What is the Time to Purchase Report in Google Analytics Used For?
  • 31. Deep-dive your Product Sales with the Google Analytics Product List Report
  • 32. Setting Ecommerce Goals in Google Analytics and Why This is So Important
  • 33. Adding Your Ecommerce Goals to Google Analytics
  • 34. Using Google Analytics Goals to Boost Your Ecommerce Conversion Rate
  • 35. Using the Model Comparison Tool in Google Analytics
  • 36. Segmenting Users - A Powerful Tool for Providing Data Insights
  • 37. Building Segments Using the Shopping Behavior Report
  • 38. How to Use the Segment Builder in Google Analytics
  • 39. How to Build Specific Criteria using Google Analytics' Segment Builder
  • 40. Google Analytics Segment Examples to Enhance Your Ecommerce Sales
  • 41. How to use Segmentation Analysis to Identify Opportunities and Increase Conversion
  • 42. Making the Most of the Demographics of Users When Looking at Ecommerce Data
  • 43. Google Analytics Segmentation Example - Transacted vs Did Not Transact
  • 44. Taking your Segmentation Analysis Further
  • 45. Bonus: Six Reasons Why Your Ecommerce Store Needs Google Tag Manager
  • Petra's Google Ads Agency

    Navigate The Blog

    Archives By Category
    Archives By Date

    Connect With Petra

    Learn From Petra

    Google Analytics Ecommerce Implementation

    Implementing Enhanced Ecommerce Features to Collect Game Changing Data For Your Ecommerce Store

    Product and transaction data is an important aspect of all the Google Analytics Ecommerce reports. Being able to use all the reports at your disposal is really valuable, but to do that you need to get the right data into Google Analytics. This is the trickiest part of using Google Analytics for Ecommerce, because it can be really hard to collect all that data programmatically.

    Fortunately, it’s very likely that you are using an eCommerce platform that has Google Analytics Ecommerce tracking built in (or you have access to a plugin that works with that platform). If so, you can skip over this post.

    This article will go into how to add your Enhanced Ecommerce tracking code manually, which is not the preferred option, but sometimes has to be done that way. It is a bit time consuming and fiddly to get right so always try to go with the easy option of a plugin or built-in tracking wherever possible. If you’re not a developer, don’t try to do this yourself.

    Adding product and transaction data manually requires you to have a website developer who will write the code in the native language of your eCommerce platform. This is most likely to be PHP, but it may be different depending on the underlying platform.

    To implement Google Analytics Enhanced Ecommerce, first you need to generate Javascript code containing the product and action details, formatted according to the Google Analytics Enhanced Ecommerce framework. The Javascript is written in a JSON format, which is populated with all the fields that are going to be sent through to Google Analytics. In the case of event-based tracking, the Javascript is then activated when the user does something specific in their web browser, such as click on a product. Otherwise, it triggers upon loading the page.

    Important Note: While this book is about Google Analytics and doesn’t cover Google Tag Manager, I would recommend using Google Tag Manager for the Google Analytics tracking code, rather than adding Google Analytics tracking code in-line on your website. However, even using Google Tag Manager you may not be able to gain access to product or transaction data from the client browser and so you may still need to write some server-side code to push these values to the page. This article goes into writing the Enhanced Ecommerce in-line, without the use of Google Tag Manager.

    Enhanced Ecommerce ends up adding quite a lot of additional code to your website because anything that you want to be tracked needs to be pre-written in Javascript upon loading the page, even if the visitor doesn’t perform the specified action.

    All of the code, including the functions that are triggered from clicks and other interactions, should be in the <head> block of the website. This is to help ensure that it loads quickly.

    The eCommerce tracking code also needs to be implemented so that when a visitor views a page, all of the relevant pageview eCommerce actions are sent off at once (as many of these can be stacked as you need).

    Actions that are related to clicking or scrolling need to be sent to Google Analytics only when the relevant action occurs. To do this manually, without Google Tag Manager, you would use Javascript “onClick” events or a scroll listener. (Please just use Google Tag Manager)

    Finally, you should set the currency in your analytics tracking code, especially when you are transacting or issuing a refund. If the currency is a different currency from the one in your Google Analytics view then it will be converted by Google Analytics to the currency in the view so hopefully you’ve already set your views up correctly. We covered setting up your views in an earlier article.

    It should be noted that this may complicate your data if you send transactions and refunds through Google Analytics in different currencies. If you have the same website on different top-level domains, you may need to have it set up so that each one has a different currency set in both the website tracking code and the Google Analytics view.

    With Enhanced Ecommerce tracking you can implement as much or as little tracking as you want, as long as you include the mandatory data. So depending on how your configuration is implemented, you might find there are gaps in your data (shown in your reports as 0 or (not set)) because some fields are not being captured.

    OK, now we’re done with all the theory so lets get onto the different types of data that are available, so that you can implement it.

    There many different data types available through this Google Analytics Enhanced Ecommerce, and these include the following.

    Product Impressions

    A product impression can be triggered when a visitor to your website sees a product listed on your website as part of a list of products (even if it is the only product listed). It is used by Product List reports and dimensions in Google Analytics. You can see an examples of the allowable options in the image below:

    Google Analytics. Retrieved from https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

    Product Data

    Product data can be added to any action that is carried out with regard to a particular product. You have seen this data already in the example of a transaction. It is used by almost every eCommerce report and dimension in Google Analytics – essentially, anything that refers to a product. You can see an example of this in the image below:

    Google Analytics. Retrieved from https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

    Promotion Data

    This refers to a particular promotion that someone may see on a website; for example, a specific banner advertisement. This is similar to product impressions, but applies to an internal promotion instead. Promotion Data does not include any products. It is used in the Ecommerce Overview report and the Marketing Internal Promotion report. You can see an example of this below:

    Google Analytics. Retrieved from https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

    Action Data

    This is used whenever it is necessary to track an action that a visitor has performed. In order for the action to be identified, an action identifier should be used. Action identifiers are shown in the next table. You have seen an example of an action already in the example of a transaction. Action data is used to populate all of the eCommerce reports included in Google Analytics. In particular, the Product Detail View, Add to Cart, Checkout and Purchase actions are used repeatedly throughout the eCommerce reports, and should be implemented in all eCommerce configurations..

    Google Analytics. Retrieved from https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

    Product and Promotion Actions

    These specific action types enable Google Analytics to correctly identify an action, in order to then add the data to the appropriate Ecommerce Analytics report.

    Google Analytics. Retrieved from https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce

    You will now have discovered that there are a wealth of eCommerce tracking options included in Google Analytics Enhanced Ecommerce, and I hope this article has been helpful in outlining these. The options can be a little overwhelming however, so if you are feeling uncertain of what to implement, please reach out for customised advice.

    Want to get 8-10X ROAS from Google Ads?