Google Universal Analytics will be going away in July 2023 to be replaced with Google Analytics 4.

On July 1, 2023, standard Universal Analytics properties will stop processing new hits. If you still rely on Universal Analytics, we recommend that you prepare to use Google Analytics 4 going forward.

What is the best way to migrate from Google Universal Analytics to GA4 in older Magento 2.4 versions whilst still retaining all the eCommerce analysis provided by the current Universal Analytics module?

I am not interested in links to commercial modules.

3 Answers 3


You can setup the Google Analytics 4 tracking alongside Universal Analytics and run both trackings parallelly until the UA expires. I have across a blog that contains the detailed GA4 setup mentioning every step required. You can use this guide to complete the GA4 setup by yourself. https://www.scommerce-mage.com/blog/how-to-setup-magento-2-ga4google-analytics-4.html


If you using Magento version 2.4.5 or higher, Magento has already released a new module called GoogleGtag that support GA4 and also keeps the old ** GoogleAnalytics** module to support Google Universal Analytics

Alternatively, if you need to use an alternative module or for older Magento versions, there is a free module available by Yireo that supports versions 2.3.7 or higher and 2.4.1 or higher.

This module is a great module and highly recommended by the Magento community. You can take a look at: https://github.com/yireo/Yireo_GoogleTagManager2

  • 1
    Thanks I was referring to < 2.4.5 - making the 2.4.5 module available would be a great idea.
    – paj
    Nov 7, 2022 at 15:08
  • @paj I've added a great free module that supports GA4 to my answer :).
    – Tu Van
    Jun 20 at 11:57

Instruction on how to configure GA4 with GTM for Magento 2 Store. Easy Step by Step guide configures GA4 Extension in your Magento 2. https://www.magedelight.com/resources/how-to-configure-ga4-with-gtm-in-magento-2-store/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.