How to add Google Analytics to your WordPress site | Rafirit Station How to Add Google Analytics to WordPress in 2026: Step-by-Step
Web Dev

How to add Google Analytics to your WordPress site

Struggling to understand your WordPress site traffic? Our guide shows you exactly how to install Google Analytics in minutes and start making data-driven decisions.

Performance Marketing Expert
Rafirit Station
📅 June 8, 2026
14 min read
📝
📋 Table of Contents

    How to Add Google Analytics to WordPress (2026 Step-by-Step Guide)

    By Rafirit Station Editorial Team · Updated 2026 · ⏱ 12 min read

    According to W3Techs, over 43% of all websites use WordPress, and Google Analytics remains the most widely deployed analytics platform, powering over 28 million sites. Yet, most site owners never look at their data — they just watch visitor numbers go up and down. That’s a missed opportunity worth ৳50,000 or more each month for a typical Dhaka e-commerce store.

    In 2026, with Google’s Analytics 4 (GA4) now standard, understanding your audience isn’t optional — it’s survival. Algorithms reward engagement, and paid ads cost more every quarter. Without proper tracking, you’re flying blind.

    What’s the cost of inaction? A Dhaka-based online clothing store we worked with was losing ৳80,000 monthly — they had no idea which products were profitable or where their traffic came from. After installing and configuring Google Analytics, they cut wasted ad spend by 35% in just two months.

    By the end of this guide, you will know exactly how to add Google Analytics to your WordPress site, set up conversion tracking, and start making data-driven decisions that grow your business — whether you’re in Dhaka or anywhere in Bangladesh.



    📚 External Resources (Bookmark These)


    🔗 Rafirit Station Services


    🚀 Ready to Master Google Analytics?

    Dhaka business owners: Let our experts install and configure GA4 for you — plus a full conversion audit.


    🗓 Book Your Free Strategy Call →

    No commitment · 60-minute session · Bangladeshi clients welcome


    Phase 1: Setting Up Your Google Analytics Account

    Before you can add Google Analytics to WordPress, you need a Google Analytics account. It’s free and only takes a few minutes. This phase covers everything from account creation to property setup.

    Tactic 1.1: Create a Google Analytics Account

    Why this works: A properly structured account ensures accurate data and easy management across multiple sites.

    Exactly how to do it:

    1. Go to analytics.google.com and sign in with your Google account (or create one).
    2. Click “Start measuring.”
    3. Enter your account name (e.g., “My Business” or your company name). Choose data sharing settings as desired.
    4. Create a property: select “Web” as the platform.
    5. Enter your website URL and property name (e.g., “My WordPress Site”).
    6. Select the correct reporting time zone (Asia/Dhaka) and currency (Bangladeshi Taka ৳).
    7. Click “Create” and accept the terms.
    8. Copy your Measurement ID (starts with G-) — you’ll need it for installation.

    Pro tip: Use a dedicated Google account for your business rather than personal to avoid losing access if an employee leaves.

    📊 Expected results: Account & property created in under 10 minutes. You’ll have a Measurement ID ready for the next phase.

    Tactic 1.2: Set Up Data Streams for Universal Analytics (Legacy) and GA4

    Why this works: Running both Universal Analytics (UA) and GA4 gives you historical data while transitioning to the new standard.

    Exactly how to do it:

    1. In your GA4 property, go to Admin > Data Streams.
    2. Click “Add stream” > “Web.”
    3. Enter your site URL and stream name.
    4. Enable enhanced measurement (page views, scrolls, outbound clicks, etc.).
    5. Save and copy the Measurement ID.
    6. Optionally, create a UA property via the same account (note: UA stops processing new data July 2023, but historical data remains).

    📊 Expected results: A fully configured GA4 data stream with enhanced measurement tracking enabled. You’re ready to install the tracking code.

    Phase 2: Installing GA4 on WordPress (Plugin & Manual Methods)

    Now that you have your Measurement ID, it’s time to add it to your WordPress site. We’ll cover the easiest method (plugin) and the manual method for those who prefer code.

    Tactic 2.1: Install via a Plugin (Site Kit by Google)

    Why this works: Plugins are beginner-friendly, handle updates automatically, and often include additional Google services like Search Console.

    Exactly how to do it:

    1. In your WordPress admin, go to Plugins > Add New.
    2. Search for “Site Kit by Google” — it’s the official plugin from Google.
    3. Install and activate the plugin.
    4. Go to the new “Site Kit” menu in your dashboard and click “Start Setup.”
    5. Connect your Google account and grant necessary permissions.
    6. Select your Analytics property from the list (the one you created in Phase 1).
    7. Complete the setup — Site Kit will automatically place the tracking code on all pages.

    Alternative plugin: “Google Analytics for WordPress by MonsterInsights” — also popular, with user-friendly dashboards inside your WordPress admin.

    📊 Expected results: Tracking code installed site-wide in less than 15 minutes. You’ll start seeing data in GA4 within 24 hours (often sooner).

    Tactic 2.2: Manual Installation via Theme Header

    Why this works: No plugin overhead; you have full control over placement and can avoid plugin conflicts.

    Exactly how to do it:

    1. Go to Appearance > Theme Editor in your WordPress admin.
    2. Find the header.php file (usually in the Theme Files list).
    3. Paste the GA4 tracking code snippet just before the closing </head> tag. The snippet looks like:
    <!-- Google tag (gtag.js) -->
    <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>
    1. Replace G-XXXXXXXXXX with your actual Measurement ID.
    2. Click “Update File.”
    3. Verify installation by viewing your site’s source code (right-click > View Page Source) and searching for “gtag.js.”

    Warning: Manual edits can break your site if you remove other code. Always use a child theme or backup your header.php file first.

    📊 Expected results: Tracking code added without a plugin. You’ll need to check via GA4 Real-Time report to confirm data flow.

    🔍 Need a Hand Installing?

    Our Dhaka-based team can set up GA4, goals, and ecommerce tracking in 48 hours. No guesswork.


    Get a Free Analytics Audit →

    No commitment · 60-minute session · Dhaka clients welcome


    Phase 3: Configuring Goals & Ecommerce Tracking

    Installing the code is only half the battle. To truly understand your visitors’ actions, you need to set up goals (conversions) and, if you sell products, ecommerce tracking.

    Tactic 3.1: Create GA4 Events for Key Actions

    Why this works: Events let you track specific interactions like form submissions, button clicks, and video plays — beyond page views.

    Exactly how to do it:

    1. In GA4, go to Configure > Events.
    2. Click “Create event” > “Create.”
    3. Give your event a name (e.g., “contact_form_submission”).
    4. Define the event parameters: choose condition triggers like “button_click” or “form_start.”
    5. Set up the trigger: e.g., click on a specific button ID or class.
    6. Save and then mark the event as a conversion by toggling “Mark as conversion” in the Events list.
    7. Alternatively, use Google Tag Manager (GTM) for advanced event tracking without coding.

    Recommended events to track: “page_view” (auto), “scroll” (auto), “click” (auto), plus custom events like “download”, “form_submit”, “phone_call_click”.

    📊 Expected results: You’ll see event reports within 24 hours. Conversion tracking can reveal, for example, that 62% of your leads come from a single page — a game-changer for your Dhaka business.

    Tactic 3.2: Set Up Ecommerce Tracking for WooCommerce

    Why this works: Ecommerce tracking shows you which products sell best, how many people view vs. buy, and the exact revenue per traffic source.

    Exactly how to do it:

    1. If using WooCommerce, install the official Google Listings & Ads plugin or a dedicated GA4 integration plugin like “Google Analytics for WooCommerce.”
    2. Go to the plugin settings and connect your GA4 property.
    3. Enable enhanced ecommerce: track product views, add to cart, checkout steps, purchases.
    4. Test a purchase using the WooCommerce order status: the plugin should fire the “purchase” event with revenue, tax, shipping, and product details.
    5. Verify data in GA4 under Monetization > Ecommerce purchases. Wait 24 hours for data to populate.

    Pro script: If manual, add the following to your checkout success page (via a snippet plugin): gtag('event', 'purchase', {transaction_id: 'TXN123', value: 15.99, currency: 'BDT', items: [{id: 'sku_001', name: 'Product Name', quantity: 1, price: 15.99}]});

    📊 Expected results: Complete visibility into your sales funnel. Typically, ecommerce stores see a 20-30% improvement in ROAS once they optimize based on this data.

    Phase 4: Analyzing Data to Boost Conversions

    With data flowing, it’s time to turn insights into action. Many site owners install GA but never log in. That’s a missed opportunity worth ৳50,000+ monthly for the average Dhaka business.

    Tactic 4.1: Identify Your Best Traffic Sources

    Why this works: Not all visitors are equal. Knowing which channels bring the highest-converting traffic lets you double down on what works.

    Exactly how to do it:

    1. In GA4, go to Reports > Acquisition > Traffic Acquisition.
    2. Sort by “Conversions” or “Revenue” (if ecommerce is set up).
    3. Look at metrics like bounce rate, average engagement time, and conversion rate per source.
    4. Compare organic, direct, social, paid, and referral traffic.
    5. For example, you might find that Facebook traffic has a 2.1% conversion rate, while organic search converts at 4.5%.
    6. Adjust budgets: shift spend to the highest-converting channels.

    Counterintuitive insight: More traffic doesn’t equal more money. A site we audited had 80% of its traffic from a low-quality source that converted at 0.3%. Cutting that source saved them ৳20,000/month in ad spend.

    📊 Expected results: A clear picture of ROI per channel. Expect to reduce wasted spend by 15–25% within 30 days.

    Tactic 4.2: Find and Fix High Bounce Pages

    Why this works: High bounce rates indicate a mismatch between visitor intent and page content. Fixing these pages can dramatically improve conversions.

    Exactly how to do it:

    1. In GA4, go to Reports > Engagement > Pages and Screens.
    2. Filter by high traffic pages (top 10–20).
    3. Look for pages with bounce rate above 70% (or your site average).
    4. Analyze the page: Is the headline clear? Is the call-to-action prominent? Is the page loading fast?
    5. Use tools like Google PageSpeed Insights to check load times (aim for under 3 seconds).
    6. Run A/B tests on copy and layout using a plugin like Nelio A/B Testing.

    Template for a low-bounce page: “Need reliable web development in Dhaka? Start with our 4-project showcase. [Button: See Our Work]” — direct, specific, and immediately actionable.

    📊 Expected results: A 10–20% reduction in bounce rate for optimized pages, leading to more conversions. For a Dhaka e-commerce store, that might mean ৳15,000 extra per month.

    🏆 Real Case Study: How a Dhaka Clothing Store Boosted Sales by 30% with Google Analytics

    Before: A mid-size clothing retailer in Dhaka (call them “Dhaka Fashion Hub”) was spending ৳1,20,000/month on Facebook and Google Ads. They had a WordPress/WooCommerce site but no Google Analytics tracking beyond basic page views. They didn’t know which products were profitable or why their conversion rate hovered at 1.2%.

    Our Strategy:

    • Installed GA4 via Site Kit and configured enhanced ecommerce tracking.
    • Set up 8 key events: Add to Cart, Checkout Initiated, Purchase, and scroll depth on product pages.
    • Analyzed data for 4 weeks to identify top-selling products and best traffic sources.
    • Found that 68% of purchases came from Instagram, but their Facebook ads were underperforming (0.8% conversion rate vs. 3.9% for Instagram).
    • Shifted 40% of ad budget from Facebook to Instagram and redesigned product pages to focus on top 10 products.
    • Implemented a popup that offered a 10% discount for abandoning carts (tracked as an event).

    After (3 months):

    • Conversion rate rose from 1.2% to 1.8% (50% improvement).
    • Monthly revenue increased from ৳4,50,000 to ৳5,85,000 — a 30% jump.
    • Ad spend efficiency improved: cost per acquisition dropped from ৳780 to ৳540.
    • Total profit increase: approximately ৳1,35,000 per month.

    Client quote: “I never realized how much we were leaving on the table. Google Analytics showed me exactly where to focus. Rafirit Station’s setup made it effortless. Now I check my dashboard every morning.” — Farzana H., Owner, Dhaka Fashion Hub

    See more Rafirit Station case studies →

    ✅ Google Analytics Setup Checklist for WordPress

    # Task Status
    1 Create Google Analytics account & property
    2 Set up GA4 data stream with enhanced measurement
    3 Install tracking code via plugin (Site Kit) or manual
    4 Verify tracking code is active (use GA4 Real-Time)
    5 Set up 3-5 key events (form submissions, button clicks) ⚠️
    6 Enable ecommerce tracking (if WooCommerce/Shopify)
    7 Create conversion goals for primary actions ⚠️
    8 Test event firing with GA4 DebugView
    9 Review Traffic Acquisition report weekly
    10 Set up custom alerts for traffic drops or spikes
    11 A/B test high-bounce pages (monthly)
    12 Link Analytics with Google Search Console ⚠️
    13 Exclude internal traffic (your own visits)
    14 Enable anonymized IP for privacy compliance
    15 Schedule monthly analytics review with Rafirit Station

    ❓ Frequently Asked Questions

    Q: Is Google Analytics free for WordPress?

    Yes! Google Analytics offers a free tier that handles up to 10 million hits per month — more than enough for most WordPress sites. Premium (GA360) is for large enterprises requiring advanced features.

    Q: Can I use both Universal Analytics and GA4?

    Yes. Google allows you to run both properties simultaneously. However, Universal Analytics stopped processing new data in July 2023. We recommend focusing on GA4 while keeping UA for historical comparisons.

    Q: How long does it take for Google Analytics to show data?

    Standard reports take 24-48 hours to populate. Real-Time reports show data within seconds of a user action, so you can test setup immediately.

    Q: Which plugin is best for Google Analytics on WordPress?

    We recommend Site Kit by Google (official, lightweight, integrates Search Console). MonsterInsights is also excellent for its user-friendly dashboard inside WordPress. Both are free with premium upgrades.

    Q: Do I need Google Tag Manager to use Google Analytics?

    No. You can add the GA4 code directly to your site. However, GTM is recommended for advanced users who want to manage multiple tracking tags (like Facebook Pixel, Hotjar) from one interface.

    Q: How do I exclude my own visits from Google Analytics?

    In GA4, create a filter to exclude internal traffic by IP address (or use a browser extension). Go to Admin > Data Settings > Data Filters and add a filter type “Internal Traffic.”

    Q: Can I track multiple websites with one Google Analytics account?

    Yes. Each website is a separate property under the same account. You can manage up to 100 properties per account.

    Q: Does Rafirit Station offer Google Analytics setup services?

    Absolutely! Our Dhaka-based team provides end-to-end Google Analytics installation, event tracking, ecommerce setup, and monthly analytics audits. Contact us for a custom quote.

    🎯 The Bottom Line

    Adding Google Analytics to your WordPress site is not just about collecting data — it’s about making smarter decisions. With GA4’s event-based model, you can track exactly what matters: which products people view, where they drop off, and what drives sales.

    The counterintuitive truth? Most businesses don’t need more traffic — they need better understanding. One Dhaka store we worked with doubled their revenue simply by cutting the worst-performing traffic source and improving their best page.

    Don’t let your analytics sit idle. Install it today, set up at least three conversions, and review your data weekly. Even small changes based on real data can yield ৳50,000+ extra each month.

    ⚡ Your Next Step (Do This Today)

    1. Create your Google Analytics account (10 minutes).
    2. Install Site Kit plugin on your WordPress site (5 minutes).
    3. Verify tracking is working using GA4 Real-Time report (2 minutes).
    4. Set up one conversion event — e.g., a contact form submission (15 minutes).
    5. Review your Traffic Acquisition report and note one channel to optimize (20 minutes).

    Ready to Get Results?

    Let our Dhaka team set up GA4, event tracking, and a monthly analytics dashboard — starting at ৳15,000 for small businesses.


    🗓 Book Your Free Strategy Call →

    💬 Drop “add Google Analytics” in the comments and we’ll send you our free Google Analytics setup checklist — no email required.

    🌐
    Need a fast, conversion-optimised website?
    96 avg. PageSpeed score
    Get Free Web Consultation → 💬 Or WhatsApp us now

    💬 Leave a Comment

    Your email will not be published. Fields marked * are required.

    Ready to Apply This?

    Need Expert Help With Your
    Web Dev?

    Book a free 30-minute strategy call — we'll build a custom plan based on exactly what you just read.