The short answer
To set up Google Analytics 4 with Google Tag Manager, copy your Measurement ID (G-XXXXXXX) from GA4 Admin → Data streams. In GTM, create a “Google Tag” with that ID on “Initialization – All Pages”, then publish and check Realtime. On day one, also set data retention to 14 months, mark leads as key events and link Google Ads.
Before you start
By the end of this SOP
GA4 collects data from every page, and you can see your own visit in Realtime.
- Time
- 20–30 minutes
- You’ll need
- A GA4 property with a web data stream, and Google Tag Manager on your site (SOP 004).
- Who does this
- The person who manages the website or analytics.
About this SOP: why it matters, where and when
Why it matters: Ads platforms only report their own clicks. GA4 shows all traffic, from every channel, in one place.
Where: In Google Analytics 4 and Google Tag Manager.
When: Once, right after Google Tag Manager is installed.
Stage 1
Copy your Measurement ID from GA4
- 1
Go to analytics.google.com and open the right property.
- 2
Click Admin (gear icon, bottom left) → Data collection and modification → Data streams.
- No property yet? In Admin click “Create” → Property, add a Web data stream with your website URL, then come back here.
- 3
Click your website stream and copy the Measurement ID (G-XXXXXXX) at the top right.
Stage 2
Add the Google Tag in GTM
- 1
Open tagmanager.google.com, choose your website’s container, and go to Tags → New.
- 2
Name the tag so anyone can find it later, e.g. “GA4 – Google Tag”.
Tip
Use a simple naming pattern for every tag: Tool – Purpose. Your future self (and your client) will thank you.
- 3
Click Tag Configuration → “Google Tag”, and paste your Measurement ID in the Tag ID field.
- 4
Click Triggering → “Initialization – All Pages”. Click Save.
- 5
Click Submit, name the version “GA4 installed”, and click Publish.
Stage 3
Check that data is coming in
- 1
In GTM, click Preview, enter your site URL and Connect. Click around a few pages. Your Google Tag should show under “Tags Fired”.
- 2
In GA4, open Admin → Data display → DebugView. Your test visit appears there within a minute.
- 3
Open Reports → Realtime overview in another tab while you visit your site. You should see at least 1 active user.
Note
Standard reports take 24–48 hours to fill. Realtime and DebugView are the right places to check on day one.
Stage 4
Do the day-one settings
Five settings agencies change on every new property. Skip them and the data is wrong or lost, and it can’t be fixed later.
- 1
Data retention: Admin → Data collection and modification → Data retention. Change “Event data retention” from 2 months to 14 months and Save.
Watch out
This only applies from today. Data older than 2 months is already gone from Explorations, so do it on day one.
- 2
Key events: Admin → Data display → Events. Find your lead event (e.g. generate_lead, or the event you send from GTM) and turn on “Mark as key event”.
- A key event is GA4’s name for an important action, like a lead or a purchase.
- 3
Internal traffic: Admin → Data streams → your stream → Configure tag settings → Define internal traffic. Add your office IP, then in Admin → Data filters set the Internal Traffic filter to Active.
- Your team visiting the site all day otherwise looks like real customers.
- 4
Payment gateways: in the same tag settings, open “List unwanted referrals” and add razorpay.com, payu.in, paytm.com and any other gateway you use.
- Without this, purchases are credited to “razorpay.com / referral” instead of the ad or post that really brought the buyer.
- 5
Links: Admin → Product links → Google Ads links → Link, and also link Search Console. Now GA4 shows ad costs and search queries next to your data.
- 6
Enhanced measurement: Admin → Data streams → your stream. Keep it on, but open its settings and turn off “Form interactions” if your form tool already sends its own lead event; otherwise one lead is counted twice.
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
- DebugView shows one page_view per page load. Two means the site still has hard-coded GA4 code as well as GTM.
- Starting rule: weekly lead key events in GA4 sit within about 10–20% of the client’s enquiry sheet, allowing for visitors who reject cookies.
- Starting rule: “Unassigned” and “(not set)” together stay under about 5% of sessions in the Traffic acquisition report.
- Property time zone (IST) and currency (INR) match Google Ads, so costs and conversions line up day by day.
- Only real business actions are key events: leads, purchases, bookings. Never page_view, scroll or session_start.
Mistakes we see on real accounts
- Leaving a former employee’s personal Gmail as the only Administrator. When they leave, nobody can add users or fix settings.
- Marking click or scroll events as key events. Imported into Google Ads, they make Smart Bidding chase cheap clicks, not leads.
- Skipping cross-domain setup for a separate booking site. Every booking shows as a referral from your own website.
- Testing only on desktop. A mobile menu or sticky WhatsApp button often fires differently, so mobile leads go missing.
Agency checklist before you call it done
- Record the account ID, property ID, stream ID and Measurement ID (G-) in the client’s tracking sheet.
- Screenshot Realtime, DebugView, Data retention at 14 months and the key events list. Save them to the client folder.
- Access: the client is Administrator on their own account; agency staff get Editor at property level on work emails.
- Turn on Google signals only after Consent Mode v2 works and the client agrees. Note the decision in the privacy log.
- If bookings, payments or a course portal sit on another domain, add both domains under Configure your domains (cross-domain tracking).
- Add a GA4 annotation for the install date, so anyone reading later knows when data starts.
- Add a change-log entry: what you set, the GTM version number, the date.
Handover message to the client
Hi [Client name], Google Analytics 4 is now collecting data on [website]. Property ID: [123456789]. You are the Administrator on [owner email]. Full reports fill in over the next 48 hours; we will share the first weekly summary on [date].
Senior tip
Link BigQuery (Admin → Product links) on day one. The daily export keeps raw events beyond the 14-month limit and usually costs little or nothing for small sites.
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)
Set up GA4 on your practice site, visit three pages, and screenshot Realtime showing your visit and the pages you opened. Then screenshot your Data retention page set to 14 months.
Prove it
Two questions. Get both right and this SOP is done.
Common questions
Where do I find my GA4 Measurement ID?
In Google Analytics go to Admin → Data collection and modification → Data streams, click your web stream, and copy the ID that starts with G-.
Should I use the Google Tag or the GA4 Event tag in GTM?
Use the Google Tag once to load GA4 on every page. Use GA4 Event tags for extra actions such as form submits or button clicks.
Why is my GA4 showing no data?
Check that the GTM container is published, the Measurement ID is correct, and ad blockers are off while testing. Use Realtime, because normal reports take 24–48 hours.
What is a key event in GA4?
Key events are GA4’s name for conversions: the important actions you care about, like a lead form or a purchase. Mark an event as a key event in Admin → Events.
How long does GA4 keep data?
Only 2 months for detailed reports by default. Change it to 14 months in Admin → Data retention on day one; the change is not backdated.
Done. That’s a real skill, not a certificate.
Next: SOP 005 — Install the Meta Pixel on Your Website →
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