Mumbai, India
Guide

How to Set Up Google Analytics 4: Complete Guide for 2026

Step-by-step guide to setting up GA4 from scratch. Covers property creation, tracking code installation (gtag.js and GTM), data streams, key events, enhanced measurement, audience creation, Google Ads linking, BigQuery export, and data retention configuration.

Last updated: March 2026 · Reading time: 18 min

Setting up Google Analytics 4 means creating a GA4 property, installing a tracking code on your website, configuring data streams, and enabling the features that turn raw data into actionable reporting. The process takes 30-60 minutes for a basic setup, or 2-4 hours if you configure key events, audience segments, Google Ads linking, and BigQuery export. GA4 is the only version of Google Analytics available since July 2023, when Universal Analytics stopped processing data. As of 2026, GA4 has added generated insights on the home page, an AI-powered Analytics Advisor, new audience templates for high-value and disengaged purchasers, and per-conversion attribution settings.
“I still audit GA4 properties where the team installed the tag 18 months ago and never touched it again. They’re collecting page views and sessions but have zero custom events, no audiences built, no Google Ads link, and data retention set to the 2-month default. That’s not analytics. That’s a counting machine. Proper GA4 setup takes half a day. The data it gives you back is worth thousands.” Hardik Shah, Founder of ScaleGrowth.Digital

What’s in this guide

  1. How do you create a GA4 property?
  2. How do you install the GA4 tracking code?
  3. How do you configure data streams?
  4. What enhanced measurement settings should you enable?
  5. How do you set up key events (conversions)?
  6. How do you create audiences in GA4?
  7. How do you link GA4 to Google Ads and other tools?
  8. How do you set up BigQuery export?
  9. How do you configure data retention and privacy settings?
  10. How do you verify your GA4 setup is working?
  11. Pro tips for GA4 configuration
  12. Common GA4 setup mistakes

How do you create a GA4 property?

A GA4 property is the container that holds all your website or app data. Creating one takes about 5 minutes. Here’s the process:
  1. Go to analytics.google.com and sign in with your Google account.
  2. Click the gear icon (Admin) in the bottom-left corner.
  3. In the Account column, select your account (or create a new one if this is your first time).
  4. Click “Create Property” at the top of the Property column.
  5. Enter your property name (typically your website or business name).
  6. Set your reporting time zone and currency. These affect how dates display in reports and how revenue metrics are calculated. Set them correctly now; changing them later causes data inconsistencies.
  7. Answer the business details questions: industry category, business size, and how you intend to use GA4. These inform which pre-built reports and suggestions GA4 offers you.
  8. Accept the terms of service.
Your property now exists, but it’s not collecting data yet. You need to create a data stream and install the tracking code, which we’ll cover in the next two sections. One important decision: your Measurement ID. Once you create a web data stream, you’ll get a Measurement ID that starts with “G-” (like G-XXXXXXXXXX). This is the identifier you’ll use in your tracking code. Write it down or copy it somewhere accessible. You’ll reference it throughout the setup process.

How do you install the GA4 tracking code?

There are three ways to install GA4 on your website: directly via gtag.js, through Google Tag Manager (GTM), or using a CMS plugin. GTM is the recommended approach for most marketing teams because it gives you the most flexibility for adding events, managing tags, and updating tracking without touching your website’s code.
gtag.js is Google’s JavaScript tagging framework that sends data directly to GA4. It requires adding a code snippet to every page of your site, typically in the <head> section.
Option 1: Google Tag Manager (recommended)
  1. Create a GTM account and container at tagmanager.google.com if you don’t have one.
  2. Install the GTM container snippet on your website (two code snippets: one in the <head> and one after the opening <body> tag).
  3. In GTM, create a new tag: select “Google Analytics: GA4 Configuration” as the tag type.
  4. Enter your Measurement ID (the G-XXXXXXXXXX from your data stream).
  5. Set the trigger to “All Pages.”
  6. Save, then click “Submit” to publish the container.
Option 2: Direct gtag.js installation Copy the gtag.js snippet from your GA4 data stream settings (Admin > Data Streams > your stream > “View tag instructions”). Paste it into the <head> section of every page on your site. This approach works but makes future event tracking harder because every change requires a code deployment. Option 3: CMS plugin WordPress users can install GA4 through plugins like Site Kit by Google (official Google plugin), MonsterInsights, or by pasting the tracking code into their theme’s header. Shopify, Squarespace, Wix, and other platforms have built-in GA4 integration where you just paste your Measurement ID into the settings. Whichever method you choose, verify the installation immediately using GA4’s Realtime report or DebugView (covered in the verification section below).

How do you configure data streams?

A data stream is the connection between your website (or app) and your GA4 property. Each property can have multiple data streams, but most websites need just one web data stream. If you also have an iOS app and an Android app, you’d add those as separate streams. To create a web data stream:
  1. Go to Admin > Data Streams.
  2. Click “Add stream” and select “Web.”
  3. Enter your website URL and stream name.
  4. Enhanced measurement will be turned on by default (we’ll configure this in the next section).
  5. Click “Create stream.”
Your data stream settings page shows your Measurement ID and several important configuration options:
  • Enhanced measurement: Toggle individual event types on or off (covered next).
  • Tagging settings: Configure cross-domain measurement if your users navigate between multiple domains (e.g., your main site and a separate checkout subdomain).
  • Configure your domains: List all domains that should be treated as the same site. Without this, users navigating from blog.yourdomain.com to shop.yourdomain.com would be counted as separate sessions with referral traffic.
Cross-domain tracking is one of the most commonly missed configurations. If your site spans multiple domains or subdomains, set this up now. Without it, your traffic data will be fragmented and inaccurate.

What enhanced measurement settings should you enable?

Enhanced measurement events are pre-built interaction trackers that GA4 handles automatically. No code changes or GTM tags needed. You toggle them on in your data stream settings. All enhanced measurement events are enabled by default when you create a data stream, but you should review each one to ensure they match your needs.
Event What It Tracks Recommendation
Page views Every page load and browser history change (SPA support) Always on
Scrolls When user scrolls past 90% of page height On (but consider custom scroll tracking at 25/50/75% via GTM for more granular data)
Outbound clicks Clicks on links leading to external domains Always on
Site search When users search within your site On if you have site search. Verify the query parameter matches your search URL structure.
Video engagement YouTube embedded video starts, progress (10%, 25%, 50%, 75%), and completions On if you use YouTube embeds. Doesn’t track Vimeo or self-hosted video.
File downloads Clicks on links to files (.pdf, .xlsx, .docx, .zip, etc.) Always on
Form interactions Form starts and submissions On, but verify it works with your form setup. Some forms (AJAX-based) may not trigger correctly.
Enhanced measurement gives you a solid baseline, but it won’t capture everything your business needs. For lead forms, purchases, sign-ups, and other business-specific interactions, you’ll need custom event tracking. Our GA4 event tracking guide covers the full implementation process.

How do you set up key events (conversions)?

In GA4, a “key event” (previously called a “conversion”) is any event you’ve marked as important to your business. You can mark up to 30 events as key events per property. This is where you tell GA4 which user actions actually matter for your bottom line.
Key event is a GA4 event that you’ve flagged as a significant business outcome, such as a form submission, purchase, or sign-up. Key events appear in dedicated reports and can be imported into Google Ads for campaign optimization.
To mark an event as a key event:
  1. Go to Admin > Events (under Data display).
  2. Find the event you want to mark. If it’s already firing (from enhanced measurement or custom setup), it’ll appear in the list.
  3. Toggle “Mark as key event” to on.
For most business websites, these are the events you should mark as key events:
  • generate_lead: Form submissions (contact forms, demo requests, quote requests)
  • sign_up: Account creation or newsletter sign-up
  • purchase: Completed transaction (ecommerce)
  • begin_checkout: Cart-to-checkout transition (ecommerce)
  • file_download: If downloads are a business goal (lead magnets, whitepapers)
  • phone_call: Click-to-call actions (if you track phone leads)
If the event you want to mark doesn’t exist yet, you’ll need to create it first. You can create events in GA4 Admin (Admin > Events > Create event) based on conditions applied to existing events, or implement custom events through GTM. The GA4 Admin method works for simple modifications (e.g., “fire a new event when page_view happens and page_location contains /thank-you”). GTM is better for events that require specific triggers like button clicks or form submissions. As of early 2026, GA4 now lets you adjust conversion attribution settings independently for each key event, meaning you can use different attribution models for different conversion types (Google Analytics, 2026).

How do you create audiences in GA4?

Audiences in GA4 are groups of users defined by conditions you set. Once created, audiences can be used in reports for comparison, exported to Google Ads for remarketing, or monitored for growth trends. GA4 offers suggested audience templates plus the ability to build custom audiences from scratch. To create an audience:
  1. Go to Admin > Audiences.
  2. Click “New audience.”
  3. Choose from a template or click “Create a custom audience.”
  4. Set your conditions using dimensions, metrics, and event data.
  5. Set the membership duration (how long a user stays in the audience after meeting the conditions).
  6. Name the audience and save.
Audiences worth creating for most marketing teams:
  • Engaged users: Users who viewed 3+ pages in a session or spent 2+ minutes on site
  • Converters: Users who completed any key event in the last 30 days
  • Blog readers: Users who visited blog pages but haven’t converted
  • Cart abandoners: Users who added to cart but didn’t purchase (ecommerce)
  • Returning visitors: Users with 2+ sessions in the last 30 days
New in 2026: GA4 introduced two pre-built audience templates. “High-Value Purchasers” segments users based on purchase count or lifetime value. “Disengaged Purchasers” identifies past buyers who haven’t returned, based on days since last purchase. Both can be exported directly to Google Ads for acquisition and retention campaigns (Google Analytics, January 2026).

How do you link GA4 to Google Ads and other tools?

Linking GA4 to your other Google products unlocks features that don’t work in isolation. The most valuable integration is Google Ads, but GA4 also connects to Search Console, BigQuery, Firebase, and Merchant Center. Google Ads linking:
  1. Go to Admin > Product links > Google Ads links.
  2. Click “Link” and select your Google Ads account.
  3. Enable auto-tagging (this adds the gclid parameter to your ad URLs).
  4. Enable personalized advertising if you want to use GA4 audiences in Google Ads.
  5. Click “Submit.”
Once linked, you can:
  • Import GA4 key events as Google Ads conversions for campaign optimization
  • Export GA4 audiences to Google Ads for remarketing
  • See Google Ads campaign data in GA4 reports (cost, clicks, impressions alongside site behavior)
  • Use GA4’s cross-channel attribution to understand how ads work with organic channels
Google Search Console linking: Go to Admin > Product links > Search Console links. Link your verified Search Console property. This adds organic search queries, impressions, clicks, and average position data to your GA4 reports under Acquisition > Search Console. It’s one of the few ways to see search query data alongside on-site behavior data in a single report. New 2026 feature: The Conversion attribution analysis report in the Advertising workspace lets you see the full path across channels, including assisted conversions that reveal undervalued upper-funnel channels. This report only works when Google Ads and Search Console are linked (Google Analytics, 2026).

How do you set up BigQuery export?

BigQuery export sends your raw GA4 event data to Google BigQuery, Google’s cloud data warehouse. This is one of the most powerful features in GA4 and it’s free for standard GA4 properties (you only pay for BigQuery storage and query costs, which are minimal for most sites). Why BigQuery export matters: GA4’s interface limits you to standard reports and explorations. BigQuery gives you access to every single event, parameter, and user property at the raw data level. You can run SQL queries to answer questions that GA4’s UI can’t, combine GA4 data with CRM or advertising data, and build custom dashboards in Looker Studio or other BI tools. Setup steps:
  1. Create a Google Cloud project at console.cloud.google.com if you don’t have one.
  2. Enable the BigQuery API in your Google Cloud project.
  3. In GA4, go to Admin > Product links > BigQuery links.
  4. Click “Link” and select your Google Cloud project.
  5. Choose your data location (select a region close to your users for faster queries).
  6. Choose export frequency: “Daily” exports a full table once per day. “Streaming” exports events in near-real-time (within minutes). Start with daily; streaming costs more.
  7. Select which events to export (all events or specific ones).
  8. Click “Submit.”
Data starts flowing to BigQuery within 24 hours. The daily export creates a new table each day named events_YYYYMMDD. Each row in the table represents one event with all its parameters, user properties, and session context. BigQuery storage costs are roughly $0.02 per GB per month. A site with 100,000 monthly sessions typically generates 1-5 GB of data per month, costing $0.02-$0.10 in storage. Query costs are $5 per TB scanned, but most marketing queries scan under 1 GB. For practical purposes, BigQuery export is free or near-free for small to mid-size sites.

How do you configure data retention and privacy settings?

GA4’s default data retention period is 2 months for event data. This is far too short for most businesses. Change it to 14 months immediately after setup. This setting affects how long event-level data is available in Explorations (custom reports). Standard reports are not affected by data retention settings because they use aggregated data. To change data retention:
  1. Go to Admin > Data Settings > Data Retention.
  2. Change “Event data retention” from 2 months to 14 months.
  3. Toggle “Reset user data on new activity” to ON. This extends the retention period for returning users.
  4. Click “Save.”
Privacy and consent settings to configure: Google Signals: Go to Admin > Data Settings > Data Collection. Enable Google Signals if you want cross-device reporting and remarketing audiences. Be aware that enabling Signals applies thresholding to reports with small user counts to protect anonymity, which can cause data to appear missing in low-traffic reports. Internal traffic filtering: Go to Admin > Data Streams > your stream > Configure tag settings > Define internal traffic. Add your office IP addresses. Then go to Admin > Data Settings > Data Filters and activate the internal traffic filter. Without this, your own team’s visits will inflate your traffic data. This is one of the most commonly skipped steps. Consent Mode: If you serve users in the EU or other privacy-regulated regions, implement Google Consent Mode v2. This sends consent signals (ad_storage, analytics_storage, ad_user_data, ad_personalization) to GA4 based on your cookie consent banner. GA4 uses behavioral modeling to estimate metrics for users who decline analytics cookies, based on the behavior of similar users who consent (Google, 2025). Unwanted referral filtering: Go to Admin > Data Streams > your stream > Configure tag settings > List unwanted referrals. Add payment gateways (PayPal, Stripe) and any third-party domains that redirect users back to your site. Without this filter, returning users from payment processors show up as “referral” traffic instead of being attributed to their original source.

How do you verify your GA4 setup is working?

Never assume your tracking is working just because you installed the code. Verify every aspect of your setup using these three methods: Method 1: Realtime report Go to Reports > Realtime in GA4. Visit your website in another browser tab. You should see yourself appear as an active user within 30 seconds. Check that page views, events, and conversions are registering. This is the quickest sanity check but only confirms basic data flow. Method 2: DebugView DebugView shows you every event as it fires, with all its parameters, in real-time. To enable it: Then go to Admin > DebugView in GA4. Browse your site and watch events appear in the timeline. Click on any event to inspect its parameters. This is how you verify that custom events are firing with the correct parameter names and values. Method 3: Tag Assistant Visit tagassistant.google.com and enter your website URL. Tag Assistant will load your site and show you all Google tags firing on each page, including their status (working, issue, error). This catches common problems like duplicate tags, misconfigured triggers, and blocked requests. Standard GA4 reports take 24-48 hours to fully populate. Don’t panic if your reports are empty on day one. Use Realtime and DebugView for immediate verification, then check standard reports after 48 hours.

Pro tips for GA4 configuration

  1. Set up data retention on day one. The default 2-month retention means you’re losing event-level data constantly. Change it to 14 months immediately. You can’t retroactively recover data that was already purged. We’ve seen clients lose months of data because they didn’t know this setting existed.
  2. Create a GA4 reporting template before you start customizing. Know what questions you need your data to answer before you build custom events and audiences. If you don’t know what reports you need, you’ll either track too little or track everything and never look at it.
  3. Use GTM, not gtag.js, for event tracking. Even if you installed GA4 via gtag.js or a CMS plugin, use GTM for custom events. GTM gives you preview mode, version history, and the ability to update tracking without code deployments. The 20-minute GTM setup saves hours of future development time.
  4. Exclude internal traffic before anything else. Every visit from your team while building and testing your site pollutes your data. Filter internal IPs before your GA4 property starts collecting real user data.
  5. Use GA4’s new Analytics Advisor. Launched in late 2025, Analytics Advisor answers questions in plain language and surfaces data anomalies you might miss. It’s especially useful for teams without a dedicated analyst. Ask it “what changed on my site last week?” for a quick performance summary.

Common GA4 setup mistakes

  1. Leaving data retention at 2 months. This is the number one mistake. After 2 months, your event data disappears from Explorations. Set it to 14 months on day one. There’s no downside to the longer retention period.
  2. Not filtering internal traffic. Your team’s browsing inflates sessions, skews engagement metrics, and makes conversion data unreliable. Set up IP-based filtering before you start using reports for decision-making.
  3. Duplicate tracking codes. Installing GA4 via both a CMS plugin and GTM (or gtag.js) causes every event to fire twice. This doubles your page view count and makes all metrics unreliable. Use one installation method only.
  4. Skipping cross-domain tracking. If your checkout, blog, or app lives on a different domain, configure cross-domain measurement in your data stream settings. Without it, sessions break when users navigate between domains, and your conversion attribution is wrong.
  5. Ignoring enhanced measurement configuration. Enhanced measurement events are on by default, but they may not work correctly with your specific site setup. AJAX forms, SPA navigation, and non-YouTube videos are common areas where enhanced measurement fails silently. Test each one in DebugView.
Related Resources

What should you set up next?

GA4 Event Tracking Guide

The complete guide to setting up event tracking in GA4, covering all four event types, GTM implementation, and DebugView verification. Read Guide

UTM Builder

Build consistent UTM parameters for your campaigns so GA4 attributes traffic to the right sources. Use Tool

Marketing Report Template

A reporting template that pulls from GA4 data to create client-ready or executive marketing reports. Get Template

FAQ

Frequently Asked Questions

Is Google Analytics 4 free?

Yes. GA4 is free for all users with no limit on the number of events collected. Google also offers Analytics 360 as a paid enterprise version with higher data limits, SLAs, and additional features, but the standard free version handles the needs of most businesses including BigQuery export.

How long does GA4 take to start showing data?

Realtime reports show data within 30 seconds of installation. Standard reports take 24-48 hours to populate. Some reports like attribution and audience insights need 7-14 days of data before they produce meaningful results. Don’t make setup decisions based on the first 48 hours of data.

Should I use gtag.js or Google Tag Manager for GA4?

Use Google Tag Manager for most implementations. GTM gives you a visual interface for managing tags, preview and debug tools, version control, and the ability to update tracking without code deployments. The only case for direct gtag.js is extremely simple sites with no custom events.

What happened to Universal Analytics?

Universal Analytics stopped processing new data on July 1, 2023. Historical UA data remained accessible until July 2024, after which it was permanently deleted. GA4 is now the only version of Google Analytics available. If you haven’t migrated, you need to set up GA4 from scratch.

How do I set up GA4 for multiple websites?

Create a separate GA4 property for each website. Each property gets its own data stream and Measurement ID. You can manage multiple properties under one Google Analytics account. If you need to compare data across sites, export both properties to BigQuery and query them together.

Need Help With Your Analytics Setup?

We configure GA4 properties with proper event tracking, audience setup, Google Ads integration, and custom reporting. From basic setup to advanced measurement plans. Get Analytics Help

Free Growth Audit
Call Now Get Free Audit →