Digital Marketing

How to Set Up Google Analytics 4: A Step-by-Step Guide

GA4 is the most important website tracking tool. Learn how to set it up correctly in under an hour.

Edin HalilovicEdin Halilovic
30 April 20268 min read
H

How to Set Up Google Analytics 4: A Step-by-Step Guide

Google Analytics 4 (GA4) is the most important tool every website owner and online store needs set up correctly. Without reliable data about who visits your site, where they come from, and what they do, you're making marketing decisions in the dark. This guide walks you through the entire GA4 setup process — from creating an account to understanding your first reports — step by step.

Why GA4 Is Different from Universal Analytics

If you used the old Google Analytics (Universal Analytics), GA4 will feel completely different at first. And it is. While UA was session and pageview-based, GA4 is built around events. Every user interaction — a click, scroll, video view, or purchase — is treated as an event. This gives you far more detailed insight into user behavior.

Another key difference is that GA4 uses machine learning to fill data gaps, especially in the context of increasingly strict privacy laws and cookie blockers. GA4 also natively supports both web and mobile apps in a single property, which is especially useful for e-commerce businesses with both an app and a web store.

Step 1: Create Your GA4 Account and Property

Go to analytics.google.com and sign in with your business Google account. Click "Admin" (the gear icon in the bottom left), then "Create Account." Enter your account name (e.g., your company name), choose your data sharing settings, and click "Next."

In the next step, you create a "Property" — this is your actual GA4 tracker. Enter a property name, select your time zone and currency, then choose the business type and goals that match your industry. At the end, you'll receive a "Measurement ID" that looks like this: G-XXXXXXXXXX. You'll need this ID for the next step.

Step 2: Install the Tracking Code on Your Website

There are two ways to install the GA4 code: directly in your HTML or via Google Tag Manager (GTM). For beginners, direct installation is simpler, but GTM is recommended for long-term tag management.

Direct installation: Copy the Global Site Tag (gtag.js) that GA4 generates and paste it into the <head> section of every page on your site, immediately after the opening <head> tag. If you use WordPress, you can use the "Site Kit by Google" plugin, which automatically installs the code.

Via Google Tag Manager: Create a GTM account, add the GTM snippet to your site, then in GTM create a new tag of type "Google Analytics: GA4 Configuration," enter your Measurement ID, and set the trigger to "All Pages." Publish the changes and GA4 starts collecting data.

Step 3: Set Up Conversions and Key Events

Simply installing the code isn't enough — you need to define what "success" looks like for your business. In GA4 terminology, these are Conversions. Go to Admin → Events and you'll see a list of automatically collected events. GA4 automatically tracks: page_view, session_start, first_visit, scroll, click, and file_download.

For e-commerce, the most important events are purchase, add_to_cart, begin_checkout, and view_item. If you use WooCommerce or Shopify, there are ready-made plugins and integrations that automatically send these events. For other goals (e.g., contact form submissions), you'll need to create events manually or use GTM.

To mark an event as a conversion, go to Admin → Events, find the desired event, and enable the "Mark as conversion" toggle. That event will now be tracked as a conversion across all reports.

Step 4: Understanding the Main Reports

GA4 has a different report structure from UA. Here are the most important ones:

Reports → Acquisition → Traffic acquisition — shows where your visitors come from (Google Organic, Direct, Social, Email, Paid Search, etc.). This is your starting point for understanding which channels are working.

Reports → Engagement → Pages and screens — shows which pages visitors view most often, how long they spend on them, and the engagement rate. Engagement rate is a new GA4 metric that replaces bounce rate — it measures the percentage of sessions with meaningful interaction.

Reports → Monetization (for e-commerce) — shows revenue, number of transactions, average order value, and the purchase funnel.

The Explore section is the most powerful part of GA4 — here you can create custom reports, funnel analyses, and segment comparisons that give you deeper insights than standard reports.

Step 5: Common Mistakes to Avoid

The first and most common mistake is double tracking — installing the GA4 code directly AND via GTM at the same time. This results in duplicated data that is completely useless. Always use only one installation method.

The second mistake is not filtering internal traffic. If your employees or you yourself regularly visit the site, that data pollutes your analytics. Go to Admin → Data Streams → Configure tag settings → Define internal traffic and add the IP addresses to exclude.

The third mistake is ignoring Data Retention settings. GA4 stores data for only 2 months by default. Go to Admin → Data Settings → Data Retention and change it to 14 months so you have year-over-year comparisons.

Action Plan: 5 Steps for Today

  1. Create a GA4 account and property at analytics.google.com (10 minutes)
  2. Install the tracking code via GTM or directly in <head> (15 minutes)
  3. Verify data is coming in via the Real-time report (immediately)
  4. Mark your most important events as conversions (purchase, contact_form_submit) (10 minutes)
  5. Set Data Retention to 14 months and filter internal traffic (5 minutes)

A properly configured GA4 is the foundation of every successful digital marketing strategy. Without reliable data, every euro invested in advertising is a shot in the dark.

Ready to fix this in your business?

Book a free 30-minute strategy call. We'll review your current situation and identify the biggest growth opportunities — no strings attached.

No commitment. Just a conversation.
Edin Halilovic

Written by

Edin Halilovic

Digital marketing expert with 15+ years of experience in SEO, e-commerce, and web development. Helping businesses grow across Europe and the MENA region.

Read Full Bio →