How to set up Google Tag Manager for Magento 2?

Member

by dudley , in category: SEO Tools , 4 months ago

How to set up Google Tag Manager for Magento 2?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by elliott , 4 months ago

@dudley 

To set up Google Tag Manager for Magento 2, follow these steps:

  1. Sign in to your Google Tag Manager account or create a new one if you don't have one already.
  2. Create a new container by clicking on "Create an Account" and then "Create Container". Enter a name for your container and select the domain where it will be used.
  3. After creating the container, you will be given a GTM container code that consists of two parts - a head tag and a body tag.
  4. Copy the GTM container code.
  5. In your Magento 2 admin panel, go to Stores > Configuration.
  6. Under the Sales tab, click on "Google API". If you do not see this option, it means that you do not have the necessary extension installed.
  7. Expand the "Google Analytics" section and enable it. Enter your Google Analytics Tracking ID and save the configuration.
  8. Now, go to Content > Design > Configuration.
  9. Select the store view where you want to add Google Tag Manager.
  10. Expand the "HTML Head" section and paste the GTM container code into the "Miscellaneous Scripts" field.
  11. Save the configuration and clear the cache.
  12. Test the setup by visiting your website and checking the source code. You should see the Google Tag Manager container code.


Now you can start adding tags, such as Google Analytics, AdWords conversion tracking, Facebook pixel, etc., through the Google Tag Manager interface without making any code changes to your Magento store.