0Pricing
Digital Marketing Academy · Lesson

Setting Up Google Analytics 4

Install GA4, configure data streams, and verify your setup is tracking correctly.

Setting Up Google Analytics 4 is a free Digital Marketing Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Digital Marketing Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

GA4 vs Universal Analytics

Universal Analytics (UA) measured website activity in sessions and pageviews. Google Analytics 4 replaced it in 2023 with an event-based model that tracks every user interaction as an event, providing a more flexible and privacy-resilient framework that works across websites and mobile apps in a single property.

Creating a GA4 Property

To create a GA4 property, go to Google Analytics, click Admin, then Create Property. Enter your property name, reporting time zone, and currency. GA4 creates a default web data stream — you will use the Measurement ID from this stream to install the tracking code on your website.

Installing GA4 via gtag.js or GTM

You can install GA4 directly by pasting the gtag.js snippet into the head section of every page on your website, or through Google Tag Manager (GTM) by creating a GA4 Configuration tag. GTM is preferred for most sites because it centralizes all tracking tags and lets marketers make updates without touching code.

Configuring Data Streams

A data stream is a source of data flowing into your GA4 property — typically a website, an iOS app, or an Android app. Each stream has its own Measurement ID. If you have both a website and a mobile app, configure separate streams for each so you can analyze cross-platform behavior in a unified property.

Enhanced Measurement Events

GA4 automatically tracks common interactions through enhanced measurement: page views, scrolls (90% scroll depth), outbound link clicks, site search queries, video engagement, and file downloads — all without additional code. Verify these settings in Admin under Data Streams to ensure the events you need are enabled.

Checking the Real-Time Report

After installing GA4, immediately open the Real-Time report to verify data is flowing correctly. You should see your own visit appear within seconds. If nothing appears after five minutes of active browsing, recheck that the Measurement ID in your tag matches the ID in the GA4 property exactly.

Data Retention Settings

By default, GA4 retains event-level data for only two months. Change this to 14 months immediately after creating your property by going to Admin, then Data Settings, then Data Retention. Longer retention is essential for year-over-year comparisons in your Exploration reports.

Linking GA4 to Google Search Console

Connecting GA4 to Google Search Console surfaces organic search performance data — queries, impressions, clicks, and average position — directly inside GA4 reports. This connection is made in Admin under Product Links and requires you to be a verified owner in Search Console for the same domain.

Linking GA4 to Google Ads

Linking GA4 to Google Ads allows you to import GA4 key events (conversions) directly into Google Ads for campaign optimization, and enables GA4 audiences to be used for Google Ads remarketing. The link is created in Admin under Product Links by a user who has admin access to both accounts.

User Roles and Access Management

GA4 has four roles: Viewer, Analyst, Editor, and Administrator. Assign roles at the property or account level in Admin under Account or Property Access Management. Follow the principle of least privilege — most team members need only Analyst access, while Editor access should be reserved for those who configure settings.

Internal Traffic Filters

Your own team's visits to the website will inflate traffic numbers and skew engagement metrics if not filtered out. Create an internal traffic rule in GA4 Admin by specifying your office IP addresses, then activate a Data Filter to exclude those sessions from your reports. This ensures your analytics data reflects genuine visitor behavior only.

GA4 Setup Check

Test your understanding of Google Analytics 4 setup essentials.

GA4 Setup Recap

Setting up GA4 correctly requires creating a property with the right time zone, installing tracking via gtag.js or GTM, configuring data streams for web and app, enabling enhanced measurement, verifying in Real-Time, extending data retention to 14 months, linking Google Search Console and Google Ads, configuring user roles with least-privilege access, and filtering out internal team traffic so your reports reflect genuine visitor behavior.

Frequently asked questions

Is the “Setting Up Google Analytics 4” lesson free?

Yes — the full text of “Setting Up Google Analytics 4” is free to read here on the web, and the Digital Marketing Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Digital Marketing Academy course, upgrade to CoddyKit PRO.

What will I learn in “Setting Up Google Analytics 4”?

Install GA4, configure data streams, and verify your setup is tracking correctly. You practise Digital Marketing Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Digital Marketing Academy?

No prior experience is required. Digital Marketing Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Setting Up Google Analytics 4” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Digital Marketing Academy lesson?

Yes. Every Digital Marketing Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Setting Up Google Analytics 4
  2. Understanding Traffic Sources
  3. Conversion Tracking and Goals
  4. Custom Reports and Dashboards
← Back to Digital Marketing Academy