Website Growth
Google Analytics Setup: How to Set Up GA4 on a Website, Step by Step
By Bibek Thapa · Updated · 14 min read
Quick Answer
Google Analytics setup takes four steps: create a GA4 property, add a web data stream, install its Google tag through one method only, then confirm data in Realtime and DebugView. Afterwards, set data retention to 14 months, link Search Console, and mark one or two real business outcomes as key events. Data can take up to 30 minutes to start.

Table of ContentsOn this page
- What you need before starting
- Step 1: Create the account and GA4 property
- Step 2: Add a web data stream
- Step 3: Install the Google tag once
- Step 4: Check GA4 is installed correctly
- Step 5: Change the settings that limit your reports
- Troubleshoot your Google Analytics setup
- Google Analytics setup checklist
- Frequently Asked Questions
- Sources and References
Key Takeaways
- Create the GA4 property and web data stream before installing anything on the site.
- Pick one installation route: a CMS integration, Google Tag Manager or the Google tag in code. Two routes double-count.
- Check Realtime after installing. On Anobee, page_view and session_start appeared within seconds of a test visit.
- Set event data retention to 14 months on day one. It controls how far back explorations and funnel reports can go.
- Mark outcomes as key events, not attempts. Anobee counts newsletter_success, not newsletter_submit.
- Test an internal-traffic filter before activating it. An active exclude filter permanently discards data.
A Google Analytics setup has four parts: an Analytics account, a GA4 property, a web data stream, and one Google tag on the website. None of them is hard. Most broken installs come from the choices around them. Typical ones are the wrong property, the same tag added twice, an unpublished Tag Manager workspace, or a key event marked on something that never fires.
This guide covers how to set up Google Analytics 4 and how to check it is working. It also covers the settings that quietly limit your reports if you leave them alone. Each step shows how Anobee's own GA4 property is configured, so you see a real, working setup.
How this guide was checked: every step was compared with Google's Analytics and Tag Manager help pages on 3 November 2026. The screenshots come from Anobee's GA4 property on the same day. Settings were viewed only, never changed or saved, and the account owner's name and email are cropped out. Google renames menu items from time to time, so follow the linked documentation if your screen differs.
Before you open the setup screen, write down one or two outcomes you want to measure. A completed enquiry, a purchase or a newsletter signup are typical. Google Analytics records visits and events. It does not know which of them matter to your business, and you will need that list for key events.
What you need before starting
Have these ready:
- a Google account controlled by the business or site owner
- permission to create or edit a Google Analytics property
- access to the site's CMS, global code settings, templates or Tag Manager container
- the reporting time zone and currency you want
- a decision about who keeps administrator access
When an agency or freelancer helps, the business should still own the Analytics account. Give collaborators the lowest access level they need, and never make an outside party the only administrator.
Check whether Analytics is already installed. Run the site through Tag Assistant. Then look in the CMS settings or page source for a G- tag ID or a GTM- container ID. A second installation on top of an existing one duplicates page views and events.
Step 1: Create the account and GA4 property
Go to Google Analytics and sign in. For a first account, select Start measuring. If an account already exists, open Admin and select Create, then Account or Property.
Give the account a durable business name. Read the data-sharing options instead of accepting them unread, because they control how account data may be shared with Google.
For the property, Google asks for these fields [1]:
- A recognisable property name, usually the site or business name.
- The reporting time zone your team works in.
- The currency used for revenue reporting.
- Industry, business size and how you intend to use Analytics.
- Accept the terms and select Create.
Time zone and currency deserve the most care. Changing them later affects reporting from that point on rather than rewriting past data. Business objectives only tailor the default report collection. They do not change what the tag collects.
Anobee's choice: the property uses the Nepal time zone (GMT+05:45) and US dollars. The team works in Nepal, so daily reports should close at midnight Kathmandu time. The site's readers and any revenue are mostly international, so dollars are easier to compare with ad and affiliate statements.

| Level | What it represents | Typical website setup |
|---|---|---|
| Account | The organisation that owns the measurement | One business account |
| Property | The reporting container for a related digital experience | One property for the website or connected journey |
| Data stream | A source that sends data into the property | One web stream for the main site |
Do not combine unrelated businesses in one property just because the interface allows several streams. Keep sites together only when they belong to the same customer journey and you want them reported as one.
Step 2: Add a web data stream
Continue from property creation and choose Web. For an existing property, go to Admin, then Data streams, then Add stream, then Web [1].
Enter the main website URL and a clear stream name. Enhanced measurement automatically collects page views and other events, and Google recommends enabling it when you create the stream [1]. Open its settings anyway. It can record scrolls, outbound clicks, site search, video engagement, file downloads and some form interactions without extra code. Keep only the interactions that fit your measurement and privacy plan.
Select Create stream. Stream details then shows a tag ID, usually called the Measurement ID, in the format G-XXXXXXXXXX [1]. Copy the ID from your own property, never one shown in a tutorial.

Anobee has one web stream, named Anobee, for https://anobee.com. Its stream list shows "Receiving traffic in past 48 hours", which is the quickest sign that the stream is alive.
Step 3: Install the Google tag once
Choose one installation route. The right one depends on how the site is built and who will maintain its tracking.
| Installation method | Best fit | What to enter or install |
|---|---|---|
| Native CMS integration | The platform has a maintained GA4 field or official connection | Usually the G- tag ID |
| Google Tag Manager | The site already uses GTM, or needs several tags and custom events managed centrally | A Google Analytics tag with the GA4 tag ID |
| Direct Google tag | A developer controls the shared template and no tag manager is needed | The complete gtag.js snippet, or a framework component that loads it |

Never use two routes for the same tag ID. Double installation is the most common Google Analytics setup fault. A WordPress plugin plus a manually pasted Google tag will send every page view twice.
Option A: Use a supported CMS integration
For a small website, a maintained integration is usually the least fragile choice. Google publishes platform-specific instructions and notes that accurate measurement needs the tag on every page [2].
Open the platform's analytics settings, enter the G- tag ID if asked, save, publish, and clear caches. Follow Google's instructions for your specific CMS rather than pasting a generic snippet into whatever text field you can find.
On WordPress, Site Kit by Google connects the site to GA4 without touching theme files. It is Google's own plugin and lists more than five million active installations. Avoid putting tracking code in a parent theme's header.php file. A theme update can overwrite it, and one syntax mistake can break the site.
Option B: Install GA4 through Google Tag Manager
Use this route when the site already has a working GTM web container, or needs a versioned workflow for several tags. Do not add a second container just for GA4.
Google's current recommended method adds a Google Analytics tag rather than a standalone Google tag [3]:
- Open the correct web container and select Tags, then New.
- Name the tag clearly, for example "GA4, example.com".
- Open Tag Configuration, then choose Google Analytics, then Google Analytics.
- Paste the GA4 tag ID into the Tag ID field.
- Under Triggering, select Initialization, All Initialization Events.
- Save, select Preview, and connect the site in Tag Assistant.
- After a clean test, select Submit, publish, and give the version a name.
Google still lists the Google Tag tag type as an alternate method, with the same Tag ID and initialization trigger [3]. Older guides tell you to create a "GA4 Configuration" tag. That tag type has been replaced, so skip any tutorial that still uses it.

If GTM is not installed yet, start with the Google Tag Manager setup guide. Installing GTM needs both container snippets, which is outside this GA4 procedure.
Option C: Add the Google tag directly
Open the web stream, select View tag instructions, and choose Install manually. Copy the entire Google tag shown for that stream. Add it immediately after the opening head tag on every page, through the shared template or a global code feature [1].
Hand this to a developer when you cannot safely edit the shared HTML. Clear application, page and CDN caches after deployment. Then test more than the homepage, because a tag placed in one template can leave articles, products or checkout pages unmeasured.
How Anobee installs it: anobee.com is a Next.js site, so it uses Option C through the framework. The GoogleAnalytics component from the @next/third-parties package sits in the site's shared layout. That puts the Google tag on every page from one place [12]. There is no Tag Manager container and no plugin, so nothing can load the tag a second time. Custom events, such as scroll depth on articles, go through the same package. They are sent only after the Google tag has started, so an early click cannot create an event the property never receives.
Step 4: Check GA4 is installed correctly
Verification has two layers, and a Google Analytics setup is only finished when both pass. First prove that the tag loads on the website, then prove that the intended GA4 property receives the events.
Check Realtime first
In GA4, open Reports, then Realtime. Visit the site in another tab and move between a few pages. Google says data collection may take up to 30 minutes to begin, so a short delay is not a failure [1].
Anobee's test on 3 November 2026: a visit to this guide appeared in Realtime within about 10 seconds. The "Views by page title" card showed one view of the guide, and the "Event count" card showed page_view and session_start. At the same moment, the "Active users in last 30 minutes" card still read 0. So read the event cards, not only the user count, when you test.

Check the tag with Tag Assistant
Open Tag Assistant, add the site URL and connect. Browse several important page types during the session and confirm that:
- the connected domain is correct
- the expected G- tag ID appears
- the tag fires once per page load
- other page templates also produce a page view
- the consent state matches what the site intends
Tag Assistant only proves what the browser tried to send. Realtime proves the right property received it.

Use DebugView for detail
Enable debug mode through Tag Assistant or GTM Preview, then open Admin, Data display, DebugView. It shows events and user properties from a debug-enabled device in real time [4]. Look for:
- page_view when a page loads or the route changes
- session_start for your test session
- Enhanced measurement events only when the matching interaction happens
- the correct page location and no sensitive parameters
Never send names, email addresses, phone numbers, form contents or any other personally identifiable information as event names, values or parameters.
Step 5: Change the settings that limit your reports
A page view arriving in Realtime proves the install. It does not make the property useful. Most tutorials stop before these parts of a Google Analytics setup.
Set data retention to 14 months
Open Admin, then Data collection and modification, then Data retention. Standard properties can keep event data and user-level data for 2 or 14 months [10]. Choose 14 months unless your privacy policy requires less.
The setting only affects explorations and funnel reports, not the standard aggregated reports [10]. That is why it gets missed. Everything looks fine until you compare this quarter with last year in an exploration, and the data is gone. When you increase the period, Google applies it to data already collected [10], so change it on day one.
Anobee's property has both event data and user data set to 14 months, with "Reset on new user activity" switched on.

Link Search Console
GA4 can show organic search queries and landing pages from Search Console. In Admin, under Product links, open Search Console links and select Link. You need the Editor role on the GA4 property and must be a verified owner of the Search Console property [11].
Each web stream can link to only one Search Console property. Search Console data then appears in Analytics about 48 hours after Search Console collects it [11]. The Search Console reports are also unpublished by default, so publish them from the Library afterwards.
Anobee linked its URL-prefix Search Console property (https://anobee.com/) to its web stream on 16 July 2026. If Search Console is not set up yet, the Google Search Console setup guide covers verification first. The GA4 vs Google Search Console comparison explains which questions each tool answers once both are connected.

Review consent and privacy
The implementation must match the site's privacy notice, consent choices, contracts and the law where your visitors are. Requirements vary by location and data use, and this is not legal advice.
Does the business get traffic from the EEA and use Google advertising products? Then review Google's consent requirements and check the signals the implementation sends [5]. A consent banner and Consent Mode do different jobs. The banner asks for and records a visitor's choice. Consent Mode passes that choice to Google tags. Tag Manager does neither on its own.
Test the tag before consent, after acceptance and after rejection. DebugView may show nothing when consent settings prevent collection [4].
Mark outcomes as key events
A key event is GA4's name for an event that measures an action important to the business. A completed enquiry, purchase or account creation can qualify; an ordinary page view usually does not. Confirm the underlying event in DebugView first, then mark it as a key event, and check it in Realtime afterwards [6].
Anobee's property shows why the choice of event matters. The site sends newsletter_submit every time someone presses the signup button, and newsletter_success only after the signup is confirmed. The key event is newsletter_success, together with contact_success, form_submit and purchase. On 3 November 2026, none of those four had stream data in the previous 28 days, while newsletter_submit did.

So the empty report is accurate. Marking the attempt instead would have counted conversions for signups that never completed. Mark the outcome, keep the list short, and expect a small site's key events to stay at zero for weeks at a time.
Is the report empty for longer than you expect? Compare the names under Key events with the Recent events list in Admin, then Events. A key event whose name never appears in Recent events is either misspelled or never sent.
Test internal-traffic filtering before activating it
Visits from owners, staff or an agency can distort reports on a small site. GA4 can identify internal traffic by IP address and exclude it with a data filter. Each property can have up to 10 data filters [7].
Start the filter in Testing state. An active filter is permanent: excluded data is never processed and will never be available in Analytics or BigQuery [7]. Confirm the test results before switching it to Active.
Troubleshoot your Google Analytics setup
When a Google Analytics setup shows no data, work through the system in order. Check the website, tag, consent and network request, then the receiving property. Changing several settings at once makes the cause harder to find.
| Symptom | Likely cause | What to check |
|---|---|---|
| No tag in Tag Assistant | Missing code, wrong template, cache, content security policy or unpublished change | Inspect the rendered page and test several templates |
| Tag fires but Realtime is empty | Wrong G- ID, wrong property, consent blocking collection or a browser extension | Compare the tag ID character by character and test a consented session in a clean browser profile |
| Realtime shows events but 0 active users | The user card has not refreshed yet | Wait a minute and read the event count card |
| Page views appear twice | A direct tag and a CMS or GTM installation are both active | List every installation route and keep one |
| Homepage works but articles do not | The tag sits in only one template | Move it to the global layout or a sitewide integration |
| GTM Preview works but the live site does not | The workspace was saved but not published, or a cache serves old HTML | Publish a named container version and clear caches |
| Key events stay at 0 | The outcome has not happened, or the marked event name is never sent | Compare Key events with Recent events in Admin |
| Old data missing from explorations | Data retention left at 2 months | Change event data retention to 14 months |
| Reports include staff visits | Internal traffic is not defined or its filter is inactive | Define internal traffic, test the filter, then activate it |

Google's troubleshooting guide recommends checking the Measurement ID, network requests, browser extensions and consent configuration [8]. If nothing appears after the first 30 minutes, repeat the checks with only one installation method active and the correct property open.
Google Analytics setup checklist
- The business owns the Analytics account and has backup administrator access.
- The property uses the intended time zone and currency.
- The web stream points to the canonical production site.
- Enhanced measurement settings match the measurement and privacy plan.
- One installation method sends data to the correct G- tag ID.
- Realtime shows page_view and session_start for a test visit.
- Tag Assistant detects the tag across important page templates.
- No personally identifiable information appears in event data.
- Event data retention is set to 14 months.
- Search Console is linked.
- Consent behaviour has been tested for the audiences that matter.
- Key events are outcomes, verified in DebugView before being marked.
- Internal-traffic filters were tested before activation.
Standard Google Analytics has no subscription charge. Analytics 360 is a separate paid enterprise product [9].
Keep a short setup record. Note the property ID, stream ID, installation method, consent behaviour, key events, retention setting and the date you last checked it. It makes future troubleshooting faster and a duplicate installation far less likely.
Once those checks pass, the next useful step is not adding every possible event. Connect one important business action to a verified event, then use the reports to answer a real question. If some rows show "(not set)", the guide to GA4 (not set) values explains where each one comes from. For a second view of on-page behaviour, the Microsoft Clarity guide adds heatmaps and session recordings. When the data is stable, the conversion rate optimization guide shows how to turn what you see into a disciplined testing process.
Frequently Asked Questions
Is Google Analytics 4 free?
Yes. Google provides the standard Google Analytics product free of charge. Google Analytics 360 is a separate paid enterprise product. You may still pay for consent management, implementation help or consulting.
How do I know if GA4 is installed correctly?
Visit your site in one tab and open Reports, then Realtime, in another. A page_view and session_start for your visit should appear. Then use Tag Assistant to confirm the correct G- tag ID fires once per page across several page types, and DebugView to check the event parameters.
How long does GA4 take to start showing data?
Google says data collection may take up to 30 minutes to begin. A correctly installed tag often shows in Realtime within seconds or minutes. If nothing appears after 30 minutes, check the tag ID, the consent state, browser blockers and the installation method.
Do I need Google Tag Manager to install GA4?
No. A supported CMS can take the GA4 tag ID, and a developer can add the Google tag directly. Anobee, for example, loads it from its Next.js layout without Tag Manager. Tag Manager is worth it when you need versioned control over several tags or custom events.
Where do I find my GA4 Measurement ID?
In Admin, under Data collection and modification, open Data streams and select your web stream. The Measurement ID appears in Stream details and begins with G-.
Why does my GA4 key events report show zero?
Either nothing important happened in the period, or the event you marked never fires. Open Admin, then Events, and compare the key event names with the Recent events list. A key event set on a success event will stay at zero until someone actually completes that action.
Sources and References
- Google Analytics Help: Set up Analytics for a website and/or app ↩
- Google Analytics Help: Install your Google tag with a website builder or CMS ↩
- Tag Manager Help: Set up Google Analytics in Tag Manager ↩
- Google Analytics Help: Monitor events in DebugView ↩
- Google Analytics Help: Verify and update consent settings ↩
- Google Analytics Help: Report on key events ↩
- Google Analytics Help: Filter out internal traffic ↩
- Google for Developers: Verify and troubleshoot Google Analytics ↩
- Google Marketing Platform: Google Analytics ↩
- Google Analytics Help: Data retention ↩
- Google Analytics Help: Connect Search Console to Google Analytics ↩
- Next.js Docs: Third Party Libraries ↩
Was this guide helpful?
Your answer helps Anobee improve future updates.
Written by
Bibek Thapa
AI-Powered Digital Growth Strategist
Bibek Thapa works across AI workflows, SEO, AI search optimization, content strategy, website growth, and productivity systems at Anobee.
- AI workflows
- Digital growth
- SEO
- GEO
- AEO
- Content strategy
- Website growth


