Google Analytics 4 and Hyvä

Google Analytics 4 and Hyvä

The Migration from Universal Analytics to Google Analytics 4

About the Author

Wouter Steenmeijer

Wouter Steenmeijer is the CFO of Elgentos, a top Dutch partner agency of Hyvä. He also happens to be a developer and as he in charge of setting business analytics tools to drive his company’s results, he delved into the Google Analytics topic for the interest of both Elgentos and their clients.


Google Analytics 4 is replacing Universal Analytics. On July 1, 2023 all standard Universal Analytics properties will stop processing data. This migration marks a paradigm shift in how data is collected, analyzed, and interpreted. It also brings about the need for organizations to adapt to the new system to gain maximum value from their digital analytics.

This article covers the migration from a Google point of view and from a technical point of view within the Magento/Hyvä scope.

Understanding the Shift

UA has been a go-to tool for businesses seeking insights about their online presence, allowing them to monitor website activity and user engagement effectively. However, GA4 represents a new era of analytics, developed around event-based tracking rather than session-based tracking. This allows for deeper, more nuanced insights into user behaviour and can empower businesses to optimize their online strategies more efficiently.

Moreover, Google Analytics 4 has been designed with the future in mind. It has been constructed with an emphasis on privacy and adaptability to a future where third-party cookies might not exist. Its machine learning capabilities also enhance predictive analytics, helping businesses understand and predict user behaviours to create more personalized and effective marketing strategies.

The Migration Process

Before starting the migration process, it's important to understand that GA4 is a completely different system, not just an upgrade of UA. As such, it's suggested to run UA and GA4 concurrently for a period to familiarize ourselves with the new system, compare data, and ensure no critical data is lost in the transition.

Here's a simple guide on how to migrate within the Google scope.

Step 1: Create a New GA4 Property: This can be done within your existing Google Analytics account. Click on ‘Admin,’ then ‘Create Property,’ and choose 'GA4' when asked for the property type.

Step 2: Setup Data Streams: Data streams are the new way GA4 collects data. Choose from ‘iOS app’, ‘Android app’, and ‘web’, and set up relevant streams. These will replace the tracking codes used in UA.

Step 3: Configure Events and Parameters: GA4 is heavily focused on events. As such, you’ll need to configure these to match your business's needs. This will involve some new concepts, such as 'event marking' and 'parameter reporting'.

Step 4: Set Up Conversions: In GA4, any event can be designated as a conversion. Navigate to 'All Events' under the 'Events' section and mark relevant events as conversions.

Step 5: Review and Adjust Your Reports: The reporting in GA4 is different from UA. You will find several new reports, as well as new ways to view and interpret data. Spend some time reviewing these and customizing where necessary.

Step 6: Implement Enhanced Measurement: This feature automatically tracks certain events without any additional tagging. It’s recommended to enable this to enrich your data collection.

Magento and Hyvä

Magento doesn't currently have built-in support for GA4. Therefore, it requires a slightly more technical setup compared to the previous UA integration. You can do this in 2 different ways, one, direct setup from GA4 in Magento, or set up a GTM container and pass data through Google Tag Manager to GA4. I would recommend this because when the data is in GTM you can always use it for other data collection services.

We always choose the latter approach. In this way, we have more control over code that is executed. By default, we use the Yireo Google TagManager extension v3. Note that the v2 version tree is not compatible with GA4. This extension provides a default set of events within the data layer. These events are compatible with GA4. The events that are configured in the extension are:

  • select_item
  • view_item
  • view_item_list
  • remove_from_cart
  • add_to_cart
  • view_cart
  • begin_checkout
  • purchase

Most important thing to note here is that these event names differ from the previous version of GA/GTM. So this is the task for the web developer to fix this. When migrating to GA4 it's also important to check the code for custom events that are fired. 

For the 2x version branch a Hyvä compatibility module was needed. For the 3x version branch the Hyvä compatibility module can be removed.


Transitioning from Universal Analytics to Google Analytics 4 is not a mere upgrade, but rather a strategic shift towards a more advanced and future-oriented analytics system. The migration process requires careful planning and implementation, but the advanced features and insights offered by GA4 make this transition well worth the effort.

GA4 and Hyvä, what are the options?

There is a wide array of available GA4 extensions for Hyvä. As mentioned before, Elgentos uses the Yireo GoogleTagManager extension by default, after making an analysis of the available options. They used Community input to gather feedback.

Today, you can choose from these options to install Google GA4 Tracking on your Hyvä store:

  • Magepal - Google Analytics 4 for Google Tag Manager
  • Yireo - Yireo_GoogleTagManager2
  • Weltpixel - Google Analytics 4 (GA4) With GTM Support for Magento 2
  • Mageplaza - Magento 2 Google Tag Manager Extension (GTM)
  • Anowave - Magento 2 Google Tag Manager Enhanced Ecommerce (UA/GA4) Tracking
  • Mirasvit - Magento 2 Google Tag Manager & Facebook Pixel
  • Amasty - Google Tag Manager for Magento 2
  • Magefan - Magento 2 Google Tag Manager & GA4
  • Magedelight - Magento 2 Google Analytics 4 (GA4)
  • Webcooking - Google Analytics 4 for Magento2
  • BSS Commerce - Magento 2 Google Analytics 4 (GA4)

See the full comparison in this Google Sheet: Available Magento2 Datalayer Tag Manager modules


Related Posts