The Google Tag Manager extension will help your website work effectively with different e-commerce transactions. It can decrease the errors because of editing codes and quickly update for your store.
It is necessary for you to add Google Tag Manager on your website to eliminate the maintenance of code snippets in your source files. Furthermore, it also allows developing tags and code snippets on your website quickly and easily. All of these apps including Enhanced E-commerce, Google Remarketing, Facebook Pixel, etc will be managing easily.
You can buy Google tag manager at this link: https://www.mageplaza.com/magento-2-google-tag-manager/
How to Configure Google Tag Manager.
- a. Go to Admin > Store > Configuration > Sales > Google API > Google Analytics > and set this option to [ No ].
- b. Go to Admin > Store > Configuration > Sales > Google API > Google Adwords > and set this option to [ No ].
- c. Go to Mageplaza> Google Analytics Enhanced Ecommerce > General Configuration > Enable Google Tag Managerand set this option to [ Yes ].
- You need to create a Google Tag Manager account if you don’t have one already at this link: https://www.google.com/analytics/tag-manager/
- Setup Account name, Setup Container from your Google Tag Manager like in the image.
- Once the account is created get the Google Tag Manager (GTM) scripts in the admin section of your Magento 2 store Mageplaza> Google Analytics Enhanced Ecommerce > General Configuration. You need also to get the code for the “<body>” section.
- Then go to Mageplaza> Google Analytics Enhanced Ecommerce > General Configuration > Google Tag Manager Non-Js Code and paste the code for “<body>” section in your Magento store.
- In Magento admin configure your Google Tag Manager (GTM) API Credentials in order to automatically link your store with your GTM account and create all default provided triggers automatically with one click.
- For this you need to go to Mageplaza> Google Analytics Enhanced Ecommerce > GTM API Configuration and fill in Account ID, Container ID, Universal Analytics Tracking ID. All this information can be found in your Get information from Google Tag Manager and Google Analytics accounts.
- a) Go to Google Tag Manager (GTM) Identify the IDs in your GTM account like in the picture.
- b) Go to Google Analytics (GA) You can see how to get your Universal Analytics ID credentials from your Google Analytics account. The tracking code is available under GA account > Admin > Property settings > Tracking ID as you can see in the picture.After you click you will find the Tracking ID you need.
- After filling Account ID, Container ID and Universal Analytics Tracking ID hit Sign into Google and allow to link your Google Tag Manager (GTM) account with your Magento Store
You will be notified to save your credentials in order not to lose them before continuing with the process.
Hit Save Config button.
Go to Mageplaza> Google Analytics Enhanced Ecommerce > GTM API Configuration and hit Create Variables, Triggers and Tags button.
You will be notified about the Variables, Triggers and Tags created.
- After all your tags have been created in Google Tag Manager (GTM), go to Google Tag Manager (GTM) and simply publish all your tags. Just follow the steps from Google Tag Manager to finish the publish.
- Woohoo, the extension is configured!Note: Your GA and GTM account are now configured with our pre-generated settings and ready to receive valuable information from your Magento 2 store! You can now gather valuable data and make data-driven decisions! Congrats!
Note 2: If you would like to receive even more personalized tracking data, you can always extend your GTM and GA default configurations from your account. If you would like our Google Certified Specialists to help you with that please contact our support for a quote.
- Impression Chunks Size – allows you to break up the payload into smaller chunks. We recommend limiting it to 15. The analytics.js library refuses to send a hit if the full payload size is larger than 8192 bytes. This does require quite a lot of data to be stuffed within, but it only takes some dozens of product impressions to clog up the channel
- Product identifier [ SKU / ID ] – you can identify products in GA and GTM either by SKU or by product ID from your Magento catalog
- Enable Brand – if you would like to have each product brand tracked in Google Analytics E-commerce Reports – select yes and use appropriate brand attribute
- Order Success Page Total Calculation [ Subtotal / Grand total ] – Calculates total amount on success page based on Subtotal or Grand total
- Promotion Tracking [ Yes / No ] – Example of usage:
<a href="#" data-track-promo-id="PROMOID" data-track-promo-name="PROMONAME" data-track-promo-creative="PROMOCREATIVE" data-track-promo-position="PROMOPOSITION">Content </a>
- Exclude Tax From Transaction [ Yes / No ] – Exclude taxes amount from the transaction
- Exclude Shipping From Transaction [ Yes / No ] – Exclude shipping amount from the transaction
- Custom Dimension – Customer ID [ Yes / No ] – Use customer ID as a custom dimension
- Custom Dimension – Customer Group [ Yes / No ] – Use customer group as a custom dimension
- Custom Dimension – Stock Status (in stock/out of stock) [ Yes / No ] – Use customer dimension as a custom dimension
Google Tag Manager API CONFIGURATION
- Account-ID – Must be set as seen in Step 4 from Configure section
- Container ID – Must be set as seen in Step 4 from Configure section
- Universal Analytics Tracking ID – Must be set as seen in Step 4 from Configure section
- I.P Anonymization [ Yes / No ] – Allows website owners to request that all of their users’ IP addresses are anonymized. It helps website owners comply with their own privacy policies or, in some countries, recommendations from local data protection authorities, which may prevent the storage of full IP address information.
GOOGLE ADWORDS CONVERSION TRACKING
- Enable [ Yes / No ] – Enables Google AdWords conversion tracking
- Google Conversion ID – You need a Google AdWords account adwords.google.com. Follow Google documentation on how to find Google Conversion ID for AdWords.
- Google Conversion Label – Follow Google documentation on how to find Google Conversion Label for AdWords.
- Google Conversion Currency Code – Fill in the currency used in AdWords account. e.g. USD
- Enable [ Yes / No ] – Enables Google AdWords remarketing.
- Google Conversion Code – Follow Google documentation on how to find Google Conversion Code for Google AdWords Remarketing.
- Google Conversion Label – Follow Google documentation on how to find Google Conversion Label for Google AdWords Remarketing.