Skip to main content
eCommerceMagentoTips

Google Analytics 4 – Implementation Guide

By 30 May 2023July 4th, 2023No Comments
Google Analytics 4 - Implementation Guide

Google Analytics 4 (GA4) is the latest version of Google Analytics. It offers a number of new features and improvements over the previous version, Universal Analytics (UA). If you’re not already using GA4, now is the time to start planning your migration.

The recommended “end game” configuration for GA4 consists of using Google Tag Manager (GTM) to implement both UA and GA4. This will allow you to collect data from both platforms and make it easier to migrate to GA4 in the future.

In this blog, we’ve outlined the recommended “end game” configuration for Google Analytics.

By following these recommendations, you can ensure that you’re collecting the most accurate data possible and that you’re ready for the future of Google Analytics.

Check out the contents of our Google Analytics 4 – Implementation Guide:

Pre-implementation checks

Review current UA implementation

UA tags may have been implemented in any of three ways:

  1. Direct implementation via analytics.js: This should already have been migrated to gtag or gtm. It is recommended to update to GTM.
  • Direct implementation via Global Site Tag: Businesses that have relied on web developers for tagging decisions are likely to have this implementation. While it’s possible to extend gtag support to GA4, it requires more effort than removing gtag and replacing it with GTM.

Using GTM is a recommended long-term solution as it supports tags from non-Google properties and is likely to become more important in the future ‘cookieless’ web.

  • Implementation via GTM: This is the preferred solution in almost all cases, especially for e-commerce websites, and is always our recommended approach for Adobe Commerce/Magento.

Review UA enhanced e-commerce implementation (e-commerce sites only)

For e-commerce sites using GA4, check if the following enhanced e-commerce events are being tracked: product impressions, product clicks, product detail views, product add to cart, product remove from cart, checkout steps, and purchases.

Audit events

Document the custom events currently collected in UA and determine which ones need to be migrated. Adapting to GA4’s measurement philosophy is easier when reducing dependency on legacy custom events.

Review current GA4 implementation

If GA4 has already been implemented, ensure that required events are being received. Check reports such as events, conversions, and e-commerce purchases to verify data consistency and tracking completeness.

In the case of e-commerce purchases, the table should be populated with the following columns: item name, item views, add-to-basket, e-commerce purchases, item purchase quantity, and product revenue.

Technical implementation

Google Tag Manager

If you have not already implemented Google Tag Manager, please do so.

  • In Adobe Commerce this is an out-of-the-box feature. Visit the Google API section on Adobe for more information
  • Magento Open Source will require a Google Tag Manager extension with an e-commerce-compliant dataLayer. There are many available options and the most suitable one for any given merchant will depend on a number of factors. We recommend discussing the options with your web developers.

To ensure that all necessary events are sent to GA4, follow these steps:

  1. Create a GA4 property in your Google Analytics account.
  2. Make a note of the measurement ID.
  3. In GTM, create a GA4 configuration tag using the measurement ID and an ‘all pages’ trigger.
  4. Optional: For e-commerce websites with a UA-enhanced e-commerce implementation and a standard EE dataLayer, consider importing the EEC dataLayer Builder for GA4 template from the GTM template gallery. This template helps create custom variables for configuring triggers and event tags for GA4. Note: This step is currently essential when using the Adobe Commerce GTM implementation.
  5. Use standard GA4 variables, triggers, and the ‘Google Analytics: GA4 Event’ tag to create the events identified in the event mapping section. Most migrations can be done in GTM without much assistance from web developers. If additional event or dataLayer pushes are needed, refer to the developer links provided.
  6. Publish the container and allow up to 30 minutes for the real-time report in GA4 to start collecting data.

GA4 property configuration

Once the technical implementation is complete, the next step is to configure your GA4 property. Select the gear option and follow these steps:

  1. Property settings: Verify that the time zone and currency are correctly set.
  2. Property access management: Limit access to the property, avoid shared logins, and control admin access.
  3. Data streams: Confirm that your web data stream is receiving traffic. Enable ‘enhanced measurement’ and configure any necessary enhanced measurement events. Add the search query parameter used on your site for site search. Configure other tagging settings as needed.
  4. Configure your domains: If using cross-domain tracking, add all domains where your tracking script is deployed.
  5. Define internal traffic: Exclude internal, agency, or monitoring tool IP addresses to prevent them from being tracked.
  6. List unwanted referrals: Include third-party payment processors or domains that may interrupt sessions. Avoid including your own internal domains.
  7. Adjust session timeout: Ensure the session timeout is set to 30 minutes and the engaged session timer is set to 10 seconds.
  8. Data collection: Verify that Google signals is enabled and confirm user data collection acknowledgement.
  9. Data retention: Set the event data retention to 14 months.
  10. Data filters: Activate the internal traffic rule if it was added in the web stream details.
  11. Reporting identity: Set the default reporting identity to ‘by user ID and device.’
  12. Attribution settings: The recommended attribution settings should be left as-is in most cases but be aware that the full functionality of the attribution model may take 90 days to be operational.
  13. Product links: Create appropriate links for Google Ads, Search Console, and Merchant Center.
  14. Enable Search Console reports: access reports > library and enable Search Console collection.

Note: Refer to Google’s documentation for more information on unwanted referrals and additional details.

Reporting interface configuration

In the configuration section, define events that should be considered conversions. E-commerce purchase events are automatically marked as conversions, but you can mark any on-site event as a conversion based on your business requirements (e.g., account sign-up).

Before flagging any non-purchase event as a conversion ensure you discuss it with your PPC team as unexpected conversions can impact bid strategies.

Ready to optimise your Google Analytics configuration?

Don’t settle for outdated analytics setups that hinder your progress. Our blog post has provided you with the recommended configuration for GA4 prior to the UA sunset, giving you the tools to collect accurate data and prepare for the future.

GA4 is far more customisable than UA and allows far greater insight into your marketing performance, but it should not be considered a “like for like” upgrade.

By following this guide you’ll have a good basic e-commerce implementation but that is just the beginning. GA4 opens the door to attribution modelling, cross-device tracking, user acquisition optimisation, user properties and bespoke audiences, segment overlaps, custom funnels, and a whole host of additional exciting new features.

Take action today and optimise your website’s analytics configuration to make informed decisions and stay ahead of the curve. Contact us to find out more.

Additional resources

Technical Implementation Guide GTAG/GTM

Dimensions Reference

Default Channel Grouping Rules

Google’s Migration Guide UA->GA4

Close Menu
Portanor House
Manor Court, Manor Royal
Crawley
RH10 9PY

T: +44 (0)330 056 4072
E: [email protected]