Setup Google Analytics 4 (GA4) Magento 2 eCommerce Tracking without Module / Plugin using Google Tag Manager
Here are the steps to set up Magento 2 GA4 ecommerce tracking without a module or plugin using the data layer and GTM:
- Create a Google Tag Manager (GTM) account if you don’t already have one.
2. Install the GTM code on your Magento 2 website. This can typically be done by copying and pasting the code into the header of your site’s pages.
3. Create a data layer in Magento 2 to store ecommerce data. This can be done by adding a data layer script to your site’s pages. The data layer script should include information about the products on the page, transaction details, and any other relevant data.
4. Create a GTM tag for GA4 ecommerce tracking. Choose “Google Analytics: GA4 Configuration” as the tag type and configure the tag with your GA4 tracking ID.
5. In the tag configuration, select “Use Data Layer” and map the data layer variables to the appropriate GA4 ecommerce tracking fields.
6. Preview and publish the GTM container to make sure that the data layer and GA4 ecommerce tracking are working correctly.
By using the data layer and GTM, you can implement GA4 ecommerce tracking on your Magento 2 website without using a module or plugin. This setup will allow you to track ecommerce data and insights in GA4, giving you a better understanding of your site’s performance and allowing you to make data-driven decisions to improve your e-commerce business.
Disclaimer: Google tag manager belongs to Google property
For Contact: firstname.lastname@example.org
I am available for Hire on Freelancer: Freelancer.com
I am available for Hire on Upwork: Upwork.com
I am available for Hire on Peopleperhour: Peopleperhour.com
I am available for Hire on Guru: Guru.com