How to Measure Website Analytics: GA4 Guide in 2027
To measure website analytics with GA4, set up a GA4 property, install the gtag.js or Google Tag Manager snippet, configure events (page views, clicks, form submissions, purchases), create custom reports in GA4 Explorations, and link to Google Sear...
How to Measure Website Analytics: GA4 Guide in 2027
Quick answer: To measure website analytics with GA4, set up a GA4 property, install the gtag.js or Google Tag Manager snippet, configure events (page views, clicks, form submissions, purchases), create custom reports in GA4 Explorations, and link to Google Search Console. Key metrics: users, sessions, engagement rate, conversions, and revenue. Use GA4's event-based model (not session-based like Universal Analytics). For privacy-first tracking, consider Plausible, Fathom, or PostHog as GA4 alternatives. Always respect cookie consent (GDPR/CCPA).[1][3][4]
Website analytics tell you who visits, what they do, and whether your content converts. GA4 (Google Analytics 4) is the standard, but the landscape is evolving with privacy regulations and alternative tools.
GA4 setup
1. Create property
- Go to analytics.google.com
- Create account → Create property
- Enter property name, timezone, currency
- Create data stream (Web)
- Enter website URL
- Copy Measurement ID (G-XXXXXXXXXX)
2. Install tracking code
Option A: gtag.js (direct)
<!-- Add to <head> -->
<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>Option B: Google Tag Manager (recommended)
- Create GTM container
- Add GTM snippet to site
- Create GA4 Configuration tag in GTM
- Publish container
Why GTM: Easier to manage multiple tags, no code changes for new tracking, built-in debugging.[3]
3. Configure events
Automatic events (GA4 collects by default):
- page_view
- scroll (90% scroll depth)
- click (outbound links)
- view_search_results
- file_download
Recommended events (enhanced measurement):
- purchase
- add_to_cart
- begin_checkout
- sign_up
- login
- generate_lead
Custom events:
// Track custom event
gtag('event', 'image_compressed', {
file_size: 1024000,
compression_ratio: 0.65,
format: 'webp',
});4. Set up conversions
- Go to Admin → Events
- Mark key events as conversions
- Or create conversion event from existing event
- Conversions appear in Reports → Conversions[3]
GA4 key metrics
User metrics
- Users: Total unique users
- New users: First-time visitors
- Active users: Users with engaged sessions
- Returning users: Users who visited before
Session metrics
- Sessions: Total sessions
- Engaged sessions: Sessions lasting >10s, or with conversion, or 2+ page views
- Engagement rate: Engaged sessions / total sessions
- Average engagement time: Time users spend engaged
Traffic metrics
- Page views: Total page views
- Screens per session: Pages per session
- Traffic acquisition: Where users come from (organic, direct, social, referral)
- User acquisition: First-touch attribution
Conversion metrics
- Conversions: Total conversion events
- Conversion rate: Conversions / sessions
- Revenue: Total revenue (e-commerce)
- E-commerce metrics: Transactions, items sold, average order value[3][4]
GA4 reports
Standard reports
- Realtime: Live user activity
- Acquisition: Traffic sources
- Engagement: Pages, events, conversions
- Monetization: Revenue, purchases (e-commerce)
- Retention: User retention by cohort
- Demographics: Age, gender, interests
- Tech: Browser, device, OS
Explorations (custom reports)
- Funnel exploration: Step-by-step conversion funnel
- Path exploration: User journey through site
- Segment overlap: Compare user segments
- Cohort exploration: Retention by cohort
- Free form: Custom table/chart
GA4 vs Universal Analytics
| Feature | Universal Analytics | GA4 |
|---|---|---|
| Data model | Session-based | Event-based |
| Bounce rate | Yes | No (engagement rate) |
| Goals | Yes | Conversions (events) |
| Views | Multiple views | Single property |
| Cross-device | Limited | Built-in |
| Machine learning | Basic | Advanced (predictive) |
| Privacy | Cookie-heavy | Privacy-first design[3] |
Google Search Console integration
Why link GSC?
- See search queries driving traffic
- Monitor search performance (clicks, impressions, CTR, position)
- Identify indexing issues
- Submit sitemaps
Setup
- Verify site ownership in GSC (DNS or HTML file)
- In GA4: Admin → Product Links → Search Console Links
- Select GSC property
- Data appears in GA4: Reports → Search Console[3]
Privacy-first analytics (2027 trend)
Why alternatives?
- GDPR/CCPA compliance concerns with GA4
- Cookie consent requirements
- Data ownership concerns
- Ad blockers blocking GA4
Alternative tools
| Tool | Type | Price | Key feature |
|---|---|---|---|
| Plausible | Privacy-first | $9+/mo | No cookies, GDPR-compliant |
| Fathom | Privacy-first | $14+/mo | Simple, fast |
| PostHog | Product analytics | Free/Paid | Self-hosted option |
| Matomo | Self-hosted | Free/Paid | Full GA4 alternative |
| Umami | Open source | Free (self-hosted) | Lightweight |
| Vercel Analytics | Built-in | Free/Paid | Web Vitals focus |
Cookie consent
// Only load GA4 after consent
if (userConsented) {
gtag('consent', 'update', {
analytics_storage: 'granted',
});
}Best practice: Use a consent management platform (CMP) like Cookiebot, OneTrust, or Termly.[3][4]
E-commerce tracking
Enhanced e-commerce events
// Product view
gtag('event', 'view_item', {
items: [{
item_id: 'SKU_123',
item_name: 'Image Compressor Pro',
price: 29.99,
item_category: 'Tools',
}],
});
// Purchase
gtag('event', 'purchase', {
transaction_id: 'T_12345',
value: 29.99,
currency: 'USD',
items: [{ item_id: 'SKU_123', item_name: 'Image Compressor Pro', price: 29.99, quantity: 1 }],
});GA4 e-commerce reports
- Revenue by product
- Purchase funnel (view → cart → checkout → purchase)
- Average order value
- Customer lifetime value[3]
Custom dashboards
GA4 dashboard setup
- Go to Reports → Library
- Create new collection
- Add report cards (metrics, dimensions, filters)
- Share with team
Key dashboards to create
- Traffic overview: Users, sessions, page views, engagement rate
- Content performance: Top pages by views, time on page, scroll depth
- Conversion funnel: Landing → signup → activation → purchase
- SEO performance: Organic traffic, top queries, landing pages
- Campaign performance: UTM-tagged campaigns, ROI[3][4]
UTM tracking
UTM parameters
https://mintsaas.net/blog/my-post?utm_source=newsletter&utm_medium=email&utm_campaign=weekly_digest&utm_content=cta_button| Parameter | Purpose | Example |
|---|---|---|
| utm_source | Traffic source | newsletter, twitter, google |
| utm_medium | Marketing medium | email, social, cpc |
| utm_campaign | Campaign name | weekly_digest, product_launch |
| utm_term | Paid keyword | image+compression |
| utm_content | Differentiate links | cta_button, header_link |
Best practices
- Use lowercase, no spaces (use underscores)
- Be consistent with naming
- Use a UTM builder (Google's Campaign URL Builder)
- Document your UTM convention[3]
Frequently Asked Questions (FAQ)
What is GA4?
GA4 (Google Analytics 4) is Google's latest analytics platform. It uses an event-based data model (not session-based like Universal Analytics). It includes machine learning, cross-device tracking, and privacy-first design.[1][3]
Is GA4 free?
Yes, GA4 is free for standard use. GA4 360 (enterprise) is paid. Most businesses use the free version.[3]
How do I migrate from Universal Analytics to GA4?
UA was sunset in July 2023. If you haven't migrated, create a GA4 property, install GA4 tracking code, configure events/conversions, and set up custom reports. Historical UA data is no longer accessible.[3]
What is engagement rate?
Engagement rate = engaged sessions / total sessions. An engaged session lasts >10 seconds, has a conversion, or has 2+ page views. It replaces bounce rate from UA.[3]
How do I track form submissions?
Use GA4's enhanced measurement (auto-tracks form submissions) or create a custom event on form submit. In GTM, create a trigger for form submission and a GA4 event tag.[3]
Should I use GA4 or an alternative?
Use GA4 if you need Google ecosystem integration (Ads, Search Console). Use alternatives (Plausible, Fathom) if privacy is a priority or you want simpler analytics. Many businesses use both.[3][4]
How do I set up e-commerce tracking in GA4?
Implement enhanced e-commerce events (view_item, add_to_cart, begin_checkout, purchase) via gtag.js or GTM. Link to Google Merchant Center for product data. Enable e-commerce reports in GA4.[3]
What is the difference between users and sessions?
Users = unique visitors. Sessions = visits (a user can have multiple sessions). One user can have 3 sessions in a day. Sessions reset after 30 minutes of inactivity.[3]
Related reading on MintSaaS
- How to Create a Content Calendar: Planning Guide
- How to Optimize Meta Titles and Descriptions for SEO
- How to Onboard New Users: SaaS Onboarding Best Practices
Sources
[1] Google Analytics — GA4 Documentation: https://support.google.com/analytics/answer/10089681
[2] Google Tag Manager: https://tagmanager.google.com/
[3] MintSaaS Image Compressor: https://www.mintsaas.net/products/image-compressor
[4] Web.dev — Core Web Vitals: https://web.dev/vitals/
[5] MintSaaS PDF Compressor: https://www.mintsaas.net/products/pdf-compressor
Free tools on MintSaaS
Try our free tools to put this guide into practice:
MintSaaS Dispatch articles are researched and synthesized with the assistance of artificial intelligence analysis, then edited, verified, and benchmarked by our engineering editorial team. Customer personal data and platform source files are strictly segregated and are never used to train or fine-tune public artificial intelligence models.
More from MintSaaS Dispatch
Handcrafted technical insights and developer tools.