GA4 and GTM Setup: Google Tag, Testing and Publishing

Published:
Last Updated:
Category: Web Analytics
Authors: Shusaku Yosa
To deploy GA4 through GTM, identify the intended web stream, configure a Google tag, test collection and publish the reviewed container. A fired tag is not the complete acceptance criterion: the right destination must receive the intended event and values.
Before adding anything, check CMS integrations, hard-coded tags and existing containers. Removing an old tag without understanding its connected destinations can interrupt other measurement.
Prepare the implementation
Area | Required information |
|---|---|
GA4 | Property, web stream, measurement ID and owner |
GTM | Account, web container and publishing responsibility |
Website | Installation access, CMS integrations and templates |
Consent | State supplied to tags and expected behavior |
Testing | Pages, actions, expected events and rollback version |
A G- measurement ID can be used in Google tag setup. It is different from a GTM- container ID. The Google tag versus GTM guide explains the distinction.
Inventory the current deployment
Map each installation method to its destination. Include advertising and consent components, not just Analytics. For a migration, document the old and new configurations, cutover point and rollback path. Do not leave two implementations sending the same events indefinitely.
Install the web container
Use the installation snippets supplied by the intended GTM container, in the documented head and body positions. If a CMS already integrates GTM, avoid adding a second manual installation.
Check the full page inventory, including standalone landing pages, confirmation screens and other domains. A shared template does not guarantee every important journey is covered.
Configure the Google tag
Create a Google tag in GTM and enter the intended tag ID. Follow the current setup instructions using Initialization – All Pages for the base tag.
Consent Initialization is a separate trigger for establishing consent state before other tags. It is not a generic shortcut for making an ordinary measurement tag fire sooner. Verify the implementation against the consent design.
Name the tag by purpose and destination, and cross-check the property name and stream URL rather than relying on the copied ID alone.
Preview and verify collection
Connect GTM preview to the website and perform the intended actions. Inspect event order, firing and destinations in Tag Assistant, then confirm events and parameters in GA4 debugging.
Test | Expected result |
|---|---|
One normal page load | Intended page_view behavior in the correct stream |
Out-of-scope page | Behavior matches the defined conditions |
Single-page application navigation | No missing or duplicate views |
Different consent state | Behavior follows the consent design |
Successful versus failed business action | Success event only for the valid outcome |
Automatic and manual page-view implementations can overlap, particularly on single-page applications. A rising Realtime user count alone does not establish correctness.
Publish a reviewed version
Record the change, test results and rollback version. After publishing, check the published implementation under the same conditions used in preview. Debugging and processed-report validation are separate stages because reports take time to process.
Base-tag installation does not implement every custom event. Form and purchase success require a trustworthy application signal and an event specification.
If data is missing, check the property, installation and published version before investigating conditions, consent, browser extensions, CSP or network restrictions. Do not disable protections wholesale to make a test pass. Record a concrete result: this action sent this event once to this destination.
Related guides
Keep marketing reporting consistent
Use consistent metric definitions and reporting periods when reviewing results. See NeX-Ray’s supported integrations and reporting features, or start for free.
References
Official references checked September 28, 2026. Interface labels and available features can vary by account and rollout.




