Marketing Analytics

GA4 Setup: How to Set Up Google Analytics 4 the Right Way

GA4 setup step by step: how to set up Google Analytics 4 with the right property, tag, data retention, internal traffic, events, key events and consent.

GA4 Setup. Track what matters from day one. Illustrated with an analytics dashboard.

GA4 setup takes about ten minutes to get data flowing and much longer to get data you can trust. Installing the tag is the easy part. The settings most installs skip, such as data retention, internal traffic, the events that matter to your business and consent, decide whether your reports show reality or a rough guess.

This GA4 setup guide covers how to set up GA4 from scratch, step by step, following Google’s own setup instructions, then the configuration most guides leave out, and the checks to run before you rely on the numbers. It includes the event plan we use on our own site as a worked example.

The short version

  • Create the account, property and web data stream, then install the Google tag on every page, once.
  • Change data retention to 14 months on day one. It can’t be applied to data already collected.
  • Exclude internal traffic, so your own visits don’t inflate the numbers.
  • Plan your events before you build them: use the automatic ones, add the few actions that matter to your business, and use Google’s recommended names where they fit.
  • Mark the actions that matter as key events (formerly conversions).
  • Link Search Console, and Google Ads if you advertise.
  • Respect consent where the law requires it, and never send personal information to Analytics.
  • Test before you trust it, with Realtime, DebugView and a comparison against your own records.

Before you start your Google Analytics 4 setup

You’ll need a Google account, access to your website (or its platform’s settings, or Google Tag Manager), and a short list of what counts as success for your business: an enquiry, a booking, a sign-up, a purchase. That list decides the events you’ll set up in Step 7, so write it down now.

If you have visitors in the UK or EU, decide how you’ll handle cookie consent before you install the tag. Step 10 covers it.

Step 1: Create the account and property

  1. Go to Google Analytics and start measuring, or open Admin and create a new account if you already have one.
  2. Name the account (usually your business) and choose the data-sharing settings you’re comfortable with.
  3. Create a property for your website. Choose the reporting time zone and currency your business uses: the time zone decides which day a visit is recorded on.
  4. Enter your industry and business size, and choose how you plan to use Analytics. Google uses this to pick your default reports, and you can change the reports later.

Step 2: Add a web data stream

Choose Web, enter your site’s main URL and a stream name. Leave enhanced measurement switched on: it collects page views and several common interactions automatically (covered in Step 6). When the stream is created, copy its Measurement ID, which starts with G-.

Step 3: Install the Google tag

Pick the method that fits your site:

Your site How to install
A platform with a built-in Google Analytics field (Shopify, Wix, many WordPress plugins) Paste the Measurement ID into that field
A builder without one Add the full Google tag snippet through its custom code or HTML setting
A hand-coded site Paste the Google tag into the head of every page
Google Tag Manager Add a Google tag with your Measurement ID, set to fire on all pages

Install it once. The most common GA4 mistake is a duplicate tag, for example a plugin and a theme both adding it, which double-counts every page view. Google says data collection can take up to 30 minutes to begin; check the Realtime report to see your own visit arrive.

Step 4: Set data retention to 14 months

In Admin, under Data collection and modification, open Data retention and change event data retention from 2 months to 14 months. This setting controls how far back explorations and funnel reports can look, according to Google’s data retention help. Standard reports aren’t affected, but with 2 months you can’t compare this year’s explorations with last year’s. The change only applies from the moment you make it, which is why it belongs on day one.

Step 5: Exclude internal traffic

Your own visits, and your team’s, distort small sites badly. Google’s process for excluding internal traffic has three parts:

  1. Define internal traffic in your web stream’s tag settings, using your office or home IP address.
  2. Create a data filter for internal traffic, set to exclude.
  3. Test, then activate. Leave the filter in Testing mode first and check that it catches only your traffic. Activating it permanently removes matching data, and filters can take 24 to 36 hours to take effect.

If your team works from changing IP addresses, also ask them to use a browser profile with an analytics opt-out, and accept that some internal visits will get through.

Step 6: Check what enhanced measurement collects

Enhanced measurement records these events without any code:

Event What it records
page_view Every page load, including changes in single-page apps
scroll The first time a visitor reaches 90% of a page’s depth
click Clicks on links to other websites
view_search_results Searches on your site, read from the URL’s search parameter
video_start, video_progress, video_complete Engagement with embedded YouTube videos
file_download Clicks on links to common file types, such as PDFs
form_start, form_submit Form interactions

Two checks are worth making. If your site search uses a parameter other than the usual ones (q, s, search, query, keyword), add it in the stream settings. And treat the automatic form events with care: a “submit” isn’t always a successful submission, so for leads, track the confirmation instead (Step 7).

Step 7: GA4 events setup for the actions that matter

Enhanced measurement covers browsing. Your business needs events for the actions that make money. Plan them before you build them:

  • Use Google’s recommended event names where they fit, such as generate_lead, sign_up, purchase or begin_checkout. Some reports and integrations understand them automatically.
  • Add parameters for the details you’ll want to compare, such as which form, which product category or which plan.
  • Register parameters as custom dimensions in Admin, or they won’t appear in your reports.
  • Fire events on success, not on attempts. A lead event should fire when the form was actually sent, not when the button was clicked.
  • Keep the list short. A handful of well-defined events beats dozens nobody looks at.

Here’s the plan we use on our own site, as a worked example:

Event When it fires Parameter
generate_lead On the thank-you page, only after a real, successfully sent contact or audit form lead_source: which form it came from
tool_run Once per page view, when a free tool first works on the visitor’s own input tool_name
tool_export Each time a visitor copies or downloads a tool’s result tool_name
tool_use Other tool interactions, such as loading an example tool_name, tool_action

Two rules sit behind it. The lead event only fires when our form handler confirms the message was sent, so spam submissions and failed sends never count. And no event ever carries anything a visitor typed or pasted, which keeps personal data out of Analytics entirely.

Step 8: Mark your key events

Key events are the events you mark as most important; GA4 called them conversions until 2024. In Admin, open Events, find the event and click the star to mark it as a key event, following Google’s guide to key events. Standard properties can have up to 30. Mark only real business outcomes, such as leads, sign-ups and purchases, not scrolls or clicks.

In Admin, under Product links, link your Search Console property to see the searches that bring people to each landing page alongside what they did next. If you advertise, link Google Ads too, so you can import your key events as ad conversions and see paid and organic results side by side.

  • Consent. Google Analytics sets cookies, so in the UK and EU you generally need visitors’ consent before it sets them. Google’s consent mode lets the tag respect each visitor’s choice, and its region setting applies a different default by country. On our own site, analytics cookies stay off in the UK, the EU and Switzerland until a visitor accepts, and anyone can change their choice from the footer. Check the rules for every country you have visitors from.
  • No personal information. Google’s policies forbid sending Analytics anything that could identify a person, such as names, email addresses or phone numbers, including inside page URLs or event parameters. Check form confirmation URLs in particular.
  • Your privacy policy should say that you use Google Analytics, what it collects and how visitors can opt out. Google states that Google Analytics 4 doesn’t log or store IP addresses.

Step 11: Check it before you trust it

  1. Realtime: visit your site and watch your page views and events arrive.
  2. DebugView: with debug mode on (through Tag Assistant or Tag Manager’s preview mode), walk through each important action, such as submitting a form, and confirm the right event fires once, with the right parameters.
  3. Compare with your own records: after a week, check GA4’s lead or purchase count against your inbox, CRM or store orders. A small gap is normal; a large one means something is broken.
  4. Look for duplicates: if every page shows two page views per visit, you have two tags.

Standard reports can take a day or two to fill in, so judge the setup on a week of data, not the first afternoon.

A GA4 setup checklist

A GA4 setup checklist in order: create the property, add a web data stream, install the Google tag once, set data retention to 14 months, exclude internal traffic, check enhanced measurement, plan and build your events, mark key events, link Search Console and Google Ads, handle consent, and verify with Realtime and DebugView.

Common GA4 setup mistakes

  • Two tags on the same page, double-counting everything.
  • Leaving data retention at 2 months.
  • Counting your own visits because internal traffic was never excluded.
  • Treating every form submit as a lead, including spam and failed sends.
  • Too many key events, so the important ones get lost.
  • Personal data in URLs or events, which breaks Google’s policies.
  • No consent handling for visitors in the UK and EU.
  • Never checking the numbers against what actually happened in the business.

Where GA4 fits

GA4 is the measurement layer under everything else: it tells you which channels and pages bring leads and sales, which is what a useful marketing report is built on. If you’d rather have the setup done and checked for you, our analytics and conversion rate optimization services include GA4 setup, event planning and reporting.

Opens in a new tab

Frequently asked questions

How do I set up GA4?

Create an Analytics account and property, add a web data stream, and install the Google tag on every page, either through your website platform's integration, Google Tag Manager or by pasting the tag into the page head. Then change data retention to 14 months, exclude internal traffic, set up the events that matter, mark your key events and link Search Console.

Is Google Analytics 4 free?

Yes. The standard version of Google Analytics 4 is free. Analytics 360, the paid version, adds higher limits and service levels for large organizations, which most businesses don't need.

How long does it take for GA4 to show data?

Google says data collection can take up to 30 minutes to begin after the tag is installed, and you can check it in the Realtime report. Standard reports can take a day or two to fill in, so don't judge a new setup on its first day of data.

What are key events in GA4?

Key events are the events you mark as most important to your business, such as a lead form submission or a purchase. They were called conversions until 2024. Standard properties can mark up to 30 events as key events.

Should I set up GA4 with Google Tag Manager?

Use Tag Manager if you'll add custom events, run other tags such as ad pixels, or want to change tracking without editing the site. For a simple site that only needs page views and the automatic events, your platform's built-in integration or the Google tag on its own is enough.

What is the GA4 data retention setting?

It decides how long event-level data is kept for explorations and funnel reports: 2 or 14 months on standard properties. It doesn't affect the standard reports. Set it to 14 months so you can compare against the same period last year.

How do I set up events in GA4?

Start with what enhanced measurement collects automatically, then add events for the actions that matter to your business. Use Google's recommended event names where they fit, such as generate_lead or purchase, add parameters for the details you need, and register those parameters as custom dimensions to report on them.

Does GA4 need a cookie consent banner?

Google Analytics sets cookies, so in the UK and EU you generally need visitors' consent before it sets them. Google's consent mode lets the tag respond to each visitor's choice, with no analytics cookies until they agree. Other countries have their own rules, so check the ones that apply to your visitors.

Why don't GA4 numbers match my other tools?

Different tools count differently: ad platforms count clicks, analytics counts sessions and events, and consent choices, ad blockers and time zones all remove or shift data. Small gaps are normal. Large gaps usually mean a duplicate tag, missing tag or broken event, which the checks in this guide catch.

Want reports that show what's working?

Tell us how you measure marketing today, and we'll tell you honestly what's worth tracking and reporting on.