Setting up Google Analytics: complete GA4 guide 2026
Setting up Google Analytics is essential for anyone who wants to get serious about online success. Without data you do not know how many visitors you get, where they come from and what they do on your website. In this complete guide you learn, step by step, how to install and configure Google Analytics 4 (GA4) correctly.
Since July 2023, Universal Analytics has been replaced by Google Analytics 4. GA4 works fundamentally differently and offers more powerful insights into user behaviour. But for many website owners, setting up Google Analytics is still a challenge. Where do you start? Which code do you place where? How do you configure events and conversions?
In this article we take you through the complete process of setting up Google Analytics: from creating an account to interpreting your first reports. We also cover privacy legislation (GDPR) and linking with Google Search Console. After reading this guide you will have a fully working GA4 installation.
Why setting up Google Analytics is important
Before we dive into the technical steps, let's first look at why setting up Google Analytics is so crucial for your online success.
Insight into visitor behaviour
Google Analytics answers essential questions:
- How many visitors does my website have?
- Which pages are viewed the most?
- How long do visitors stay on my site?
- Through which channels do visitors arrive (Google, social media, direct)?
- Which keywords lead to visits?
- How many visitors become customers (conversion rate)?
Without this data you are flying blind and cannot make data-driven decisions.
Measuring marketing ROI
If you invest in Google Ads, Facebook adverts or SEO, you want to know what it delivers. By setting up Google Analytics you can:
- See which marketing channels deliver the most conversions
- Calculate cost-per-acquisition for paid campaigns
- Analyse A/B tests to optimise conversion
- Shift budget to the best-performing channels
Improving your website based on data
Analytics reveals problems and opportunities:
- High bounce rates point to irrelevant content or poor UX
- Exit pages show where visitors drop off
- Popular content gives insight into what your audience wants
- Technical problems (404 errors) become visible
Google Analytics 4 vs Universal Analytics
If you worked with Google Analytics before, you used Universal Analytics (UA). Since 1 July 2023, UA no longer collects data. Everyone now has to switch to GA4.
Main differences of GA4
Event-based instead of session-based: UA recorded sessions and pageviews. GA4 records all interactions as events (a pageview is also an event).
Cross-platform tracking: GA4 can follow users across website and app with a single property.
Better privacy: GA4 works without cookies where possible and is more GDPR-compliant.
Machine learning: GA4 uses AI for predictive metrics such as "purchase probability".
Different interface: reports look different and are more flexible to configure.
The process of setting up Google Analytics is largely the same for GA4 as for UA, but the configuration and reports differ significantly.
Step 1: creating a Google Analytics account
We start by creating your Google Analytics account. This is the basis for setting up Google Analytics.
Creating the account
- Go to analytics.google.com
- Click "Start measuring" or "Sign in" (if you already have a Google account)
- Log in with your Google account (Gmail). Do you not have a Google account? Create one first.
- Click "Start measuring"
Account configuration
You are guided through a wizard:
Account name: choose a clear name (for example your company name). You can manage several websites under one account.
Data sharing: you can choose whether to share anonymous data with Google. This is optional but can help Google improve the tool.
Click "Next".
Creating a property
A property is a website or app you want to track. Fill in:
- Property name: for example "Main website" or your domain name
- Reporting time zone: Europe/Amsterdam for the Netherlands
- Currency: EUR (Euro)
Click "Next".
Business details
Google asks about your sector, business size and what you want to achieve with Analytics. This influences which reports are shown by default. Fill it in truthfully and click "Create".
Accept the terms of service. You have now created a GA4 property!
Step 2: setting up a data stream
After creating your property you have to add a data stream. This tells Google Analytics which website or app needs to be tracked.
Adding a web data stream
- You are automatically taken to the "Set up data collection" screen
- Click "Web"
- Fill in:
- Website URL: your full domain, for example https://www.theory7.net
- Stream name: for example "Main website" or your domain name
- Optional: enable "Enhanced measurement" (recommended). This automatically records scrolling, outbound links, site search, video engagement and file downloads.
- Click "Create stream"
Getting the measurement code
After creating it, you see your stream details with:
- Measurement ID: starts with G- (for example G-XXXXXXXXXX). You need this to set up Google Analytics on your website.
- Installation instructions: Google shows code snippets for different installation methods.
Leave this screen open; we will need the Measurement ID shortly.
Step 3: placing the tracking code on your website
Now comes the most important part of setting up Google Analytics: placing the tracking code on your website. There are several methods depending on your platform.
Method 1: Google Tag Manager (recommended)
Google Tag Manager (GTM) is the professional way to manage Google Analytics and other tracking scripts without having to go into your website code each time.
Advantages of GTM:
- No code changes needed after the first installation
- Easy to manage multiple tags (Analytics, Ads, Facebook Pixel)
- Configure events without programming
- Version control and preview mode
GTM installation:
- Go to tagmanager.google.com and create an account + container
- Place the GTM code in the <head> and <body> of every page
- Create a new tag in GTM:
- Type: Google Analytics: GA4 Configuration
- Measurement ID: enter your G-XXXXXXXXXX
- Trigger: All Pages
- Publish the container
Google Analytics is now active through GTM.
Method 2: WordPress plugin
For WordPress websites there is a simpler method through plugins. Popular options:
Site Kit by Google (official):
- Install the plugin "Site Kit by Google" through the WordPress dashboard
- Go to Site Kit → Settings
- Go through the setup wizard and connect your Google account
- Choose your GA4 property
- Site Kit automatically places the tracking code
MonsterInsights:
- Install the MonsterInsights plugin (free or premium)
- Connect it to your Google Analytics account
- The plugin handles tracking and reporting within the WordPress dashboard
Method 3: placing the code manually
If you do not want to use GTM or a plugin, you can place the code manually:
- Copy the GA4 tracking code from your Google Analytics (under data stream → Tagging instructions → Install manually)
- Paste the code into the <head> section of your website, just before the </head> tag
- This must be on ALL pages of your website
For WordPress: use a plugin such as "Insert Headers and Footers" to add code without editing theme files.
Verifying the installation
Check whether setting up Google Analytics has succeeded:
- Go to your GA4 property
- Click the "Realtime" report in the menu
- Visit your own website in another browser tab
- Within 30 seconds an active user should be visible in the Realtime report
Do you see yourself? Congratulations, tracking works! Do you see nothing? Check whether the code was placed correctly.
Step 4: configuring events and conversions
GA4 is event-based. Everything is an event: pageviews, clicks, form submits, purchases. When setting up Google Analytics you want to mark important events as conversions.
Automatic events (enhanced measurement)
If you enabled "Enhanced measurement" (with the data stream), these events are recorded automatically:
- page_view: a pageview
- scroll: the user scrolls 90% of the page
- click: a click on an outbound link
- view_search_results: site search used
- video_start, video_progress, video_complete: YouTube video interactions
- file_download: PDF, ZIP, etc. downloaded
Setting up custom events
For actions such as "form submitted" or "button clicked" you have to create custom events. You do this through Google Tag Manager:
- Create a new trigger in GTM (for example "Form Submit")
- Create a GA4 Event tag with the event name "form_submission"
- Add parameters (e.g. form_name)
- Publish
Marking conversions
Conversions are important events (purchase, lead, sign-up). Mark events as a conversion:
- In GA4 go to "Configure" → "Events"
- Do you see your event (e.g. "form_submission")? Click "Mark as conversion"
- Do you not see the event yet? Wait until it has been recorded at least once (this can take 24 hours)
Conversions appear in the "Acquisition" → "Traffic acquisition" report and show which channels deliver conversions.
Step 5: linking Google Search Console
Link Google Search Console for SEO data in your Analytics. This shows which keywords you rank for and how many clicks you get from Google.
Search Console linking
- In GA4 go to "Admin" (gear icon at the bottom left)
- Under "Property" click "Search Console links"
- Click "Link"
- Choose your Search Console property (if you have already set up Search Console)
- Confirm the link
After 24-48 hours you see Search Console data in the "Acquisition" → "Search Console" report. Here you see:
- Which keywords generate traffic
- Impressions and clicks per keyword
- Click-through rate (CTR)
- Average position in Google
This is worth gold for your SEO strategy. Also see our article on becoming more findable in Google for more SEO tips. You can also use the free SEO check tool to analyse your website.
Step 6: privacy and GDPR compliance
When setting up Google Analytics in Europe, you have to take GDPR legislation into account. Visitor privacy is important.
Cookie notice and consent
Google Analytics uses cookies to recognise users. Under the GDPR you have to:
- Ask for consent: visitors must actively agree before tracking cookies are placed
- Inform clearly: explain which cookies you use and why
- Provide an opt-out: visitors must be able to refuse tracking
Implementing a cookie banner
Use a cookie banner plugin or service:
For WordPress:
- Complianz (free/premium) - a GDPR-proof cookie banner with GA4 integration
- CookieYes - a user-friendly solution
Standalone services:
- Cookiebot (€9-€49/month)
- OneTrust (enterprise)
Make sure Google Analytics only starts tracking AFTER consent. With GTM you do this through consent mode.
Google Consent Mode
Consent Mode is Google's way to adjust tracking based on consent:
- Refusal: only anonymous, aggregated data without cookies
- Consent: full tracking with cookies
Implement this through your cookie banner plugin (Complianz supports this) or GTM.
IP anonymisation
GA4 anonymises IP addresses by default, so you do not have to set this manually (it was necessary with Universal Analytics).
Setting the data retention period
By default GA4 keeps user data for 2 months. For GDPR compliance you can adjust this:
- Go to "Admin" → "Data settings" → "Data retention"
- Choose a retention period (2 months recommended for privacy)
- Note: aggregated reports keep all data; only user-level data is limited
Step 7: understanding the important reports
After setting up Google Analytics you naturally want to see and interpret data. GA4 has several standard reports.
Realtime report
Shows what is happening on your website RIGHT NOW:
- Number of active users (last 30 minutes)
- Which pages are being viewed
- Traffic source (location, channel)
- Events that are taking place
Use this to monitor campaigns live or to check whether everything works after website updates.
Acquisition reports
Show where your visitors come from:
User acquisition: the first channel through which NEW users found your site (Organic Search, Direct, Social, Paid Search, etc.)
Traffic acquisition: the channel of all sessions (including returning visitors)
Valuable for seeing which marketing channels work. Organic traffic (SEO) is often the most valuable in the long term.
Engagement reports
Pages and screens: which pages get the most views and engagement?
Events: an overview of all events (pageviews, clicks, conversions)
Conversions: how many conversions per event type
Use this to identify popular content and find low-hanging fruit (many views but low conversion = an optimisation opportunity).
Demographics and technology
Insight into your audience:
- Demographics: age, gender, interests (requires activating Google signals)
- Technology: browser, OS, device (desktop/mobile/tablet), screen resolution
Do you see a lot of mobile traffic? Optimise your mobile experience. Do you see many Safari users? Test your website in Safari.
Audience reporting
GA4 automatically creates audiences:
- All users
- Purchasers (who bought something)
- Engaged users
You can create custom audiences (e.g. "Visitors who read the blog but do not convert") for remarketing.
Step 8: monitoring goals and conversions
The whole point of setting up Google Analytics is to measure conversions. Let's dive into this more deeply.
E-commerce tracking (web shops)
For web shops, e-commerce tracking is crucial. This requires extra code to send transaction data to GA4.
For WooCommerce you use a plugin such as:
- Site Kit by Google: has automatic e-commerce tracking
- GTM4WP: enhanced e-commerce through Google Tag Manager
E-commerce tracking gives insight into:
- Revenue per product
- Conversion rate
- Average order value
- Shopping cart abandonment rate
Lead generation tracking
For websites without a web shop, leads are the conversion (contact form, quote request, newsletter sign-up).
Set up a "form_submit" event (through GTM) and mark it as a conversion. Measure how many forms are filled in and which channels deliver the most leads.
Custom conversion goals
Other conversions can be:
- Time on site > 3 minutes (engaged visitor)
- At least 3 pages viewed
- Video played in full
- Whitepaper downloaded
Create events for these actions and mark them as a conversion. That way you build a complete picture of user behaviour.
Frequently asked questions about setting up Google Analytics
How long does it take before I see data after setting up Google Analytics?
You see realtime data within a few minutes in the Realtime report. Standard reports (Acquisition, Engagement) are populated within 24-48 hours. Some advanced reports (such as demographics) can take up to 7 days before they have enough data to be reliable. Be patient and check after a day whether data is coming in.
Do I have to remove Universal Analytics after setting up Google Analytics?
Yes, since 1 July 2023 Universal Analytics no longer collects data. You can remove the old UA tracking code. Note: historical data remains available in your UA property for at least 6 months, so export important reports before Google removes them. Focus entirely on GA4 for new tracking.
Is Google Analytics free or are there costs?
Google Analytics 4 is completely free for most websites. There is an enterprise version (Analytics 360) that costs €150,000/year, but that is only needed for very large organisations with more than 10 million hits per month. For 99% of websites, including large web shops, the free version is more than enough.
Can I set up Google Analytics without technical knowledge?
Yes, with WordPress plugins such as Site Kit by Google you can set up Google Analytics without touching any code. The plugin connects to your Google account and automatically places the tracking code. For custom websites without a CMS you do need basic HTML knowledge to place code in the header, or you can ask a web developer to do this (usually 1-2 hours of work).
How do I know whether Google Analytics is working correctly after installation?
Test this with the Realtime report. Go to your GA4 property → Realtime and visit your website in another browser tab. Within 30 seconds an active user (you) should be visible. Click around on your site and check whether pageviews are recorded. You can also use the browser extension "Google Analytics Debugger" to verify that events are sent correctly.
Conclusion: ready to make data-driven decisions
Congratulations! You now know how to approach setting up Google Analytics from A to Z. From creating an account to placing the tracking code, configuring events, linking Search Console and interpreting reports, you have gone through the complete process.
The most important steps to remember when setting up Google Analytics:
- Create a GA4 account and property
- Add a web data stream and get your Measurement ID
- Place the tracking code through GTM, a WordPress plugin or manually
- Configure conversion events for your most important goals
- Link Google Search Console for SEO insights
- Implement cookie consent for GDPR compliance
- Monitor and optimise based on reporting
Google Analytics is an indispensable tool for website success. It gives you objective data about what works and what does not. Use these insights to improve your website, marketing and content strategies.
Start setting up Google Analytics today and discover what your visitors really do on your website. Working data-driven is the future, and with GA4 you have all the tools you need.
Do you want to learn more about website optimisation? Take a look at our articles on building professional websites and keep improving your website based on real user data.