Skip to content

The complete GA4 setup guide (2026)

Set up Google Analytics 4 properly: property settings, Google Tag Manager, Consent Mode v2, lead tracking with key events, and the checks that prove it works.

By Amin · · 11 min read

Google Analytics 4 installs in five minutes and takes far longer to set up properly. The default property records page views and a handful of automatic events, but it doesn't know what a lead is, keeps detailed data for only two months, counts your own visits and splits paying customers into "referral" traffic from your payment provider.

This guide walks through a setup that holds up: property settings, installation through Google Tag Manager, consent, key events for leads and sales, and the checks that prove it works. It assumes a typical business site with a contact or quote form, and notes where ecommerce differs.

Before you start: write a measurement plan

Open a document and list three things before touching GA4:

  1. The business outcomes the site exists for, such as quote requests, booked calls, purchases or sign-ups.
  2. The event that proves each outcome, using lowercase names with underscores. Use Google's recommended event names where one fits, because some reports and Google Ads features recognise them: generate_lead for a submitted form, purchase for an order, sign_up for an account.
  3. Supporting actions worth seeing but not worth optimising ads for, such as quote_start, email_click or phone_click.

Keep it short. A plan with five events that everyone understands beats forty events nobody reads. Event names are case-sensitive and permanent in your reports, so decide them now.

Step 1: Create the account, property and data stream

In GA4 Admin, create an account for the business (not for the agency) and a property for the website. Set the reporting time zone and currency to the ones your business reports in; changing them later doesn't rewrite past data.

Add a web data stream for your domain. Leave enhanced measurement on: it records scrolls, outbound clicks, site search, file downloads and page changes in single-page apps without extra tags. Turn off any enhanced measurement option you will track more precisely yourself. For example, if your forms are tracked with a dedicated generate_lead event, switch off "Form interactions", which fires on form starts and submissions in ways that rarely match real leads.

Copy the Measurement ID (it starts with G-).

Step 2: Change the settings the defaults get wrong

These settings sit under Admin and are skipped in most setups:

SettingWhereWhat to set
Data retentionData collection and modification → Data retention14 months. The default of 2 months limits explorations to recent data.
Internal trafficData streams → Configure tag settings → Define internal trafficYour office and home IPs, then activate the "Internal traffic" filter under Data filters.
Unwanted referralsData streams → Configure tag settings → List unwanted referralsPayment and booking domains (Stripe, PayPal, Calendly) so returning buyers keep their original source.
Cross-domainData streams → Configure tag settings → Configure your domainsEvery domain a visitor moves between in one journey, such as your site and a separate shop or booking domain.
Google signalsData collectionOnly if you need demographic reports and your consent setup covers it. It increases data thresholding.

Data filters start in Testing state. Testing filters only tag matching traffic; nothing is excluded until you switch the filter to Active. Check the filter in the Realtime report first, then activate it, because excluded data can't be recovered.

Step 3: Install with Google Tag Manager

You can paste the Google tag straight into the site, but Tag Manager is worth the extra step: every tag is versioned, documented and changeable without a developer.

  1. Create a GTM container for the website and add its two snippets to every page (one in <head>, one after <body>). On frameworks such as Next.js, use the official component or a single layout file so the snippet loads once.
  2. In GTM, create a Google tag with your G- Measurement ID, triggered on Initialization – All Pages.
  3. Publish nothing yet. Open Preview (Tag Assistant), load your site, and confirm the Google tag fires once per page.

A common mistake is to install GA4 both directly in the code and through GTM. Every page view then counts twice and engagement rates look oddly perfect. Search your page source for G- and gtag( before you start.

If you have visitors from the EU, UK or Switzerland, Google requires Consent Mode v2 for advertising features, and privacy law requires consent before analytics cookies in most of those countries.

Consent Mode has two versions:

  • Basic: no Google tags load until the visitor accepts. Simple and conservative, but you lose all data from people who decline.
  • Advanced: tags load with consent denied and send cookieless pings. Google then models some of the missing conversions. You get more complete reports, but you need to confirm with your legal adviser that this suits your market.

Either way, the defaults must be set before the Google tag loads: analytics_storage, ad_storage, ad_user_data and ad_personalization all start as denied and switch to granted only when the visitor accepts. Most consent platforms (Cookiebot, CookieYes, Usercentrics and others) have a GTM template that does this. Test it in Tag Assistant: the Consent tab should show the default state on page load and the update when you click accept.

Step 5: Track leads as key events

This is the step that turns GA4 from a traffic counter into a business report.

Prefer a success signal, not a click. A form submission is a lead only when the server accepts it. The most reliable source is your own code pushing an event to the data layer after a successful submission:

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: "generate_lead",
  form_name: "quote",
  service: "analytics",
});

In GTM, create a Custom Event trigger for generate_lead and a Google Analytics: GA4 Event tag that sends generate_lead with the parameters you need. If the form is a third-party embed you can't change, use the "thank you" page view or the vendor's own event instead. GTM's built-in Form Submission trigger often misses forms that submit with JavaScript.

Never send personal data. Names, email addresses and phone numbers must not go into event parameters or page URLs. That breaks Google's terms and, in Europe, the law. Send the service, form name or value, not the person.

Then, in GA4 under Admin → Events, find generate_lead once it has arrived and mark it as a key event. Key events are what GA4 calls conversions since 2024. Google Ads conversions are now set up separately, which keeps ad optimisation independent of your analytics reporting.

If you register custom parameters such as service or form_name as custom dimensions (Admin → Custom definitions), they become available in reports. Unregistered parameters are collected but not shown.

Step 6: Connect Google Ads and Search Console

  • Google Ads: Admin → Product links → Google Ads links. This shares audiences and lets you import GA4 key events into Google Ads. For bidding, many advertisers prefer the native Google Ads conversion tag (with enhanced conversions) as the primary conversion and keep imported GA4 events as secondary. That way a GA4 change can't silently break campaign optimisation.
  • Search Console: Admin → Product links → Search Console links. This adds organic query and landing page reports to GA4.
  • BigQuery (optional, free): the daily export keeps raw event data permanently and outside GA4's sampling and thresholds. Turn it on early; it doesn't backfill history.

Step 7: Verify everything

Don't trust a setup until you have watched it work:

  1. Open GTM Preview, then GA4 Admin → DebugView. Your test session appears with each event in order.
  2. Submit a real test lead. Confirm that exactly one generate_lead arrives, with the parameters you expect and no personal data.
  3. Decline consent in a fresh private window and check that no analytics cookies are set (Advanced mode will still show cookieless pings).
  4. Check the Realtime report from your phone on mobile data, so internal traffic filters don't hide you.
  5. Wait 24–48 hours before judging standard reports, because GA4 processes data with a delay. Test traffic from debug mode is included in those reports unless you activate the Developer traffic data filter, so turn it on once testing is done.

A setup checklist you can keep

  • Measurement plan written and agreed
  • Data retention set to 14 months
  • Internal traffic defined and filter active
  • Unwanted referrals and cross-domain configured
  • One Google tag, installed once, through GTM
  • Consent Mode v2 defaults load before any Google tag
  • Lead events fire on real success, once, without personal data
  • Key events marked; custom dimensions registered
  • Google Ads and Search Console linked
  • Every event verified in DebugView and Tag Assistant

If any box stays unticked, the reports built on top of it will be wrong in ways that are hard to spot later. When numbers already disagree, start with GA4 not tracking conversions: 12 fixes.

Amin

Founder of Adseo

Amin builds websites and sets up analytics, tracking and technical SEO for businesses that want to know which marketing brings in customers.

Rather have it set up for you?

Pick the services you need and get a price range in a minute. You'll get a reply within one business day.