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.