GuideAnalytics & SEO

How to Set Up Google Analytics
on Your Website

Google Analytics 4 (GA4) helps you track visitors, traffic sources, user behavior, conversions, and more — completely free. This step-by-step guide walks you through creating a property, installing tracking code, and configuring essential settings.

8
Steps
15 min
Setup time
Free
Cost
Intermediate
Difficulty

📋 Prerequisites

  • A Google Account (Gmail) — This will be your analytics admin account.
  • Your own website — WordPress, Shopify, Wix, custom HTML, or any platform.
  • Admin access to your website — You need permission to edit code or install plugins.

01 Step 1: Create a Google Analytics Property

1 Create Property
  • Click Create Property
  • Enter your Property name (e.g., "KumasiFurniture – Main Website")
  • Select your Time zone — choose Africa/Accra
  • Select Currency — GHS (Ghana Cedis) if selling products
  • Click Next

02 Step 2: Configure Data Stream

2 Create Data Stream
  • Select Web as the platform
  • Enter your Website URL (e.g., https://www.yourbusiness.com.gh)
  • Give the stream a name (usually the same as your site)
  • Click Create stream

Turn on Enhanced Measurement

Make sure Enhanced Measurement is enabled — it automatically tracks scrolls, outbound clicks, site search, video engagement, and file downloads.

03 Step 3: Get Your Tracking Code

After creating the stream, you'll see your Measurement ID (starts with G- followed by letters and numbers). Copy this ID.

Your Measurement ID looks like: G-XXXXXXXXXX

Universal Analytics is going away

Make sure you're using GA4 (Measurement ID starts with G-), not Universal Analytics (UA-). Universal Analytics stopped processing data in July 2023.

04 Step 4: Install the Tracking Code

WordPress
Install "Google Site Kit" plugin → Connect Google account → Auto-install complete
Shopify
Online Store → Themes → Edit code → Paste in theme.liquid → Save
Wix
Settings → Marketing & SEO → Google Analytics → Enter Measurement ID → Save
Squarespace
Settings → Advanced → Code Injection → Paste in header → Save
Custom HTML
Paste the GA4 code snippet into the <head> section of every page

Install on EVERY page

The tracking code must be present on every page of your website, not just the homepage. For custom sites, use a header/footer template so it appears site-wide.

05 Step 5: Verify the Setup

  • Go back to analytics.google.com → Click Reports (wait 24-48 hours for full data)
  • Use the Realtime report to test immediately: Open your website in a new tab → You should see 1 active user in Realtime within seconds
  • Google Tag Assistant — Free Chrome extension that verifies your tracking code is working correctly

06 Important Settings to Configure

:Privacy protection — prevents storing full IP addresses
SettingRecommendationWhy
Enhanced MeasurementTurn ONTracks scrolls, file downloads, video plays, and site search automatically
Data Retention14 months (or longer)Better for long-term analysis and year-over-year comparisons
Google SignalsTurn ON (if privacy allows)Enables remarketing, demographic reporting, and cross-device tracking
Cross-Domain TrackingEnable if you have multiple domainsTracks users across different websites (e.g., main site + checkout domain)
IP AnonymizationEnabled by default

07 Best Practices & Tips

  • Set up Conversions — Track form submissions, purchases, WhatsApp clicks, and other goals. Admin → Events → Create event → Mark as conversion.
  • Connect to Google Search Console — Get SEO data like which search queries bring traffic. Admin → Product Links → Search Console Links → Add.
  • Create Audiences for remarketing — Build audiences of people who visited specific pages (e.g., cart abandoners) for ad retargeting.
  • Enable e-commerce tracking — If you sell products, turn on Enhanced Ecommerce to track product views, add-to-cart, and purchase data.
  • For Ghana businesses — Track mobile traffic heavily. Most Ghanaian users access websites via smartphones. Use the Mobile report to optimise for phone users.
  • Explore GA4 reports — Reports → Acquisition (where traffic comes from) and Engagement (what users do) are most useful for most businesses.

08 Privacy & Compliance

  • Add a clear Privacy Policy page — Mention that you use Google Analytics to track visitor behaviour.
  • Offer users the option to opt out — You can add a consent banner (cookie consent) for websites targeting European visitors.
  • Be mindful of data protection regulations — GDPR (Europe) applies even to Ghana-based websites if you have European visitors. For local-only Ghana traffic, consent requirements are less strict but still good practice.

09 Common Mistakes to Avoid

  • Installing Universal Analytics (UA) instead of GA4 — UA stopped processing data in July 2023. Always use GA4 (G-XXXXXXXXXX).
  • Forgetting to add the code to all pages — If the code is only on your homepage, you won't track interior pages. Use header/footer templates.
  • Not waiting 24–48 hours before checking data — Google Analytics doesn't show data immediately (except Realtime). Be patient.
  • Using multiple analytics tools without proper setup — Multiple tags can conflict and cause inaccurate data or site slowdowns.
  • Setting the wrong time zone or currency — Incorrect time zone skews daily reports. Incorrect currency affects ecommerce data.
  • Never checking GA4 after setup — Set a monthly reminder to review your analytics. Data is useless if you don't act on it.

Your Analytics Are Now Tracking

You can now see who visits your website, where they come from, what they do, and where they drop off. Spend time exploring the GA4 interface — the Reports → Acquisition and Engagement sections are especially useful for understanding your audience.