Skip to content

Google Analytics 4 vs Magento Open Source 2.4: GA4 / GTM ecommerce tracking

I am currently trying to set up ecommerce tracking for GA4 in Magento 2.4.5 (open source). Therefore I have set under Stores > Configuration > Sales > Google API at Google GTag / Google Analytics 4 “Enable” to “Yes” and entered the Measurement-ID. Furthermore, under Content > Design > Configuration in the HTML Head and Footer I have inserted the appropriate Tag Manager Code Snippets.
In the source code I can see that the “Magento_GoogleGtag/js/google-analytics” script is included with the correct id, but I can’t find any dataLayer.
What else do I need to do to get Magento to output the ecommerce dataLayer definitions?