Add Google Tag Manager code to your theme - (Shopify)
You can install your tag manager code on the Shopify store using these instructions.
- 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 the
theme.liquidandcheckout.liquidfiles.- 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:

- In your Shopify admin, click Online store, and then click Themes.
- In the theme drop-down, click Edit Code.
- Copy the first code snippet from Google Tag Manager into the
<head>tags of yourtheme.liquidandcheckout.liquidcode:- Copy the first code snippet from Google Tag Manager
- In your Shopify admin, open your
theme.liquidfile. - Paste the code snippet as high in the
<head>of thetheme.liquidcode as possible. - Open your
checkout.liquidfile. - Paste the code snippet as high in the
<head>of thecheckout.liquidcode as possible.
- Copy the second code snippet from the Google Tag Manager into the
<body>tags of yourtheme.liquidandcheckout.liquidcode:- In your Shopify admin, open the
theme.liquidpage. - Paste the code snippet as high in the
<body>of thetheme.liquidpage as possible. - Open the
checkout.liquidpage. - Paste the code snippet as high in the
<body>of thecheckout.liquidcode as possible.
- In your Shopify admin, open the
- In your Shopify admin, click Save.
- 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.
- To learn more you can also check this link at https://help.shopify.com/manual/reports-and-analytics/google-analytics/google-tag-manager
- If your store is on Shopify Plus, you'll need to add the Google Tag Manager code snippets to your
checkout.liquidtheme files as well. - If your store is NOT on Shopify Plus, this code needs to be added only in the
themes.liquidfile after the opening <body>.