How to Set Up GA4: A Complete Step-by-Step Guide (2026)
Most GA4 problems trace back to a rushed setup. This guide walks through a clean, correct GA4 installation using Google Tag Manager — the way an analytics practitioner would do it — so your data is trustworthy from day one.
Tools used in this guide
What is Google Analytics 4?
Google Analytics 4 (GA4) is Google's current analytics platform, and it works fundamentally differently from the old Universal Analytics (UA) it replaced in July 2023. Understanding that difference is the key to setting it up correctly — most mistakes come from treating GA4 like UA.
The core shift is the data model. Universal Analytics was built around sessions and pageviews, with a rigid category/action/label structure for events. GA4 is built around a single, flexible primitive: the event. In GA4, everything is an event — a page view is a page_view event, a purchase is a purchase event, a scroll is a scroll event. Each event carries parameters (key–value pairs) that describe it. This event-based model is what lets GA4 track across web and app, model cross-device journeys, and feed machine-learning predictions.
| Concept | Universal Analytics (old) | GA4 (current) |
|---|---|---|
| Core unit | Session / pageview | Event |
| Event structure | Category / Action / Label | Event name + parameters |
| Conversions | Goals (destination, duration…) | Key events (flagged events) |
| Cross-platform | Web only | Web + app in one property |
| Data model | Aggregated tables | Raw event stream (BigQuery-ready) |
| Identity | Client ID (cookie) | Cross-device: User-ID, Google signals, device |
Because GA4 collects a raw event stream, a clean setup means being deliberate about which events you send and what parameters ride along with them — that's what the rest of this guide is about.
What you'll need before starting
Before touching GA4, make sure you have:
- Admin access to a Google Analytics account
- Google Tag Manager installed on your site (this guide uses GTM, not the hardcoded gtag.js snippet)
- Edit access to your website, or a developer who can add the GTM container
Installing GA4 through GTM instead of pasting gtag.js directly is the single most important decision here. It keeps all your tracking in one place, makes future changes possible without code deploys, and is how nearly every serious analytics setup is run.
Step 1: Create your GA4 property
In Google Analytics, go to Admin → Create Property. Enter your business name, reporting time zone, and currency. Getting the time zone right matters — it defines when your "day" starts in every report, and changing it later does not retroactively fix historical data.
Once the property is created, add a Web data stream for your site. Enter your full domain (including https://) and a stream name. GA4 will generate a Measurement ID that looks like G-XXXXXXXXXX. Copy it — you'll need it in the next step.

Step 2: Add the GA4 Configuration tag in GTM
In Google Tag Manager, create a new tag:
- Choose Google Tag as the tag type
- Paste your
G-XXXXXXXXXXMeasurement ID - Set the trigger to Initialization - All Pages
Using the Initialization trigger (rather than the standard All Pages trigger) ensures the Google tag loads before any event tags that depend on it. Save the tag with a clear name like GA4 - Configuration.

Step 3: Turn on Enhanced Measurement
In your GA4 data stream settings, enable Enhanced Measurement. This automatically tracks page views, scrolls, outbound clicks, site search, and file downloads with zero extra configuration.
Enhanced Measurement is genuinely useful, but review each toggle. Site search tracking, for example, only works if your search results pages use a query parameter GA4 can read (q, s, search, etc.). Turn off anything that doesn't apply to your site to keep your event list clean.
Step 4: Plan and create your key events
GA4 automatically collects some events, but the ones that matter to your business — form submissions, signups, purchases — need to be defined deliberately. Sketch a short measurement plan first: list the 5–10 actions that actually indicate success on your site.
For each custom action, you'll push an event to the data layer and fire a GA4 Event tag in GTM. A standard data layer push looks like this:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'generate_lead',
'form_name': 'newsletter_signup',
'value': 0
});Wherever possible, use Google's recommended event names (sign_up, purchase, generate_lead) rather than inventing your own. Recommended events unlock GA4's built-in reports and predictive audiences automatically.
The three tiers of GA4 events
GA4 events fall into three categories, and knowing which is which prevents a lot of confusion:
| Tier | Who defines it | Examples | You configure? |
|---|---|---|---|
| Automatically collected | GA4 itself | first_visit, session_start, user_engagement | No — always on |
| Enhanced Measurement | GA4 (toggle) | page_view, scroll, click, file_download, view_search_results | Toggle in data stream |
| Recommended | Google's schema, you send | sign_up, generate_lead, purchase, add_to_cart | Yes — you fire these |
| Custom | You invent the name | quote_requested, demo_booked | Yes — last resort |
A useful rule: reach for a recommended event name before inventing a custom one. Custom events work, but they don't benefit from GA4's prebuilt reports, and once you send a custom event name you can't rename it later without losing continuity.
Common recommended events worth wiring up
| Event name | When to fire it | Key parameters |
|---|---|---|
generate_lead | A form/lead submission | value, currency, lead_source |
sign_up | Account creation | method |
login | User signs in | method |
search | On-site search performed | search_term |
view_item | Product/detail page view | items, value, currency |
add_to_cart | Item added to cart | items, value, currency |
purchase | Order completed | transaction_id, value, currency, items |
Step 5: Mark conversions (key events)
In GA4, go to Admin → Events (called "Key events" in the current interface). Toggle the events that represent real business goals — purchase, sign_up, generate_lead — as key events. Only mark what genuinely matters; every key event dilutes the meaning of your conversion reports.
Step 6: Verify everything in DebugView
This is the step most people skip, and it's why so many GA4 setups are quietly broken. Enable GTM Preview mode, then open GA4 → Admin → DebugView. As you click through your site, you should see events stream in with the correct names and parameters.
Check specifically that:
- Each event fires once, not multiple times
- Required parameters are populated (no
undefinedvalues) page_viewfires on navigation

Only after DebugView looks clean should you publish your GTM container.
Step 7: Filter out your own internal traffic
Left unaddressed, your own visits — plus your team's and your developers' — pollute every report, and on a low-traffic site they can badly skew conversion rates. Set up an internal traffic filter:
- In Admin → Data Streams → your stream → Configure tag settings → Show all → Define internal traffic, add a rule matching your office/VPN IP addresses. This stamps qualifying traffic with
traffic_type = internal. - In Admin → Data Settings → Data Filters, GA4 creates an "Internal Traffic" filter. Leave it in Testing mode first to confirm it's catching the right traffic, then switch it to Active to exclude it.
Do this before you launch campaigns — filters are not retroactive, so any internal traffic collected while the filter is inactive stays in your historical data.
Step 8: Configure cross-domain tracking (if needed)
If a visitor moves between domains you own — say from yoursite.com to a hosted checkout.provider.com — GA4 will, by default, treat the second domain as a new session from a referral source, breaking the journey and inflating your session count.
Fix it in Admin → Data Streams → your stream → Configure tag settings → Configure your domains. Add every domain in the journey. GA4 then passes the client ID between them via a URL parameter (_gl) so the session stays intact. While you're there, add payment providers and any other legitimate cross-domain hops to the unwanted referrals list so they don't show up as traffic sources.
Step 9: Set up Consent Mode (for GDPR/CCPA)
If you serve regions with consent requirements, wire GA4 into your consent banner using Google Consent Mode v2. It tells Google's tags whether the user granted analytics_storage and ad_storage. When consent is denied, tags send cookieless, aggregated pings instead of full events — you keep modeled conversions while respecting the user's choice. In GTM, set default consent states to denied and update them when the user interacts with your banner. Skipping this in a regulated region is both a compliance and a data-quality problem.
Common mistakes to avoid
- Double-tracking: installing both gtag.js directly and GA4 via GTM. Pick one — GTM.
- Skewed data from your own visits: set up an internal traffic filter or use a GTM trigger exception for your IP.
- Marking too many conversions: if everything is a conversion, nothing is.
- Not documenting your setup: keep a simple sheet of every event, its parameters, and where it fires.