Tutorial 2026-08-10 9 min read

Google Analytics 4 Setup Guide for Marketers (2026)

If you do not have Google Analytics 4 installed on your website, you are flying blind. You do not know where your visitors come from, what pages they read, or where they drop off. For affiliate marketers, this means you cannot optimize for conversions because you cannot measure them.

This guide walks through the complete GA4 setup process — from creating an account to building your first conversion dashboard. No coding experience required. Total setup time: 30 minutes.

Quick answer: how do I set up GA4?

Create a GA4 property at analytics.google.com, add a data stream for your website, install the tracking code (via Google Tag Manager or directly in your site <head>), configure key events as conversions, and build a dashboard. The entire process takes 30 minutes and is completely free.

Step 1: Create a GA4 property

Go to analytics.google.com and create a new GA4 property:

  1. Go to analytics.google.com and sign in with your Google account — Go to analytics.google.com and sign in with your Google account
  2. Click Admin (gear icon) > Create > Property — Click Admin (gear icon) > Create > Property
  3. Enter property name (your website name), timezone, and currency — Enter property name (your website name), timezone, and currency
  4. Select your industry category and business size — Select your industry category and business size
  5. Select "Web" as your platform — Select "Web" as your platform
  6. Enter your website URL (e.g., https//aifordigitalmarketing.com)
  7. Name your data stream (e.g., "Website — Production") — Name your data stream (e.g., "Website — Production")
  8. Copy your Measurement ID (starts with G-XXXXXXXXXX) — Copy your Measurement ID (starts with G-XXXXXXXXXX)

Step 2: Install the tracking code

Two options for installation:

  • Option A — Google Tag Manager (recommended): Create a GTM container, add a GA4 Configuration tag with your Measurement ID, set the trigger to All Pages, publish. This gives you flexibility to add other tags later (Meta Pixel, Clarity, etc.).
  • Option B — Direct install: Add the GA4 script tag to your site <head>. For Next.js sites, add it to the layout.tsx file. Simpler but less flexible.
  • For Next.js: Install @next/third-parties package and add GoogleAnalytics component to your layout. One line of code.
  • Verify installation: Open your website, go to GA4 > Reports > Realtime, you should see at least 1 active user (you).

Use Google Tag Manager even if you only have GA4 right now. GTM makes it trivial to add Microsoft Clarity, Meta Pixel, TikTok Pixel, and other tracking tags later — without touching your code again.

Step 3: Configure key events (conversions)

GA4 tracks page views automatically. But you need to configure custom events for affiliate clicks, email signups, and other conversions:

  • Affiliate link clicks: Create a custom event when users click /go/* links. In GTM, set up a Click trigger for links containing "/go/", and send a GA4 event named "affiliate_click" with the link slug as a parameter.
  • Email signups: Send a "newsletter_signup" event when users submit your email form.
  • Scroll depth: GA4 tracks scroll depth automatically at 25%, 50%, 75%, 90%. No setup needed.
  • Outbound clicks: GA4 tracks outbound link clicks automatically. Check Events > click in GA4.
  • Mark as conversion: In GA4 > Admin > Events, toggle "Mark as conversion" for your key events (affiliate_click, newsletter_signup).

Step 4: Set up conversion tracking

Once you have key events marked as conversions, set up conversion tracking:

  • Go to Admin > Conversions — your marked events appear here automatically.
  • Set a conversion window: Default is 7 days. Change to 30 days for affiliate marketing (longer decision cycle).
  • Create a conversion dashboard: Go to Library > Create new report. Add: total conversions, conversion rate, conversions by source/medium, conversions by landing page.
  • Set up alerts: Admin > Insights > Create insight. Alert when conversion rate drops by 20%+ week-over-week.

Step 5: Build your marketing dashboard

Create a custom dashboard with the 7 metrics that matter for affiliate marketing:

  • Total visitors: Users metric, last 30 days, compared to previous 30 days.
  • Traffic sources: Source/medium dimension, sessions metric. Identifies which channels drive traffic.
  • Top landing pages: Page path dimension, sessions metric. Shows which pages attract visitors.
  • Conversion rate: Conversions / sessions × 100. The #1 metric for affiliate sites.
  • Top converting pages: Page path dimension, conversion rate metric. Shows which pages actually convert.
  • Affiliate clicks: Custom event "affiliate_click", count by link slug. Shows which tools get clicked most.
  • Revenue attribution: If you connect your affiliate network data, attribute revenue to traffic sources.

Check your GA4 dashboard weekly. Look for: which traffic source converts best (double down), which pages have high traffic but low conversion (optimize CTA), and which affiliate links get clicked most (promote those tools more).

Common GA4 mistakes to avoid

These mistakes ruin your data quality:

  • Not filtering internal traffic: Your own visits inflate numbers. Go to Admin > Data Streams > Configure filter settings > Exclude your IP address.
  • Not setting up cross-domain tracking: If you have multiple domains, set up cross-domain measurement to track users across sites.
  • Not testing events: Use GA4 DebugView (Admin > DebugView) to verify events fire correctly before relying on the data.
  • Ignoring data retention: Default is 2 months. Change to 14 months in Admin > Data Collection and Modification > Data Retention.
  • Not using UTM parameters: Tag every external link with UTM parameters so GA4 attributes traffic correctly.

GA4 is non-negotiable for affiliate marketers. Without it, you cannot measure conversions, identify your best traffic sources, or optimize your site. Setup takes 30 minutes: create a property, install via GTM, configure key events as conversions, and build a dashboard with 7 core metrics.

Check your dashboard weekly. Focus on conversion rate by traffic source and top converting pages. Filter internal traffic, set data retention to 14 months, and use DebugView to test events. Pair GA4 with Microsoft Clarity (free heatmaps + session replay) for the complete analytics stack.

FAQ

How do I set up Google Analytics 4?

Create a GA4 property at analytics.google.com, add a web data stream with your URL, install the tracking code via Google Tag Manager or directly in your site head, configure key events as conversions, and build a dashboard. Total setup time: 30 minutes.

Is Google Analytics 4 free?

Yes, GA4 is completely free. There are no usage limits for standard properties. You get unlimited events, users, and reports. Premium features (Google Analytics 360) cost $150K/year but are unnecessary for 99% of marketers.

How do I track affiliate link clicks in GA4?

In Google Tag Manager, create a Click trigger for links containing "/go/", then send a GA4 event named "affiliate_click" with the link slug as a parameter. In GA4 Admin > Events, mark "affiliate_click" as a conversion. This tracks every affiliate click as a conversion.

Should I use Google Tag Manager or install GA4 directly?

Use Google Tag Manager. It makes it trivial to add Microsoft Clarity, Meta Pixel, TikTok Pixel, and other tracking tags later without touching your code. GTM also provides better debugging tools and tag firing control.

How often should I check GA4?

Check your GA4 dashboard weekly — 15 minutes. Focus on: total visitors, traffic sources, conversion rate, top converting pages, and affiliate clicks. Set up automated alerts for conversion rate drops of 20%+ so you catch issues before they become disasters.

Keep reading