Google Tag Manager

GA4 GTM Setup: Install GA4 with Google Tag Manager the Right Way

Set up GA4 through Google Tag Manager with the current tag types, events fired from dataLayer pushes, a naming table, and a test in Preview and DebugView before you publish.

Cover: GA4 through GTM, done right. a GTM workspace with a Google Analytics tag and three event tags wired to dataLayer triggers, flowing into a GA4 DebugView timeline.

Many GA4 tutorials still show the old "GA4 Configuration" tag. Google’s Tag Manager help now has you add a Google Analytics tag (Tag Configuration, then Google Analytics, then Google Analytics) with your tag ID, on Initialization - All Initialization Events. The Google Tag type still works and is listed as the alternate method. Either way, the install is the easy part. What makes the data usable is the event layer on top and the test before publishing.

Before you start

  • Access. Editor on the GA4 property and at least Edit in the GTM container. Someone with Publish rights signs off at the end.
  • Tag ID. In GA4, Admin, Data streams, your web stream. It starts with G-.
  • Nothing else sending to the same ID. Look for a CMS plugin, a theme setting or hard-coded gtag.js. Two installs means double page views.
  • A tracking plan. A list of the events you need and their parameters. If you don’t have one yet, start with the tracking plan template.

The setup, step by step

How to

Set up GA4 with Google Tag Manager

From tag ID to published version, in the order that avoids rework.

  1. 01

    Store the tag ID once

    Create a Constant variable holding your G- ID. Every GA4 tag reads it, so moving to another property later is a one-field change.

  2. 02

    Add the Google Analytics tag

    Tags, New, Tag Configuration, Google Analytics, Google Analytics. Enter the tag ID variable and choose Initialization - All Initialization Events as the trigger.

  3. 03

    Decide page views on single-page apps

    If the site changes pages without reloading, page views can come from the tag’s history-change detection, from GA4 enhanced measurement, or from your own push. Keep one source.

  4. 04

    Create Data Layer Variables

    One per parameter you will send: value, currency, transaction_id, method, form_id. Name them with a prefix such as DLV - value.

  5. 05

    Create Custom Event triggers

    One per event the site pushes, matching the name exactly: generate_lead, sign_up, purchase.

  6. 06

    Add GA4 Event tags

    Tag type Google Analytics: GA4 Event. Set the measurement ID, the event name and the parameters, then attach the matching trigger.

  7. 07

    Preview

    Click Preview, enter the site URL, click Connect, and walk the real path. Each tag should fire once with filled variables.

  8. 08

    Check DebugView

    In GA4, Admin, Data display, DebugView. Preview turns debug mode on, so your test events and their parameters appear here.

  9. 09

    Publish with a note

    Submit, Publish and Create Version, with a version name and a one-line description of what changed.

  10. 10

    Register custom dimensions

    Parameters you want in reports need a custom dimension. Standard properties allow 50 event-scoped and 10 item-scoped.

  11. 11

    Mark key events

    Admin, Data display, Events, then the star next to the event. Allow up to 24 hours for standard reports.

GA4 event naming table

Use GA4’s recommended names wherever one fits. Recommended events come with documented parameters, and other tools expect them. Invent a name only for actions GA4 has no event for.

Copy this

Business action to GA4 event

 GA4 eventParameters to sendNote
Lead form succeededgenerate_leadvalue, currency, lead_sourcecurrency is required if you send value
Account createdsign_upmethodmethod is optional, e.g. email or phone
Logged inloginmethodUseful for audiences, rarely a key event
Product viewedview_itemcurrency, value, itemsitems need item_id or item_name
Added to cartadd_to_cartcurrency, value, itemsvalue is a number, not text
Checkout startedbegin_checkoutcurrency, value, items, couponFire once per checkout
Paid orderpurchasetransaction_id, value, currency, itemsvalue excludes tax and shipping
Site searchsearchsearch_term
Call or WhatsApp clickcontact_click (custom)method, page_locationCustom names follow the same rules

The naming rules that trip people up: names are case sensitive (Purchase and purchase are two events), must start with a letter, and use only letters, numbers and underscores. Names and parameter names stop at 40 characters, parameter values at 100, and an event carries at most 25 parameters. Avoid the reserved names and prefixes listed in Google’s naming rules.

Testing in Preview and DebugView

Preview tells you what GTM did; DebugView tells you what GA4 received. You need both. In Preview, click each event in the left column and check three things: the tag fired once, it fired on the right event, and every variable had a value at that moment. Then open DebugView and find the same event with its parameters.

Debug traffic still lands in your property. Filter developer traffic out as described in filtering test and internal traffic in GA4. Before you publish, run the checks in publish GTM changes safely.

Where this goes wrong

  • Double install. A forgotten gtag.js in the theme plus the GTM tag sends every page view twice. Remove one before you trust any numbers.
  • Page views multiplied on single-page apps. Your own page_view push, the tag’s history-change detection and enhanced measurement’s browser-history setting can all fire on one navigation. Pick one; the enhanced measurement switch is in the GA4 stream settings, not in GTM.
  • Case drift. Generate_Lead from one developer and generate_lead from another split one action into two events.
  • Parameters nobody registered. GA4 receives form_id, but it only shows in reports once you create a custom dimension for it, and only from that day on.
  • Hard-coded IDs in every tag. Ten tags with the ID typed in means ten edits and one missed. Use the Constant variable.
  • Testing only the home page. Walk the conversion path, including the payment return page, on mobile as well as desktop.

Deciding which events count as key events, and how they differ from what Google Ads imports, is covered in GA4 key events.

Do it faster with Whathead

With Whathead’s Google Tag Manager MCP connected, Claude or ChatGPT can create the variables, triggers and GA4 event tags from your naming table in a GTM workspace, then list the workspace changes for you to review. Through the GA4 MCP the same chat can create custom dimensions and mark key events. Whathead is our product.

  • “In container GTM-XXXXXXX, create Data Layer Variables for value, currency and lead_source, a Custom Event trigger for generate_lead, and a GA4 Event tag that sends them. Use my Constant for the measurement ID. Don’t publish.”
  • “In my GA4 property, create event-scoped custom dimensions for lead_source and form_id, then mark generate_lead as a key event.”

What you see before anything changes: GTM writes have no dry-run preview, so Claude asks you to approve each write, the changes land in a workspace rather than on the site, and the workspace status lists every changed entity before you publish. GA4 admin changes are shown as a preview first. Preview mode and DebugView stay your job.

GA4 GTM setup: common questions

Do I need Google Tag Manager to use GA4?

No. You can paste the Google tag into the site. GTM is worth it when you also run ad pixels and custom events, because every tag, trigger and change history lives in one container.

Should I use the Google Analytics tag or the Google Tag type in GTM?

Google’s Tag Manager help lists the Google Analytics tag as the recommended method and the Google Tag type as the alternate. Both use your G- tag ID and an Initialization trigger.

Why is my GA4 DebugView empty?

Usually debug mode is off, you are in the wrong property, or consent mode is set and analytics consent was not granted in your test session. Preview mode turns debug mode on for you.

How long does GA4 take to show new events?

Realtime and DebugView show events within seconds to minutes. Google says to allow up to 24 hours for a new key event to appear in standard reports.

Should I rely on enhanced measurement form events?

Use them as a rough engagement signal. For leads you optimize on, fire generate_lead from a dataLayer push after the form succeeds.

Sources

Written by Ahmed Shahin, founder of Whathead. Last reviewed 19 November 2026.