Google Tag Manager

You can use Google Tag Manager with your Shopify Plus online store, as long as you:

  • Use Shopify's integration for Google Analytics and Facebook Pixel instead of using them with Google Tag Manager.

  • You copy the code snippets, that are provided by Google Tag Manager, into your theme.liquid and checkout.liquid theme files.

Add Google Tag Manager code to your theme

To add the Google Tag Manager code to your Shopify Plus store:

  1. Install Google Tag Manager to get the code snippets that you will need to copy and paste into your Shopify store. Because Shopify uses templates, you only need to copy the snippets into a few files.
    • If this is your first time installing Google Tag Manager, then use the installation steps provided by Google Tag Manager. Pause at the step where you are given two code snippets to add to your web pages, and then follow the instructions below.
    • If you have already installed Google Tag Manager, then you can find these code snippets in your Google Tag Manager by clicking Admin, and then clicking Install Google Tag Manager:
      Screenshot of Google Tag Manager showing the code snippets you need to copy to your theme files.
  2. In your Shopify admin, click Online store, and then click Themes.
  3. In the theme drop-down, click Edit Code.
  4. Copy the code snippets from the Google Tag Manager into the <head> and <body> tags of your themes.liquid and checkout.liquid code:
    1. In Google Tag Manager, copy the first code snippet.
    2. In your Shopify admin click Layout, and then click themes.liquid.
    3. Paste the code snippet as high in the <head> of the themes.liquid code as possible.
    4. In Google Tag Manager, copy the second code snippet.
    5. In your Shopify admin, open the checkout.liquid page.
    6. Paste the code snippet as high in the <body> of the themes.liquid page as possible.
  5. In your Shopify admin, click Save.
  6. In Google Tag Manager, continue installing the Google Tag Manager. When prompted to add tags, do not add the following types of tags:
    • Universal Analytics for Google Analytics
    • Classic Google Analytics for Google Analytics
    • Facebook Pixel.

Verify that Google Tag Manager is installed

To verify that Google Tag Manager is installed properly, you can use:

Want to discuss this page?

Visit the Shopify Community

Ready to start selling online with Shopify?

Try it free