← Blog'a Dön
WEB DEVELOPMENT

How to Set Up Google Analytics: A Step-by-Step Guide

F. Çağrı Bilgehan18 Şubat 20269 dk okuma
Google Analyticsdata analysisweb analyticsGA4digital marketing

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

  1. Go to analytics.google.com
  2. Click "Start measuring"
  3. Enter account name (your business name)
  4. Configure data sharing settings

Step 3: Create a Property

  1. Enter property name (your website name)
  2. Reporting time zone: your local time
  3. Currency: your preferred currency
  4. Select business size and industry

Step 4: Create a Data Stream

  1. Platform: Web
  2. Enter your website URL
  3. Enter stream name
  4. 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

  1. Visit your website
  2. Check the "Realtime" report in GA4
  3. 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

İlgili Yazılar

Web Performance Optimization: How to Build Fast Websites

How do you speed up your website? A guide to Core Web Vitals, image optimization, lazy loading, caching, and performance measurement tools.

Domain and Hosting Guide: Launch Your Website

What is a domain, what is hosting, and which option is best for your website? Domain selection, DNS, hosting types, and cost comparison.