Set Up Google Analytics
Get Google Analytics 4 running on your site so you can see who visits and what they do.
What this covers: Creating a GA4 property, installing tracking on WordPress, Shopify, Squarespace, Wix, or custom sites, enabling Enhanced Measurement, and setting up your first conversion.
Who it’s for: Site owners setting up analytics for the first time or migrating to GA4 who need tracking running in under 30 minutes.
Key outcome: You’ll have GA4 collecting page views, scroll depth, outbound clicks, and file downloads, with at least one conversion event configured.
Time to read: 6 minutes
Part of: Analytics & Measurement series
GA4 is Google’s current analytics platform. It tells you where your visitors come from, what pages they view, and whether they take action (buy, sign up, contact you). Every website needs this.
This guide covers: Creating a GA4 account, installing tracking on your site, and verifying it works. Takes 15-30 minutes.
Step 1: Create Your GA4 Property
- Go to analytics.google.com
- Click Admin (gear icon, bottom left)
- Click Create → Property
- Enter your website name and select your time zone/currency
- Follow the prompts to describe your business
- Select Web as your platform
- Enter your website URL
- Click Create stream
You’ll see your Measurement ID (starts with “G-“). Copy this—you’ll need it for the next step.
Step 2: Install on Your Website
WordPress (Recommended: Site Kit plugin)
- Go to Plugins → Add New
- Search for “Site Kit by Google”
- Install and activate
- Click Start Setup and sign in with your Google account
- Site Kit automatically connects GA4 to your site
Alternative plugin: MonsterInsights provides a friendlier dashboard within WordPress.
Shopify
- Go to Online Store → Preferences
- Scroll to Google Analytics
- Paste your Measurement ID (G-XXXXXXXX)
- Save
Shopify handles the rest automatically, including basic e-commerce tracking.
Squarespace
- Go to Settings → Advanced → External API Keys
- Paste your Measurement ID in the Google Analytics field
- Save
Wix
- Go to Marketing & SEO → Marketing Integrations
- Click Google Analytics
- Paste your Measurement ID
- Save
Manual Installation (Custom Sites)
If your platform isn’t listed above, add this code just before the closing </head> tag on every page:
<!-- 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>
Replace G-XXXXXXXXXX with your actual Measurement ID.
Step 3: Verify It Works
- Open your website in a new browser tab
- Go to GA4 → Reports → Real-time
- You should see yourself as an active user
- Click around your site—the pages should appear in real-time
Not seeing data?
- Wait 5 minutes—there’s sometimes a brief delay
- Try incognito mode (ad blockers can block GA4)
- Check that your Measurement ID matches exactly
- Verify the tracking code appears in your page source (View Source, search for “gtag”)
Step 4: Enable Enhanced Measurement
GA4 can automatically track common actions without extra code:
- Go to Admin → Data Streams
- Click your web stream
- Under Enhanced measurement, ensure these are ON:
- Page views (always on)
- Scrolls (90% scroll depth)
- Outbound clicks
- Site search
- File downloads
This gives you useful data without any custom code.
Step 5: Set Up Your First Conversion
Conversions track the actions that matter to your business. Common examples:
- Contact form submission
- Newsletter signup
- Purchase completion
- Phone number click
Quick Method: Mark an Event as a Conversion
- Go to Admin → Events
- Wait for events to appear (may take 24 hours after setup)
- Find a relevant event (like
form_submitorgenerate_lead) - Toggle the Mark as conversion switch
For custom conversion tracking, see our Goal Tracking Guide.
Sources
Google Analytics Setup Questions Answered
Where do you put the Google Analytics tracking code in WordPress?
Install the GA4 tracking snippet in your theme’s <head> section via the header.php file, or use a plugin like Site Kit by Google for a code-free setup. Never install the tag in the footer, as it may miss pageviews if users leave before the page fully loads.
How long does it take for Google Analytics to start showing data?
Real-time data appears within seconds of installing the tag. Standard reports take 24-48 hours to populate. If you see real-time visitors but no data in reports after 48 hours, check your data filters and property settings.
Do you need cookie consent for Google Analytics?
In the EU (under GDPR), UK, and several US states (under CCPA/CPRA), you must obtain user consent before setting GA4 cookies. Implement a consent management platform and configure GA4’s consent mode to respect user choices while preserving aggregated measurement.
What is the difference between GA4 measurement ID and tracking ID?
GA4 uses a measurement ID formatted as G-XXXXXXXXXX, replacing Universal Analytics’ UA-XXXXXXXX-X tracking ID. The measurement ID is found in Admin > Data Streams > Web and is the only ID you need for a GA4 web implementation.
✓ The GA4 Installation Checklist
- Real-time reports show your visits as you browse your site
- Enhanced measurement is enabled for scrolls, clicks, and downloads
- You’ve marked at least one event as a conversion
Give it 24-48 hours before checking reports. Real-time works immediately, but standard reports have a delay.
What to Look at First
Once data starts flowing (24-48 hours), check these reports:
- Acquisition → Overview: Where are visitors coming from?
- Engagement → Pages and screens: Which pages get the most views?
- Engagement → Events: What actions are people taking?
Common GA4 Setup Questions
How long before I see data in GA4?
Real-time reports show data within seconds. Standard reports have a 24-48 hour delay.
Do I need Google Tag Manager?
No. Basic GA4 works fine with just the tracking code. GTM is useful for advanced tracking without code changes.
Is GA4 free?
Yes. GA4 is free for most businesses. GA360 (the paid version) is only needed for very high-traffic sites.