Resources/SOPs/SOP 005
SOP 005Analytics

How to Add Google Analytics 4 to a Website via Google Tag Manager

Time30 minutes
📊 LevelBeginner
📅 UpdatedApril 2025
👤 WhoDigital marketer, analytics manager,…

🚀 Goal

Connect Google Analytics 4 to your website through Google Tag Manager so you can track traffic, user behaviour, and conversions accurately.

🎯 Ideal Outcome

GA4 is firing on all pages, the Measurement ID is connected through GTM, data is appearing in your GA4 real-time report, and the setup is verified with Tag Assistant.

🤔 Why This Matters

GA4 is the only way to understand where your website traffic comes from, what pages people visit, how long they stay, and whether they convert. Without it, you are running campaigns and making decisions blind. Every digital marketer working for clients must be able to set this up independently.

RE

Reshma

SEO & Analytics Lead, Unlearn Academy

Mentor Insight

The most common mistake I see students make with GA4 is using 'All Pages' as the trigger instead of 'Initialization - All Pages'. The difference seems minor but it causes data loss on faster-loading pages. Also, always verify in the Real-Time report on the same day you set it up — I have seen students assume it is working for weeks only to discover the tag was never published in GTM. Takes 30 seconds to confirm.

Result: Full GA4 traffic data from day one — no missing sessions, correct source attribution.

⚠️ Before You Start

Google Tag Manager already installed on the website (see SOP 004)

A Google Analytics 4 account and property created for the website

Tag Assistant Companion Chrome extension installed

Phase 1 — Get Your GA4 Measurement ID
1

Find your GA4 Measurement ID

Go to Google Analytics → Click 'Admin' (bottom left) → Confirm the correct account and property are selected. Under 'Data collection and modification', click 'Data Streams' → Select your website. Your Measurement ID is shown at the top right — it looks like: G-XXXXXXXXXX Click on the ID to copy it to your clipboard. Paste it in Notepad or a text editor — you will need it in Step 3.
Phase 2 — Set Up the Tag in GTM
2

Create a new tag in Google Tag Manager

Go to tagmanager.google.com → Select the container set up for your website. Click 'Tags' in the left sidebar → Click 'New'. Rename the tag using this naming convention: GA4_TrackingCode (Consistent naming makes GTM easier to manage as you add more tags over time.) Click on the 'Tag Configuration' icon → Select 'Google Tag' from the tag types list.
📌

Note: Use a consistent naming convention from the start: [Tool]_[Purpose]. Example: GA4_TrackingCode, META_Pixel, GADS_Conversion. This keeps GTM organised across years of use.

3

Enter your Measurement ID and set the trigger

In the Tag Configuration panel, paste your GA4 Measurement ID (G-XXXXXXXXXX) into the 'Tag ID' field. Scroll down → Click the 'Triggering' section (the trigger icon at the bottom). Select 'Initialization - All Pages' as the trigger. This fires GA4 on every page of your website — which is the standard setup. Click 'Save'.
💡

Pro tip: Always use 'Initialization - All Pages' for GA4, not just 'All Pages'. Initialization fires earlier in the page load sequence, which means better data accuracy — especially for single-page applications.

4

Publish the GTM container

After saving the tag, click 'Submit' in the top right corner of GTM. In the Submission Configuration panel: • Version Name: GA4 Setup — [date] • Description: Added GA4 tracking tag via Google Tag Click 'Publish'. You will see a summary of the changes. That is it — GA4 is now live on your website.
Phase 3 — Verify the Setup
5

Verify with GTM Preview and Tag Assistant

In GTM, click 'Preview' → Enter your website URL → Click 'Connect'. A Tag Assistant window will open. Navigate around your website. You should see your GA4 tag (GA4_TrackingCode) in the Tags Fired list on every page. If it appears under 'Tags Not Fired', check: • Your trigger is set to 'Initialization - All Pages' • The container is published (not just saved in preview mode) • Your Measurement ID is correct
6

Confirm data in GA4 Real-Time report

Go to Google Analytics → Select your property → Click 'Reports' → 'Real-time'. Open your website in another browser tab and navigate around. Within 30–60 seconds, you should see '1 user in the last 30 minutes' appear in the Real-Time report. If you see data — setup is complete and verified.
💡

Pro tip: If Real-Time shows 0 users even after browsing your site for 1 minute, check that you are not using an ad blocker. Ad blockers can block GA4 tracking in your own browser.

SOP Complete

You've completed all steps. Document your before/after results and add this to your portfolio as a case study.

Quick Reference

🧐 Where

Google Analytics (analytics.google.com) and Google Tag Manager (tagmanager.google.com).

🗓 When

Once, when setting up a new website or onboarding a new client. Re-run the QA steps after any major website change.

👤 Who

Digital marketer, analytics manager, or web developer.

Want to learn this live?

Join a cohort — real mentors, client briefs, and structured progression from L1 to L4.

Enquire Now

Save This SOP

Related SOPs

← All SOPs