YouTube videos that could help you do this task :
How to install Google Tag Manager on Shopify :
Goal: To add Google Tag Manager to a Shopify store.
Ideal Outcome: Google Tag Manager is properly installed without any technical issues.
Prerequisites or requirements: You need to have Google Analytics on your store. If you havenât done it yet, you can follow
How to add Google Analytics to a Shopify StoreWhy this is important: Google Tag Manager is a great tool to add and manage multiple pixels and tracking codes without needing to edit the code of a site.
**Note: If you want to add Google Analytics to a Shopify store, do not do it through Google Tag Manager but follow :
How to add Google Analytics to a Shopify Storeinstead. However, Google Tag Manager is still the most recommended way to deploy other scripts to your Shopify site.
Where this is done: In your Shopify admin panel and Google Tag Manager.
When this is done: Only onceâthe first time you install Google Tag Manager.
Who does this:
The person responsible for website management or analytics.
- Environment Setup
- Download and install the Google Tag Assistant Chrome Extension (Free)
- Grab your Google Tag Manager container code
- If you donât have a Google Tag Manager account yet:
- Sign up for Google Tag Manager (Free):
- Youâll need to log in to your Google account.
- Youâll be prompted to set up a Google Tag Manager account right away.
- You can just use your company/website name for both the account and container.
- Under âWhere to Use Containerâ, select âWebâ
- Accept the terms and conditions.
- You will see your Google Tag Manager code.
d1. Copy the code without the <script></script> tags, you will need it for the next chapter.
d2. Below that you will find another piece of code copy the whole code including the <noscript> tags, you will also need it for the next chapter.
- Once you are in your Workspace, click on Submit > Publish > Continue to publish your Google Tag Manager container:
If you already have a Google Tag Manager account:
- Log into your Google Tag Manager account;
- On the top header click âAdminâ â âInstall Google Tag Managerâ
- Copy the code between the <script></script> tags (do not copy those tags). You will need it in the next chapter.
Important: pay attention to the section of the code being copied. Youâll need to exclude the â<script>â and â</script>â tags to follow this process.
- Below the first snippet of code, you will have a second one, this time copy all the code (including the <noscript> tags. You will also need it for the next chapter.
Adding Google Tag Manager to your Shopify Store
**Note: This method allows you to add Google Tag Manager to your whole website in contrast to the official documentation that would only allow you to add GTM to the non-checkout pages unless you are a Shopify Plus customer.
If you are a Shopify Plus customer, follow the official documentation laid out here.
- Log into your Shopify store.
- On the sidebar, under âOnline Storeâ click âPreferencesâ.
- Click âAdd custom JavaScript to Google Analytics.
- Paste the section of code you got from the previous chapter.
- Click âSaveâ
- On the sidebar, under âOnline Storeâ click âThemesâ:
- Click âActionsâ â âEdit Codeâ
- On the search bar, search for âtheme.liquidâ â Click âtheme.liquidâ
- Locate a section of the code that starts with â<bodyâ you can either scroll down until you find it or you can just use your browserâs search feature (typically Ctrl+F for PC, and â+F for Mac) â Paste the second snippet of code that you got from Google Tag Manager (the one that contains the <noscript> tag) in there:
Example:
- Click âSaveâ in the top right corner:
QA-ing your installation
- Open your website homepage using Chrome.
- Click on the Google Tag Assistant Chrome Extension
- Click on âEnableâ
- Refresh the page and click on the Google Tag Assistant Chrome Extension again
You should see a green tag for Google Tag Manager, indicating that the installation was successful.