I have previously described my recommended minimal set-up of Google Analytics for any Ecommerce website. The minimal set-up was based on a Core level of output, the least you would need to perform critical analytics to identify issues and increase sales. There is also now a recorded workshop, going through the information needed in your Web Analytics tool, described from the point of view of the business owner.
In my original blog post, I used the current/older version of Google Analytics – Universal Analytics – as my example. The logic works with any Web Analytics tool, just with different tags/configuration. Given all the chatter about the new version of Google Analytics, it feels appropriate to provide an update with GA4 as the example.
The intended outcome is still the same, this set-up is the minimum required to:
- Create your Ecommerce funnel
- Create a basic Ecommerce Performance Diagnostic
- Create a Merchandise Report
- Identify pages uniquely on the website
- Evaluate performance by marketing campaign
GA4 Core Tracking for Ecommerce Websites
Page Naming Convention
This is still the starting point for any implementation with any tool. Annoyingly, GA4 doesn’t provide a good option for recording page names. Making one key change makes GA4 reports useful though and that solution should be used here. That is to override the Page Title field with a user friendly page name. You lose a dimension which is rarely if ever useful and replace with this critical piece of information. The screenshot below shows how this is done within GTM.
The page naming convention I provided in my previous post for an ecommerce website is the same for any tool. The one exception with GA4 is to not include the search term query parameter within the page name. GA4 will extract this directly from the Page URL, our page name variable.
Additional Page Information
I also recommend capturing the Page Type, the full Page URL and, if the website is in multiple languages, the Page Language. These parameters need to be captured with all GA4 tags:
- Page Type – record in the Content Grouping field
- Page URL – record in a parameter
- Page Language – record in a parameter
All Ecommerce Pages
As will be described later on, we need an GA4 event for each stage of the Ecommerce funnel. An event will be fired on certain stages (e.g. Add to Basket) while it is easy to configure a custom event for other stages. The exception is the Ecommerce Session stage which recognises that the visitor has a shopping intent based on viewing any shopping related page.
Due to GA4 configuration limitations, we can’t easily configure a custom event for this stage based on the Page Type or Page Names (regular expressions are not allowed). The easiest solution is to create logic within GTM to populate an additional parameter on all pages with “True” if that page is an Ecommerce pages (lookup tables based on the Page Type are one method).
The exact same information can be captured here as with Universal Analytics. The critical pieces of information for each transaction are as follows, with the transaction data needing to be within 5% of actual transaction data.
- Transaction ID
- Total amount paid (split by amount for shipping and amount for products)
- For each product purchased
- The product name (matching the granularity level shown on product pages)
- Quantity of the product purchased
- Price per item
- If multiple currencies are in use, recording the currency for this transaction
- Or recording all transactions in your central currency
As with Universal Analytics, use the recommended transaction code with other variables nice to have, not critical.
Product Page Views
The product name should be recorded in a parameter on view of a product details page. This product name must be identical to the product name recorded with transactions.
Add to Basket
A GA4 event needs to be triggered whenever a product is added to basket. This event should include two parameters (as critical):
- Product name – must be identical to the product name recorded with transactions and product page views
- Add location – if products can be added to basket outside of product detail pages
If the checkout process always commences by viewing a page with a Page Type of “checkout”, no more is required. If that is not the case, then an event needs to be fired for “commence checkout”.
Example scenarios include the visitor clicking out to a 3rd party payment process (e.g. PayPal) or if the login/registration page is not correctly labelled as a Checkout process page. The second case is of course not possible as this set-up of GA4 is done properly…
There are no critical parameters to include with this event, although it would be nice to know if commencing via the internal or 3rd party payment process.
There should be no difference in your GA campaign tracking between Universal Analytics and GA4. Note that a migration to GA4 is a good opportunity to review, audit and correct the logic & naming conventions that are in use.
GA4 Ecommerce Data Structure
As with Universal Analytics, I haven’t recommended implementing the recommended Ecommerce data structure. In my opinion, this is not within the Core level. Having said that, I do recommend using this code structure when recording transactions. If it is minimal extra work, I also recommend using the Ecommerce code structure to record product details when products are viewed and added to basket (in addition to the parameters described).
Capturing all possible Ecommerce interactions is a Silver or Gold level of web analytics tool set-up and so not covered in this blog post.
GA4 Configuration for Ecommerce Websites
This is where it all gets interesting.
In my opinion, the GA4 tagging and data capture is as good as it needs to be. It has a simple logic of events (hits) with additional information passed as parameters. There should not be much difference between the information captured with Universal Analytics and GA4, just using a different approach.
The situation is different for configuring GA4. It offers a range of advanced configuration options but it is also missing some of the basics, making it limited compared to Universal Analytics and any other decent Web Analytics tool.
Standard Configuration Actions
GA4 is still new, there may be some configuration actions I miss here.
- Ensure the time zone is defined correctly. This should reflect the country/time zone that the business operates in or, if a globally used website, the time zone of the head office.
- Enable all Enhanced Measurement options are enabled.
- Ensure the search term query parameter being used matches that of the website.
- Define your internal traffic IP addresses within More Tagging Settings.
- Depending on your fondness of the new Engaged Session definition, adjust the timing for that up from 10 seconds.
Linking to Other Google Tools
These are key examples of configuration changes that could (& even should) be taken but are not absolutly critical.
Most Ecommerce websites with GA4 will be using Google Ads and if sharing the information back & forth helps drive sales, then linking is the smart move. Similar with Google Signals for remarketing and ad personalisation purposes. With these two, you will need to ensure your privacy policies and cookie consent settings are updated and accurate.
Linking GA4 to Google BigQuery is the big selling point for GA4. But for it to add value, you need the resources to access data through Big Query. If that exists, then setting up this connection to access near raw data for free (?) makes sense. Not critical but definitely an action, if you have that resource.
Ecommerce Configuration Actions
Within Property Settings in Admin, you can select the currency you want to use for reporting purposes.
Clicking through in the Admin section on Data Streams => Web => More Tagging Settings => List unwanted Referrals, you can list any payment gateway domains or login domains that need to be excluded as referring domains.
Custom dimensions need to be defined for the parameters that were sent through. These are all Event scoped and are as follows:
- Page URL
- Page Language (if relevant)
- Ecommerce Page
- Product Details View: Product Name
- Add to Basket: Product Name
- Add to Basket: Location (if relevant)
As mentioned earlier, an event is required for each stage of the Ecommerce funnel. It already exists for Add to Basket and potentially Commence Checkout but Custom Events need to be created for the other stages. These would be based on the event parameter = page_view and the relevant page parameter.
Note these parameters will not appear in the dropdown but can still be entered manually.
- Ecommerce Session: ecommerce_page equals “true”
- View Product Page: content_group equals “product details”
- Commence Checkout: content_group equals “checkout”
- Place Order: content_group equals “confirmation page”
Each stage should then be marked as a conversion action. Reviewing GA4, I don’t see that this makes a difference in terms of reporting or analysis. It only makes it easier to find these actions when searching through a shorter Conversion list rather than the longer Events list.
Data needed for each report
The short answer to how the data required for each report should be accessed is to use BigQuery. That gives you access to the raw data and everything you need. Winning! As long you have the skill set and resources to use BigQuery daily, which of course every company does…
The more I dig into GA4 to provide the longer answer, the more detailed that answer becomes. So I am going to postpone that section to a future blog post.
Migration to GA4
To echo everyone speaking sensibly about GA4, do not migrate to the new version of Google Analytics just yet. It is sensible to set the tool up and start collecting data in parallel with Universal Analytics.
If you have GA4 in place already but want to check this set-up at least matches my recommendations, a checklist of my recommendations is available as an online audit document. I am happy to perform this light audit for your organisation, let me know if you would like to request this.
Please get in touch if that audit exposes gaps or if you want to have GA4 implemented alongside your current Google Analytics set-up. This is a great opportunity to get the data collection right for both Universal Analytics and GA4. Working with your developers, the missing tracking can be added, reports created and your team trained in their use.
Any feedback and suggestions on this recommended approach to the set-up of GA4 for Ecommerce websites is appreciated.