How to Set Up Google Analytics: A Step-by-Step Guide
You have a website but don't know how many people visit it? Which pages do your visitors view, where do they come from, and how long do they stay? Google Analytics 4 (GA4) is a powerful tool that answers all these questions for free.
What Is Google Analytics?
Google Analytics is a free analytics tool that measures your website's traffic and user behavior. GA4 is Google's latest version, offering machine learning-powered advanced predictions.
Why Should You Use Google Analytics?
- Know your visitor count — Daily, weekly, monthly traffic
- See traffic sources — Google, social media, direct, referral
- Understand user behavior — Popular pages, where they leave
- Track conversions — Form submissions, purchases, phone calls
- Measure ROI — Return on your ad spend
- Base decisions on data — Not intuition, data
GA4 Setup Steps
Step 1: Create a Google Account
Skip this if you already have a Gmail account.
Step 2: Create a GA4 Account
- Go to analytics.google.com
- Click "Start measuring"
- Enter account name (your business name)
- Configure data sharing settings
Step 3: Create a Property
- Enter property name (your website name)
- Reporting time zone: your local time
- Currency: your preferred currency
- Select business size and industry
Step 4: Create a Data Stream
- Platform: Web
- Enter your website URL
- Enter stream name
- Measurement ID — in G-XXXXXXX format
Step 5: Add the Tracking Code to Your Site
Add the GA4 code to your site's head section:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>
If using Next.js, add via next/script or use Google Tag Manager.
Step 6: Verification
- Visit your website
- Check the "Realtime" report in GA4
- You should see yourself as an active user
Key Metrics to Track
User Metrics
| Metric | Description | Why It Matters | |--------|-------------|---------------| | Users | Unique visitors | Reach size | | New users | First-time visitors | Growth potential | | Session duration | Average time spent | Content quality | | Pages/session | Pages per session | Engagement depth | | Bounce rate | Single-page visits | Content relevance |
Traffic Sources
- Organic Search — From Google (SEO)
- Direct — Typed URL directly
- Social — From social media
- Referral — From other websites
- Paid Search — From Google Ads
- Email — From email campaigns
Conversion Goals
Mark important actions as "conversions" in GA4:
- Contact form submission
- Phone button click
- WhatsApp link click
- Product purchase
- Email subscription
Important GA4 Features
1. Realtime Report
How many people are on your site right now and what they're doing
2. User Lifecycle
- Acquisition: Where do they come from?
- Engagement: What do they do?
- Monetization: What do they buy?
- Retention: Do they come back?
3. Exploration Reports
Advanced analysis and custom report creation
4. Predictive Analytics
Machine learning-powered future predictions
Common Mistakes
- Adding tracking code in the wrong place — Must be on every page
- Not filtering your own traffic — Add an IP filter
- Not setting conversion goals — You can't improve what you don't measure
- Not checking data regularly — Review at least weekly
- Only looking at pageviews — Behavior and conversions matter more
Conclusion
Google Analytics is an indispensable tool for measuring your website's success. Setup takes 15 minutes but provides months of valuable data. Without data, there's no strategy — start measuring your website today.
If you'd like a professional website with Google Analytics included, get in touch: info@cagribilgehan.com. Check out my projects: cagribilgehan.com