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)
- Google Analytics Help Center
- Google Analytics Home
- GA4 Developer Documentation
- HubSpot: How to Use Google Analytics
- Moz: The Beginner’s Guide to Google Analytics
- Semrush: Google Analytics Guide
- Ahrefs: How to Use Google Analytics
- Backlinko: Google Analytics Guide
- Search Engine Journal: GA Guide
- Neil Patel: Google Analytics Tutorial
🔗 Rafirit Station Services
- Web Development — Custom websites
- Web Development Dhaka — Local dev team
- UI/UX Design — Interfaces users love
- Ecommerce Solutions — Shopify & WooCommerce
- CRO Services — Websites that convert
- App Development — iOS & Android
- Packages & Pricing
- Rafirit Station Bangladesh — Digital Agency
- Rafirit Station Dhaka — Full-Service Agency
🚀 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:
- Go to analytics.google.com and sign in with your Google account (or create one).
- Click “Start measuring.”
- Enter your account name (e.g., “My Business” or your company name). Choose data sharing settings as desired.
- Create a property: select “Web” as the platform.
- Enter your website URL and property name (e.g., “My WordPress Site”).
- Select the correct reporting time zone (Asia/Dhaka) and currency (Bangladeshi Taka ৳).
- Click “Create” and accept the terms.
- 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:
- In your GA4 property, go to Admin > Data Streams.
- Click “Add stream” > “Web.”
- Enter your site URL and stream name.
- Enable enhanced measurement (page views, scrolls, outbound clicks, etc.).
- Save and copy the Measurement ID.
- 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:
- In your WordPress admin, go to Plugins > Add New.
- Search for “Site Kit by Google” — it’s the official plugin from Google.
- Install and activate the plugin.
- Go to the new “Site Kit” menu in your dashboard and click “Start Setup.”
- Connect your Google account and grant necessary permissions.
- Select your Analytics property from the list (the one you created in Phase 1).
- 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:
- Go to Appearance > Theme Editor in your WordPress admin.
- Find the header.php file (usually in the Theme Files list).
- 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>
- Replace
G-XXXXXXXXXXwith your actual Measurement ID. - Click “Update File.”
- 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.
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:
- In GA4, go to Configure > Events.
- Click “Create event” > “Create.”
- Give your event a name (e.g., “contact_form_submission”).
- Define the event parameters: choose condition triggers like “button_click” or “form_start.”
- Set up the trigger: e.g., click on a specific button ID or class.
- Save and then mark the event as a conversion by toggling “Mark as conversion” in the Events list.
- 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:
- If using WooCommerce, install the official Google Listings & Ads plugin or a dedicated GA4 integration plugin like “Google Analytics for WooCommerce.”
- Go to the plugin settings and connect your GA4 property.
- Enable enhanced ecommerce: track product views, add to cart, checkout steps, purchases.
- Test a purchase using the WooCommerce order status: the plugin should fire the “purchase” event with revenue, tax, shipping, and product details.
- 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:
- In GA4, go to Reports > Acquisition > Traffic Acquisition.
- Sort by “Conversions” or “Revenue” (if ecommerce is set up).
- Look at metrics like bounce rate, average engagement time, and conversion rate per source.
- Compare organic, direct, social, paid, and referral traffic.
- For example, you might find that Facebook traffic has a 2.1% conversion rate, while organic search converts at 4.5%.
- 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:
- In GA4, go to Reports > Engagement > Pages and Screens.
- Filter by high traffic pages (top 10–20).
- Look for pages with bounce rate above 70% (or your site average).
- Analyze the page: Is the headline clear? Is the call-to-action prominent? Is the page loading fast?
- Use tools like Google PageSpeed Insights to check load times (aim for under 3 seconds).
- 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
🎯 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)
- Create your Google Analytics account (10 minutes).
- Install Site Kit plugin on your WordPress site (5 minutes).
- Verify tracking is working using GA4 Real-Time report (2 minutes).
- Set up one conversion event — e.g., a contact form submission (15 minutes).
- 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.
💬 Drop “add Google Analytics” in the comments and we’ll send you our free Google Analytics setup checklist — no email required.
💬 Leave a Comment
Your email will not be published. Fields marked * are required.