📊 Google Analytics 4 Setup

Complete guide to configuring GA4 for comprehensive website analytics, event tracking, and data-driven decision making.

Why GA4 Matters

🔮

Future-Proof

Built for the cookieless future with machine learning predictions and privacy-centric tracking.

📱

Cross-Platform

Track users across websites and apps with unified measurement and single user ID.

🎯

Event-Based

Flexible event-based model captures more granular user interactions than pageviews.

🤖

AI-Powered

Built-in machine learning provides predictive insights and anomaly detection.

GA4 Setup Steps

1

Create GA4 Property

Set up a new GA4 property in your Google Analytics account.

Go to Admin → Create Property
Enter property name and timezone
Select business industry and size
Choose business objectives
2

Set Up Data Stream

Create a web data stream to collect data from your website.

Select "Web" as platform
Enter website URL and stream name
Enable enhanced measurement
Copy Measurement ID (G-XXXXXXXXXX)
3

Install Tracking Code

Add the GA4 tracking code to your website.

Copy gtag.js snippet from GA4
Paste in <head> section of all pages
Or use Google Tag Manager
Verify installation with Realtime reports
4

Configure Enhanced Measurement

Enable automatic tracking of common interactions.

Page views (enabled by default)
Scrolls (90% depth)
Outbound clicks
Site search, video engagement, file downloads
5

Set Up Conversions

Mark important events as conversions to track business goals.

Navigate to Configure → Events
Toggle "Mark as conversion" for key events
Create custom events if needed
Set up conversion values for ROI tracking

Event Tracking in GA4

Automatic Events

Events collected automatically when enhanced measurement is enabled.

page_view
scroll
click (outbound)
view_search_results
file_download

Recommended Events

Google-defined events with specific parameters for better reporting.

login
sign_up
share
search
generate_lead

Custom Events

Events you define for tracking specific interactions on your site.

newsletter_signup
pdf_download
video_complete
calculator_used
form_submit

Setting Up Conversions

Conversions are the key actions you want users to take. In GA4, any event can be marked as a conversion, giving you flexibility in tracking what matters most.

📧
Lead Generation

Newsletter signups, contact form submissions, demo requests

📄
Content Engagement

PDF downloads, video completions, guide access

🛒
E-commerce

Purchases, add to cart, checkout initiation

👤
Account Actions

Sign ups, logins, profile completions

Conversion Funnel Example

10,000 Sessions
Page Views
6,500 Users
Engaged Users
3,500 Actions
CTA Clicks
1,500 Conversions
Sign Ups

Key GA4 Reports

⏱️

Realtime

Monitor live activity on your site including current users, pages, and events.

👥

Acquisition

See how users find your site: organic, paid, social, direct, referral.

🎯

Engagement

Analyze user behavior: pages, events, conversion rates, session duration.

💰

Monetization

Track revenue, purchases, and e-commerce performance metrics.

🔄

Retention

Understand user return rates and lifetime value over time.

👤

Demographics

Learn about your audience: age, gender, interests, location.

📱

Tech

View devices, browsers, operating systems, and screen sizes.

🔍

Explore

Build custom reports with funnels, path analysis, and cohorts.

Essential Integrations

🔍

Search Console

Link Google Search Console to see organic search data alongside analytics.

See search queries driving traffic
Landing page performance
Click-through rates by query
📢

Google Ads

Connect Google Ads to import conversions and create audiences for remarketing.

Auto-import conversions
Create remarketing audiences
Track ad campaign ROI
📊

BigQuery

Export raw data to BigQuery for advanced analysis and custom reporting.

Access raw event data
Custom SQL queries
Long-term data storage

Installation Code

Global Site Tag (gtag.js)

<!-- Google tag (gtag.js) -->
<script async 
  src="https://www.googletagmanager.com
  /gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXXXXX');
</script>

Custom Event Example

// Track newsletter signup
gtag('event', 'newsletter_signup', {
  'method': 'footer_form',
  'page_location': window.location.href
});

// Track file download
gtag('event', 'file_download', {
  'file_name': 'guide.pdf',
  'file_type': 'pdf'
});

GA4 Setup Checklist

🏗️ Initial Setup

⚡ Events & Conversions

🔗 Integrations

📊 Reporting