Guide 01 · Setup · GA4 + Tag Manager
Install GA4 with Google Tag Manager: the Google tag, the first page_view, and the check that proves it works
There is exactly one correct way to get GA4 onto a site through Tag Manager, and it is one tag, not two. The Google tag loads your property, sets the Analytics cookies, and sends page_view on its own. The most common install mistake is adding a second page_view tag on top of it and then wondering why page views are double. This guide builds the setup the way Google documents it, then proves it works before anything is published.
After step 5, Tag Assistant Preview lists the Google tag under Tags Fired on the first page event, and the Realtime report in GA4 shows your visit within minutes. After step 6, every visitor is measured the same way.
Download the container: the GA4 base container (JSON) (export format version 2, MD5 78ca8c0d722b5975caa8734bcda46b09). It holds the Google tag from step 3 and the purchase event tag from the debugging guide, with the Measurement ID left as G-XXXXXXXXXX for you to replace. The file is a hand-built import template, validated structurally — it was not exported from a live container. Import it from Admin, then Import Container, choosing Merge if the container already has tags.
What you need
- A Google account with access to the Tag Manager container for the site, and the Editor role or above on the Google Analytics account. Google's setup page lists both as prerequisites.
- A GA4 account and property, with a web data stream for the site. The stream is where your Measurement ID lives: Admin, then Data Streams, then the web stream. The ID starts with
G-. - A Tag Manager account and a web container. One container per website; the container name should be the site's top-level URL.
- Nothing else. No code changes beyond the container snippet Tag Manager gives you at install time, and no second analytics snippet.
The trace
- Create the GA4 property and the web data stream. In Analytics, create the account and property, then add a web data stream for the site. Note the Measurement ID from the stream details. This is the ID the Google tag will carry, and it must match exactly — a G- ID from another property sends your data to that property instead. Creating the property and the stream needs a Google sign-in, so this step was traced to Google's documentation, not run here.
- Create the Tag Manager account and container. Go to tagmanager.google.com and sign in. Click the Accounts tab, then Create Account. Enter an account name and the country, then in Container Setup enter the site's URL as the container name and pick Web as the container type. Click Create and agree to the terms. Then follow the install step Tag Manager shows you: paste the container code it gives you into your site exactly as shown. The container ID looks like
GTM-XXXXXXX. - Add the Google tag. In the Workspaces tab, go to Tags, then click New. Replace Untitled Tag with a name such as
GA4 - Google tag. In Tag Configuration, choose tag type Google Tag. In Tag ID, enter your Measurement ID. In Triggering, select Initialization — All Initialization Events. Click Save. The Google tag is what loads your property on the page, sets the Analytics cookies, and sends automatically collected and enhanced measurement events — page_view among them. Google also offers a newer destination flow (Tag Configuration, then Google Analytics, then Google Analytics); this guide uses the Google Tag type because it is the form the downloadable container file carries. - Check it in Preview before you publish. In the Workspace tab, click Preview at the top right. Tag Assistant opens in a new tab. Enter your website URL and click Connect. Your site opens with a Connected marker, and the Tag Assistant tab shows the debug view. On the first event of the page, the Google tag must appear under Tags Fired. If it sits under Tags Not Fired, the trigger did not match — go back to step 3 and check the trigger is Initialization, not Page View.
- Publish it as a version. In the Workspace tab, click Submit at the top right. Select Publish and Create Version, enter a name and a description for the version, and click Publish. Visitors see nothing until this step runs: Preview tests your workspace draft, and the published version is what the live site loads.
- Confirm it in GA4. Open the Realtime report in your property. Your own visit should appear within minutes. Standard reports and explorations can take 24 to 48 hours to process data, so a same-day check belongs in Realtime, not in a standard report. If Realtime stays empty, the Measurement ID in the tag and the one in the web stream disagree — that is the first thing to compare.
Dead ends
DEAD END — A SECOND page_view TAG DOUBLES THE COUNT. The Google tag sends page_view by itself. Adding a GA4 Event tag named page_view on top of it records the same page view twice. If your page views look double, this is the first place to look.
DEAD END — THE TAG FIRES BUT NOTHING ARRIVES. A tag that fires with the wrong Measurement ID is working perfectly — for the wrong property. Compare the Tag ID in the tag against the Measurement ID in Admin, then Data Streams, then the web stream. Copy it from the stream; do not type it from memory.
DEAD END — PREVIEW SHOWS THE DRAFT, NOT THE LIVE SITE. Preview runs your workspace as if it were published, and only in the browser where you started it. Nobody else sees it, and the live site does not change until you publish a version.
End state
One container, one Google tag on the Initialization trigger, one Measurement ID. The Realtime report shows visits within minutes of publishing, and page_view arrives once per page load. From here, events are added as GA4 Event tags on their own triggers — the purchase event in the debugging guide is built exactly that way, and the downloadable container already contains it.
Sources
- Tag Manager Help — Set up Google Analytics in Tag Manager — the Google tag, the Tag ID, the Initialization trigger, Preview verification, and the publish flow
- Tag Manager Help — Create an account and container — account and container creation, one container per website, Web container type
- Tag Manager Help — Set up Google Analytics events in Tag Manager — the GA4 Event tag and its trigger, and Realtime and DebugView as the places to see events as they are triggered
- Analytics Help — Confirm that you are collecting data — many reports and explorations can take 24 to 48 hours to process data; Realtime and DebugView confirm collection sooner
- Tag Manager Help — Container export and import — Admin, then Import Container, then choose the file; Overwrite removes everything, Merge keeps what exists
Checked 11 November 2026. The click paths above are the ones in Google's help pages, opened 11 November 2026. No step in this guide was run inside a live Analytics property or a live Tag Manager container, because both need a Google sign-in and this site does not sign in as anyone. The container file was validated structurally instead: export format version 2, every tag's firing trigger resolves (the Google tag fires on the built-in Initialization trigger, ID 2147479573), every variable the purchase tag references exists in the file, and the tag types are the documented ones — googtag for the Google tag and gaawe for the GA4 event tag. Google moves menu items without warning; if a path on this page no longer matches, the linked help page is the current map.