The short answer
To add Google Tag Manager to your website, create a free account at tagmanager.google.com, choose “Web” as the container, and copy your GTM ID (GTM-XXXXXXX). Install it with a plugin on WordPress or paste the two code snippets into your site. Publish the container, then confirm it works with GTM’s Preview mode.
Before you start
By the end of this SOP
Google Tag Manager is live on every page of your website and Preview mode connects.
- Time
- 10–15 minutes
- You’ll need
- A Google account and admin access to your website (WordPress admin, Shopify admin, or the site’s code).
- Who does this
- The person who manages the website or analytics.
About this SOP: why it matters, where and when
Why it matters: Without GTM, every new pixel means asking a developer to edit code. With GTM you add, test and remove tags yourself in minutes.
Where: In Google Tag Manager and your website admin.
When: Once, before you install any other tracking.
Stage 1
Create your GTM account and container
- 1
Go to tagmanager.google.com and sign in with the Google account the business owns (not your personal one).
- 2
Click “Create account” and fill in the form:
- Account name: the business name (e.g. Unlearn Academy).
- Country: where the business is.
- Container name: the website address (e.g. unlearnacademy.in).
- Target platform: Web.
- 3
Click “Create”, tick the terms box and click “Yes”.
- 4
A pop-up shows two code snippets. Leave it open if you will paste code by hand. On WordPress, click OK, you will use a plugin.
Tip
Copy your GTM ID (GTM-XXXXXXX) from the top bar. You need it in the next stage.
Stage 2
Install GTM on your website
Pick the method for your platform. Only do one of them.
- 1
First, check what is already on the site. Open the site, right-click → View page source, and search (Ctrl+F) for “gtag(”, “fbq(” and “GTM-”.
Watch out
Old Google Analytics, Google Ads or Meta Pixel code pasted straight into the theme is the most common reason for double-counted results. List it now and remove it once the same tags run through GTM.
- 2
WordPress: in the dashboard go to Plugins → Add New, search “GTM4WP”, then Install and Activate.
- Open Settings → Google Tag Manager and paste your GTM ID.
- Leave container code placement on the default (“Codeless injection”) and click Save Changes.
Watch out
Take a site backup before installing plugins. Then open your site in a new tab and check nothing looks broken.
- 3
Shopify: go to Online Store → Themes → Edit code → theme.liquid. Paste the first snippet just after <head> and the second just after <body>. Save.
Note
Shopify checkout pages don’t load theme code. To track purchases, use Shopify’s Customer events (custom pixel) or the Google & YouTube app.
- 4
Any other site (Webflow, Wix, custom code): paste the first snippet as high in <head> as possible and the second right after the opening <body> tag on every page.
Stage 3
Set up consent before any tags
Consent means visitors agree before you track them. Set it up once, now, so every tag you add later respects it.
- 1
Add a cookie consent banner (a CMP, consent management platform) that supports Google Consent Mode v2. Free or low-cost options include CookieYes, Complianz (WordPress) and Cookiebot.
- Many CMPs have a GTM template: Tags → New → search the Community Template Gallery for your CMP’s name.
- 2
Fire the CMP tag on the “Consent Initialization – All Pages” trigger, so it runs before every other tag.
- 3
Set the defaults: for visitors from the EU, UK and Switzerland, ad_storage, analytics_storage, ad_user_data and ad_personalization start as “denied” until they click Accept.
- 4
Turn on consent overview: in GTM, Admin → Container settings → tick “Enable consent overview”. Every tag then shows which consent it needs.
Note
Why this matters in Kerala too: many Gulf and NRI visitors browse from Europe, Google requires Consent Mode v2 for EEA/UK traffic, and India’s DPDP Rules (2025) make clear consent notices the norm for personal data.
Stage 4
Publish and test
- 1
Back in GTM, click “Submit”, give the version a name like “GTM installed”, and click “Publish”.
- 2
Open your website, right-click → View page source, and press Ctrl+F (Cmd+F on Mac). Search for your GTM ID. It should appear.
- 3
In GTM, click “Preview”, enter your website URL and click “Connect”. Your site opens with a “Tag Assistant Connected” badge.
Tip
Not connecting? Try an incognito window and turn off ad blockers. Caching plugins can also hide the code until you clear the cache.
- 4
Agency standard: the GTM account belongs to the client’s Google account. In Admin → User management, give yourself “Publish” on the container, not account Administrator.
Agency playbook
Doing this for a paying client
What a senior checks before calling the job done. Numbers are starting rules; compare them with the account’s own history.
What good looks like
- Exactly one GTM container ID appears in the page source of every template: home, service page, blog post, thank-you page and checkout.
- The container lives in the client’s GTM account. The client is account Administrator; your agency has Publish on the container only.
- Consent overview shows a consent setting on every tag. None is left as “Not set”.
- Every published version has a clear name and notes, so anyone can roll back to the last good version in one click.
Mistakes we see on real accounts
- Installing through a plugin and also pasting the theme snippet. Two containers load and every event is counted twice.
- Publishing from the Default Workspace while a colleague has untested changes there. Their broken tags go live with yours.
- Ignoring “Delay JavaScript” in speed plugins like WP Rocket. GTM loads late, so quick visitors and some leads are never tracked.
- Giving a freelancer account-level Administrator. They can delete the container or remove the client’s own access.
Agency checklist before you call it done
- Record the container ID, owner email and install method (plugin, theme code or hard-coded) in the client’s tracking sheet.
- Screenshot Tag Assistant “Connected” and the page source showing the GTM ID. Save both to the client folder.
- After publishing, export the container (Admin → Export container) and save the file with today’s date as a backup.
- Use one Workspace per task, named like “2026-10 GA4 install – Anu”, so half-done work never goes live by accident.
- Test the consent banner: click Reject, then check the Consent tab in Preview shows ad and analytics storage as denied.
- Remove old hard-coded tags only after their GTM replacements are tested. Note each removal and the date.
- Add a change-log entry: version number, what changed, who published.
Handover message to the client
Hi [Client name], Google Tag Manager is now live on [website]. Container ID: [GTM-XXXXXXX]. You own the account on [owner email], and we have publish access. Please tell us before any website redesign or plugin change, so tracking doesn’t break.
Senior tip
Store every ID (GA4, AW-, Meta dataset) as a Constant variable and use it in your tags. When an ID changes, you edit one variable, not twenty tags.
Practice & check
Now do it for real
Reading is not doing. Open your own account and complete this task before you move on.
Practice task (5 min)
Install GTM on a practice site (a free WordPress or your own portfolio). Publish version 1 and screenshot Tag Assistant saying “Connected”.
Prove it
Two questions. Get both right and this SOP is done.
Common questions
Is Google Tag Manager free?
Yes. The standard version of Google Tag Manager is free for any website.
Do I still need Google Analytics if I have Google Tag Manager?
Yes. GTM only delivers tags to your site. Google Analytics 4 is the tool that collects and reports the data. You install GA4 through GTM.
Where do I paste the Google Tag Manager code?
The first snippet goes as high as possible in the <head>, the second immediately after the opening <body> tag, on every page. On WordPress, the GTM4WP plugin does this for you.
Do I need Consent Mode v2 for an Indian website?
If any visitors come from the EU or UK, Google requires it for ads and measurement. With India’s DPDP Rules 2025, a clear consent banner is also good practice for every site. Set it up in GTM before adding tags.
Done. That’s a real skill, not a certificate.
Next: SOP 009 — Set Up Google Analytics 4 with Google Tag Manager →
Want to do this on real client budgets, with a mentor checking your work? That’s Level 2 at Unlearn. See the Digital Marketing track