Tooling Guide

How to Set Up Google Analytics 4 for Kenyan Businesses (2026)

Complete walkthrough of installing GA4 on a Kenyan website — including KES currency, Data Protection Act compliance, M-Pesa transaction tracking, and the Kenya-specific configuration most guides skip.

Most Kenyan businesses run websites without proper analytics. They guess at what's working. They miss obvious problems. They spend on Facebook ads with no idea if conversions actually came from there. Google Analytics 4 (GA4) fixes all of this for free — but most off-the-shelf setup guides miss the Kenya-specific configuration. This guide covers it all.

Why You Need GA4 in 2026

  • See where your traffic actually comes from (Google search, Facebook, direct, referral)
  • Identify which pages convert visitors into leads or sales
  • Track M-Pesa transactions as conversions with real revenue numbers
  • Spot mobile vs desktop performance differences (huge for Kenya where most traffic is mobile)
  • Set up audiences for Facebook and Google Ads retargeting
  • Comply with Data Protection Act 2019 by giving users consent options

Step 1: Create a GA4 Property

  1. Go to analytics.google.com and sign in with your Google account
  2. Click "Admin" (gear icon, bottom left)
  3. In the "Account" column, click "Create" → "Account" if you don't already have one
  4. Name it after your business. Set country to Kenya, currency to Kenyan Shilling (KES), time zone to Africa/Nairobi.
  5. In the "Property" column, click "Create" → "Property"
  6. Property name = your website name. Industry = your category. Business size = pick honestly.
  7. Pick your business objectives. For most Kenyan SMEs: "Generate leads" or "Drive online sales".

Step 2: Set Up the Data Stream

  1. Click "Web" as your platform
  2. Enter your website URL (with https://)
  3. Stream name = something descriptive like "Main Website"
  4. Enable "Enhanced measurement" (tracks page views, scrolls, outbound clicks, file downloads automatically)
  5. Click "Create stream"
  6. Copy your Measurement ID — looks like G-XXXXXXX

Step 3: Install the Tracking Code

Three ways depending on your platform:

Option A: Google Tag Manager (recommended for non-developers)

  1. Sign up at tagmanager.google.com
  2. Install GTM script on your site (most platforms have a plugin)
  3. In GTM, create a new tag: "Google Analytics: GA4 Configuration"
  4. Paste your Measurement ID
  5. Trigger: "All Pages"
  6. Save and publish the GTM container

Option B: WordPress with Site Kit

  1. Install "Site Kit by Google" plugin
  2. Activate, click "Set up", sign in with your Google account
  3. Connect Analytics, pick your property
  4. Done — Site Kit handles installation

Option C: Direct code (Next.js, custom sites)

Add to your <head>:

<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>

For Next.js, use the next/script component as we do in this site's layout.tsx.

Step 4: Track M-Pesa Transactions as Conversions

This is where most Kenyan setups stop short. You want to track when M-Pesa payments succeed as proper purchase events with revenue:

// On successful M-Pesa callback (your backend tells frontend payment succeeded):
gtag('event', 'purchase', {
  transaction_id: 'ORDER-12345',
  value: 4500,
  currency: 'KES',
  payment_type: 'M-Pesa',
  items: [{
    item_id: 'PROD-1',
    item_name: 'Product Name',
    price: 4500,
    quantity: 1
  }]
});

Then in GA4 admin → Conversions, mark purchase as a conversion event. Now you'll see real KES revenue tracked against marketing channels.

Step 5: Configure Consent (Data Protection Act 2019)

Kenya's Data Protection Act requires you to get explicit consent before tracking users. Default GA4 to consent-denied:

// Before any other gtag calls:
gtag('consent', 'default', {
  'analytics_storage': 'denied',
  'ad_storage': 'denied'
});

// When user accepts cookies:
gtag('consent', 'update', {
  'analytics_storage': 'granted'
});

Pair this with a cookie consent banner. Most consent management platforms (Cookiebot, Osano, the free one we ship with our sites) handle this automatically.

Step 6: Set Up Key Events

GA4 tracks page views automatically but you should also track:

  • Form submissions (contact form, quote request)
  • Phone clicks (especially mobile — call link clicks)
  • WhatsApp clicks (huge for Kenyan sites)
  • Add to cart and begin checkout for e-commerce
  • Video plays if you have product/explainer videos

Each of these can be sent as a custom event:

gtag('event', 'whatsapp_click', {
  phone_number: '254720036429',
  page_path: window.location.pathname
});

Step 7: Connect Search Console

In GA4 admin → Product Links → Search Console Links → Link. Now you'll see SEO data (keywords, impressions, clicks) inside GA4. See our Search Console guide.

Step 8: Build Reports You'll Actually Use

Default GA4 reports are dense. Make a custom dashboard with the 5-6 metrics you care about:

  • Sessions by source/medium (where traffic comes from)
  • Conversions by landing page (which pages convert)
  • Mobile vs desktop conversion rate (almost always reveals mobile UX problems)
  • Geographic distribution (Kenya, then international)
  • Revenue by channel (paid vs organic vs social)
  • Bounce rate by landing page (which pages need work)

Common Setup Mistakes

  • Currency set to USD instead of KES. Revenue numbers won't match your actual M-Pesa records.
  • No consent management. Tracking users without consent violates the Data Protection Act.
  • Self-traffic not filtered. Your team browsing the site inflates numbers. Add IP filters.
  • Forgetting cross-domain tracking. If your checkout is on a subdomain or different domain, configure cross-domain tracking or sessions break.

Frequently Asked Questions

Is Google Analytics 4 free for Kenyan businesses?+

Yes — completely free for sites with under 10 million events per month. Almost no Kenyan business hits that limit. GA4 360 (paid version) is for enterprise sites with billions of events; ignore it unless you're a major media or e-commerce company.

Do I need a Kenya-specific GA4 setup?+

Mostly no — GA4 is the same setup globally. The Kenya-specific things are: (1) set primary currency to KES, (2) add KE as the primary market in audience settings, (3) configure consent for the Kenya Data Protection Act 2019. The rest is identical to any other GA4 setup.

How long until GA4 starts showing data?+

Real-time data appears within minutes of installation. Standard reports populate within 24-48 hours. Trend data with statistical significance takes 2-4 weeks of normal traffic.

Should I keep the old Universal Analytics?+

Universal Analytics stopped processing data in July 2024. There's nothing to keep. If you have UA historical data, export it for records but actively use only GA4.

Need help setting up GA4 or want it done as part of a website build? Get in touch — we include GA4 setup in every website project.