Last Updated on October 12, 2026
Google Tag Manager (GTM) is how we load GA4, Google Ads conversion tags, and other tracking on a client’s site. Install the container once, and every tag after that is managed in GTM, not in the site’s code.
Every container has two snippets. Find them in GTM by clicking the container ID (GTM-XXXXXXX) at the top of the Workspace.
- Snippet 1 (script): Goes in the <head>. This is the one that does the work.
- Snippet 2 (noscript): Goes right after the opening <body> tag. It only runs for visitors with JavaScript turned off, so if a platform can’t place it there, the footer is fine.
Rule of thumb: if the platform has a built-in GTM field, use it and paste only the container ID. If not, paste snippet 1 into the site-wide head code.
Check for an existing install first. Use the Tag Assistant Chrome Extension to check if the site already has Tag Manager installed.
We use the GTM4WP plugin by Thomas Geiger. Don’t edit theme files.
GTM4WP requires PHP 8.0 and WordPress 6.3 or newer. On an older site the plugin won’t activate, so ask the developer to update first.
- Go to Plugins > Add New Plugin, search “GTM4WP,” then install and activate it.
- Go to Settings > Google Tag Manager.
- Under General, enter the Container ID.
- Set Container code placement to Automatically after the opening body tag. If the theme doesn’t support it, leave the default, Footer of the page.
- Save, then click through a few pages to make sure nothing broke.
The placement setting only moves snippet 2. The plugin always puts snippet 1 in the <head>.
For GA4 and Google Ads, start with the Google & YouTube app. It’s Shopify’s supported route and needs no GTM. Use GTM only if the client needs tags the app doesn’t cover.
GTM on Shopify runs as a custom pixel:
- Remove any old GTM code from theme.liquid so events aren’t counted twice.
- Go to Settings > Customer events > Add custom pixel and name it.
- Paste snippet 1 without the <script> tags. Skip snippet 2.
- Save, then click Connect.
Custom pixels run in a sandbox. GTM won’t pick up clicks or form events on its own, so every event has to be sent to GTM with custom code. Tag Assistant can’t see the pixel either, so test with the Shopify Pixel Helper Chrome extension.
Custom code requires a paid Site plan or Workspace plan.
- Go to Site settings > Custom code.
- Paste snippet 1 into Head code.
- Paste snippet 2 into Footer code.
- Save changes, then publish the site.
Custom code only runs on the published site, not in the Designer. Test on the live URL.
HubSpot has a built-in GTM field on all plans.
- Click the settings icon, then go to Content > Pages.
- Open the Integrations tab.
- Check Integrate with Google Tag Manager, enter the container ID, and save.
This covers HubSpot-hosted pages only. If the client’s main site lives somewhere else, install GTM there too. While you’re on the Integrations tab, remove any old Google Analytics ID so GA4 doesn’t load twice.
Code Injection requires a Core, Plus, or Advanced plan (or a legacy Business or Commerce plan).
- Go to Website > Pages > Website Tools > Code Injection.
- Paste snippet 1 into Header.
- Paste snippet 2 into Footer.
- Save.
Squarespace checkout pages don’t run custom code, so GTM won’t fire there.
Wix has a built-in GTM field. It requires a Premium plan and a connected domain.
- In the site dashboard, go to Marketing Integrations.
- Click Connect under Google Tag Manager, then Add Google Tag Manager.
- Enter the container ID and save.
If Google Tag is also connected in Marketing Integrations, disconnect it and load GA4 through GTM instead. Running both double-counts.
If the site has a cookie banner, GTM only loads after a visitor accepts cookies. Test with the banner accepted.
Verify the Install
- In GTM, click Preview, enter the site URL, and click Connect. Tag Assistant opens the site in a new tab.
- Confirm Tag Assistant shows the container as connected, then click through a few pages, including a form and its thank-you page.
- Check that only one container shows up. A second container ID means there’s a duplicate install to remove.
- Remember that installing the container doesn’t make tags live. Tags only go live after you click Submit and publish a version in GTM.