2. Go To “WORK SPACE” and click on “New Tag” to create your website tag
Select Tag Type: Universal Analytics
You can select Trigger as per website requirement in triggering section.
You can also add you Google Analytics UA - Id while configuring the Google Tag Manager. It will help to track analytic data to Google Analytics account. It is used for advanced e-commerce tracking including sales report in Google Analytics.
Select Tag Type: Universal Analytics
You can select Trigger as per website requirement in Triggering section
You can also add Google Analytics UA- Id while configuring the Google Tag Manager.
It will help to track analytic data to Google Analytics account.
It is used for Advance e-commerce tracking including sales report in Google Analytics.
3. Go to your Magento 2 admin panel, go to stores => Configuration => Sales => Google API. And add GTM container id by selecting account type: Google Tag Manager and save the configuration.
Find Container Id in GTM see below screen shot.
After created account in GTM you can find the container id in form of “GTM-XXXXX”
4. You can verify the GTM code by view you website page source, Go to your web browser and press Ctrl+U
Now your GTM setup is done
You can also setup Universal Google Analytics directly with the Magento 2 Website.
Enable GA (Google Analytics) in Magento
Go to Your Magento 2 Admin panel, Go to Stores => Configuration => Sales => Google API. And add you GA code by selecting Account Type: Universal Account and save the configuration.
You can also verify the code using view page source of your website.
Create the GA account with Google and create your website account from more option => create account.
Enable the advance e-commerce setting from the GA account
Go to Administration => VIEW => Ecommerce Settings, Add below settings
Enable Ecommerce:
Status = On
Enable Related Products = On
Enhanced Ecommerce Settings
Enable Enhanced Ecommerce Reporting = On
Checkout labelling, funnel steps as per your requirement. Click on submit button
Go To Account property User Management => Tracking Info => Tracking Code
You will see:
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXX-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments)};
gtag('js', new Date());
gtag('config', 'UA-XXXXXX-X');
</script>