Home Services PortfolioBlogAboutContact
WhatsApp
Digital Marketing

How to Set Up GA4 and Facebook Pixel on WordPress, Step by Step (2026)

A plain walkthrough for WordPress and WooCommerce: Tag Manager, GA4, Meta Pixel and Conversions API, with the WhatsApp, call and COD order events a Bangladeshi business actually needs.

Amanat Mossalli Taju
Amanat Mossalli Taju Senior Digital Marketer & SEO Expert
Updated Nov 12, 2026 7 min read
How to set up GA4 and Facebook Pixel on WordPress with Google Tag Manager

Forty browser tabs and a plugin for everything. That’s what the internet hands you when you ask how to set up GA4 and Facebook Pixel. Ignore most of it.

The clean order on WordPress is this. Install Google Tag Manager once. Add GA4 and your key events through it. Connect the Meta Pixel and Conversions API. Then test every event before you spend a taka on ads.

Everything below is tuned for how Bangladeshi businesses earn. That means WhatsApp clicks, phone calls, lead forms and WooCommerce orders, cash on delivery included. I reread every Google and Meta page I cite on 11 November 2026.

Before You Start: Four Logins and Two Hours

You need admin access to four things and about two hours. Gather the logins first so you don’t get stuck halfway through.

WordPress adminTo install plugins or add code to the site header.
Google accountTo create Tag Manager and Google Analytics 4 accounts.
Meta Business portfolioAdmin access to Events Manager and your ad account.
Your event listThe actions that count as a lead or sale for your business.

Use a business email you control, not a freelancer’s account. If someone else owns your tracking, your history leaves when they do.

I’m Amanat Mossalli Taju. I’ve led digital marketing for agencies in Bangladesh and abroad. Much of this guide comes from cleaning up tracking I inherited, not from building on a blank site.

One rule above all

Pick one installation method for each tool. Two GA4 plugins, or a pixel added by both a plugin and Tag Manager, will double your numbers.

The Right Order to Set Up Tracking

Container first, then analytics, then events, then the pixel and server tracking. Testing comes last. It is never optional.

Google tag manager setup order for GA4, Meta Pixel and Conversions API
Follow this order and each step builds on the one before.

In a hurry? Do steps 1 to 4 today. Add Conversions API this week, before you scale any Meta campaign.

Plugin or Tag Manager?

Tag Manager for GA4 and custom events. A trusted plugin for WooCommerce order data and the Meta Pixel. That mix gives you control without writing code.

MethodGood forWatch out for
Google Tag ManagerGA4, WhatsApp and call clicks, form eventsNeeds testing in Preview after every change
Plugin onlyFast start for small sitesLess control, and some plugins add tags twice
Meta for WooCommercePixel, catalog sync and shop eventsDo not also add the pixel in GTM
Hard-coded in themeDevelopers with a child themeBreaks on theme updates if done wrong

Whatever you choose, write it down. A one-page note saves hours the next time someone touches the site. I give you a template for that note at the end.

Most guides skip this choice. It’s why so many Bangladeshi sites end up with duplicate tags after two or three freelancers have passed through.

Step 1: Install Google Tag Manager on WordPress

Create a Tag Manager account and a Web container. Then add its two code snippets to every page. After that, new tags go inside Tag Manager instead of into your site.

  1. 1Go to tagmanager.google.com and create an account with your business name.
  2. 2Create a container, choose Web, and enter your domain.
  3. 3Copy the two snippets Google shows you. Your container ID starts with “GTM-“.
  4. 4Paste the first snippet as high as possible inside the <head>, and the second right after the opening <body> tag.

That placement comes from Google’s Tag Manager setup guide. On WordPress, the easiest route is a header and footer code plugin, or a GTM plugin that only asks for your GTM- ID.

Don’t paste code into your theme’s header.php file. A theme update wipes it, and your tracking stops without a word of warning. I’ve found this on more inherited sites than I can count.

This Google Tag Manager setup is a one-time job. Every tag after this lives inside the container.

Three words you will meet all day

  • Tag. A piece of code that sends data somewhere. The GA4 event tag is one.
  • Trigger. The rule that decides when a tag fires. “A click on a wa.me link” is one.
  • Variable. A value the tag or trigger reads. Click URL and order total are two.

That is most of Tag Manager. If a tag misbehaves, the fault is nearly always in its trigger.

Step 2: GA4 Through Tag Manager

Create a GA4 property and add a web data stream. Then load it on every page with a Google tag in Tag Manager. It takes about ten minutes.

  1. 1In Google Analytics, go to Admin and create a property. Set the time zone to Bangladesh and the currency to BDT.
  2. 2Add a Web data stream for your domain. Copy the Measurement ID, which starts with “G-“.
  3. 3Leave enhanced measurement on. It collects several events without extra work.
  4. 4In Tag Manager, add a new tag: Google Tag. Paste your G- ID and use the trigger Initialization – All Pages.
  5. 5Click Preview, open your site, and check that the Google tag fires. Then click Submit to publish.

What enhanced measurement gives you for free

Google’s enhanced measurement page lists seven options. It helps to know them, so you don’t rebuild what already exists.

support.google.com/analytics/answer/9216061
GA4 help page on enhanced measurement events
GA4 enhanced measurement help, captured 12 November 2026
OptionEvent nameWhen it fires
Page viewspage_viewEach page load. Always on
ScrollsscrollThe first time a visitor reaches 90% of the page depth
Outbound clicksclickA click on a link to another domain
Site searchview_search_resultsA results page with a search parameter such as s or q
Video engagementvideo_start, video_progress, video_completeEmbedded YouTube videos with JS API support
File downloadsfile_downloadA click on a link to a common file type
Form interactionsform_start, form_submitFirst touch on a form, and form submission

Two warnings from experience. The automatic form_submit event doesn’t know whether the form succeeded. And a generic “click” tells you nothing about WhatsApp. That’s why you build your own events in step 3.

Change one setting most people miss

Open Admin, then Data retention. Google’s data retention page says a standard property can keep event data for 2 or 14 months. Choose 14.

The setting only affects explorations and funnel reports. Standard reports are not touched. Google also says an increase applies to data you’ve already collected and not yet deleted. So change it on day one, before two months of detail has gone.

New to analytics? GA4 for small business doesn’t need to be complicated. You need the right events and two or three reports, which come further down.

Step 3: Which GA4 Events Should a Bangladeshi Business Track?

The actions that lead to money. For most local businesses that’s WhatsApp clicks, call clicks, form submissions and orders.

Good event tracking in GA4 uses clear names. Google’s recommended events list includes names like generate_lead and purchase. Use those where they fit, and simple custom names for the rest.

support.google.com/analytics/answer/9267735
GA4 recommended events table for online sales, including purchase
GA4 recommended events, captured 12 November 2026
ActionGTM triggerGA4 event nameMeta event
WhatsApp button clickClick URL contains wa.me or api.whatsapp.comwhatsapp_clickContact
Phone number clickClick URL starts with tel:call_clickContact
Lead form sentForm success message or thank-you pagegenerate_leadLead
Messenger clickClick URL contains m.memessenger_clickContact
WooCommerce orderPurchase data on the order-received pagepurchasePurchase

Why Contact for WhatsApp and calls? Meta’s pixel reference describes Contact as a person reaching your business by phone, SMS, email or chat. That is exactly what a WhatsApp tap is.

How to track a WhatsApp click in Tag Manager

1
Turn on click variablesIn Variables, configure built-ins and tick Click URL and Click Text.
2
Create a triggerTrigger type Click – Just Links. Fire on some clicks where Click URL contains wa.me.
3
Create the event tagTag type Google Analytics: GA4 Event. Enter your G- ID and the event name whatsapp_click.
4
Test in PreviewClick your WhatsApp button and check the tag fires once.

Repeat the pattern for calls with Click URL starts with tel:. Plenty of WhatsApp buttons use api.whatsapp.com instead of wa.me, so add a second condition if yours does.

One honest limit. A click is not a conversation. The event tells you someone tapped the button, not that they sent a message. Treat it as a strong signal, and count real enquiries in WhatsApp itself.

Lead form tracking that does not lie

Fire on success, not on the submit click. A submit click also fires when the form throws an error. The best trigger is a thank-you page or the form plugin’s own success event.

I learned to check this early. An IELTS coaching centre in Farmgate hired me after its GA4 showed about 140 leads a month. The front desk had logged about 90 real enquiries. Nobody could explain the gap.

Their trigger fired on the submit button. Every time the form rejected a phone number with a missing digit, GA4 counted a lead. The student then tried again and was counted twice. We moved the trigger to the plugin’s success event.

The next month, GA4 and the front desk were within a handful of each other. Their real cost per lead turned out near Tk 260, not the Tk 170 they had been reporting. Less flattering, but now they could plan with it.

GA4 lead form tracking: firing generate_lead on submit click versus on form success
Fire on success, or failed forms get counted as leads.

If you follow leads up by phone, GA4 has names for the later stages too. The same recommended list includes qualify_lead and close_convert_lead. Few small businesses need them on day one. It’s good to know the names exist before you invent your own.

Mark the events that matter as key events

In GA4, go to Admin, Events, and click the star next to each important event. Google’s help page says a standard property can hold up to 30 key events. The change only applies from that moment on.

The same page says standard reports can take up to 24 hours to show a new key event. Realtime shows it within minutes. So don’t panic at an empty report on day one.

GA4 setup numbers: 14 month data retention, 30 key events and 24 hour reporting delay
Retention, key event limit and reporting delay, from Google’s help pages.

Step 4: WooCommerce Purchase Tracking

Use a WooCommerce tracking plugin that pushes order data into the data layer. Then send it to GA4 as a purchase event. Don’t hand-code it unless you’re a developer.

The data layer is just a list the page keeps for Tag Manager to read. The plugin writes the order into it. Tag Manager picks it up and passes it on.

Google’s missing revenue help page lists what a purchase event needs. Check yours against it.

ParameterWhat to sendCommon local mistake
transaction_idThe WooCommerce order IDLeft empty, so a page reload counts again
valueA plain number, such as 1850Sent as text with a ৳ or Tk symbol
currencyThe three-letter code BDTLeft as USD from a theme demo
itemsEach product with item_id or item_nameMissing, so product reports stay empty

The transaction ID stops GA4 counting one order twice when a buyer reloads the thank-you page. The currency code matters more than it looks. A Tk 1,850 order sent as USD turns into a very exciting revenue report.

The doubled-purchase trap

A shoe seller with a small office in Badda called me one Saturday, very pleased. Ads Manager showed his best week ever, with a return on ad spend near 5. He wanted to triple the budget before Eid.

I asked him to open WooCommerce in another tab. The order list showed about half of what Ads Manager claimed. His theme had a built-in pixel option, switched on. A previous freelancer had also added a pixel plugin. Every purchase fired twice.

Then came the second surprise. About one in five of his real orders were cash on delivery parcels the courier later brought back. Counted on delivered orders, his return on ad spend was closer to 2. He went quiet for a while.

We removed the theme pixel and used order IDs as event IDs. He didn’t triple anything that month. He raised the budget by about a third, only on the two ads whose buyers kept their shoes. Two months later his delivered ROAS was around 2.8, and this time the number was real.

The cash on delivery problem

Many orders here are cash on delivery. The purchase event fires when the order is placed, not when it’s paid. Some of those orders get cancelled, refused at the door or sent back.

So read GA4 and Meta purchase numbers as orders placed. Each month, compare them with delivered orders from your courier or WooCommerce status. That gap is your real return rate. It’s usually bigger than owners expect.

GA4’s recommended list also has a refund event. Some WooCommerce tracking plugins send it when you mark an order refunded. Check whether yours does. If it doesn’t, a monthly spreadsheet comparison is honest enough.

Running an online store? My guide on why SEO matters for e-commerce in Bangladesh pairs well with this setup. Good tracking shows which free traffic sells too.

Rather skip the duplicate-pixel detective work?I set up GTM, GA4, Meta Pixel and Conversions API on WordPress and WooCommerce. Every event gets tested with a real COD order before I hand it over.
See Tracking and Analytics

Step 5: Facebook Pixel on WordPress

Create a dataset in Meta Events Manager, then install it with one method: a plugin or Tag Manager. Meta now calls the pixel a dataset, but the Pixel ID works the same way.

  1. 1Open Meta Events Manager and click Connect data.
  2. 2Choose Web, name your dataset, and note the Pixel ID.
  3. 3Pick your install method. For WooCommerce, Meta’s own plugin, Meta for WooCommerce, connects the pixel and syncs your product catalog.
  4. 4For a non-shop site, add the pixel base code in Tag Manager as a Custom HTML tag on All Pages. A pixel plugin works too.
  5. 5Add standard events: Contact for WhatsApp and call clicks, Lead for forms, Purchase for orders with value and currency.

Meta’s pixel reference is strict about one thing. Purchase must carry both currency and value. Send BDT and the order total, or the event is of little use to the ad system.

A word on the Meta for WooCommerce plugin. Its plugin listing names Facebook as the author. The WordPress.org page showed 400,000+ active installations when I looked on 11 November 2026. It asks for WordPress 5.6 or higher and PHP 7.4 or higher.

The same page showed a rating of 2.1 out of 5 from 480 reviews. Several recent reviews complain of heavy server load during catalog sync. So test it on cheap shared hosting before you trust it. If your site slows down, a lighter pixel plugin is a fair choice. Just keep to one method.

A simple Meta Pixel setup on WordPress is enough to start ads. A browser pixel alone now misses a share of conversions, though. Hence step 6.

Step 6: Add the Conversions API

The Conversions API sends events from your server straight to Meta. It catches conversions the browser pixel misses because of ad blockers, browser limits and iPhone privacy settings.

Since iOS 14.5, Apple’s App Tracking Transparency lets iPhone users stop apps tracking them across other apps and websites. Server events fill some of that gap.

Three ways to add it

Conversions API vs pixel only comparison for Meta Pixel setup on WordPress
Run both together, with matching event IDs, so nothing counts twice.
  • Plugin: Meta for WooCommerce and several pixel plugins can send server events for you.
  • Conversions API Gateway: Meta’s hosted option, set up from Events Manager on a cloud account.
  • Server-side Tag Manager: the most control, but needs a developer and hosting.

For most small shops here, the plugin route is enough. I only move a client to a server container when ad spend is large enough to justify the hosting bill.

Deduplication: the step that prevents double counting

When the pixel and the server both send the same purchase, Meta must know it’s one order. Meta’s developer docs say the browser eventID must match the server event_id, and the event names must match. Meta deduplicates matching events that arrive within 48 hours.

On the browser side, the ID travels as the fourth argument of the pixel call. It looks like this: fbq('track', 'Purchase', {value: 1850, currency: 'BDT'}, {eventID: 'order_10234'}).

For a WooCommerce order, the order ID makes a good event_id. A good plugin does this for you. In Events Manager, the event overview shows whether deduplication is working.

How Meta Pixel and Conversions API deduplication works with a matching event ID
Same event name, same ID, inside 48 hours: one purchase.

Event match quality, in one minute

Events Manager gives each event a match quality score out of 10. Meta’s Conversions API best practices explain why it matters. Only matched events can be used for attribution and ad delivery.

The score rises when the server event carries customer details. Meta names email, phone, first and last name, and IP address as useful ones. They must be hashed before sending. Plugins and Meta’s own SDKs do the hashing for you.

For a cash on delivery shop, phone number is your best asset. Every order has one. Make sure the checkout phone field reaches the server event.

Tell customers what you collect. Add a plain line to your privacy policy saying order details are shared with ad platforms for measurement.

How Do You Know It Actually Works?

Test every event yourself before you spend on ads. Each platform gives you free tools for it.

GTM PreviewTag Assistant shows which tags fired on each click and which did not.
GA4 DebugView and RealtimeWatch your test events arrive with the right names and values.
Meta Pixel HelperChrome extension that shows browser pixel events and duplicate pixels.
Meta Test EventsShows browser and server events, so you can check Conversions API.
Tracking setup checklist for GA4, Google Tag Manager and Meta Pixel on WordPress
Tick all ten before you launch or scale any campaign.

Place a real test order with cash on delivery, then cancel it. Check that GA4 and Meta each show one purchase with the right value. See two? Find the second install and remove it.

Meta’s best practices page adds a useful tip. Use your own real customer details for test orders. Unmatched test events may be discarded, and you’ll think the setup is broken when it isn’t.

Why GA4, Meta and WooCommerce Never Show the Same Number

They count different things. Once you know which, the gaps stop being scary and start being useful.

What you seeUsual reasonWorry?
GA4 a little below WooCommerceAd blockers, or buyers closing the tab before the thank-you pageNo. Small gaps are normal
GA4 far below WooCommercePurchase tag broken, or a payment gateway that never returns the buyerYes. Test a real order
Meta above WooCommercePixel installed twice, or deduplication missingYes. Fix before scaling
Meta above GA4 for the same adsMeta counts ad views and its own time window. GA4 uses a different attribution modelNo. Different rules
All three above delivered ordersCash on delivery returns and cancellationsExpected. Track the gap monthly

Pick one source of truth for money. For a shop, that is delivered orders. Everything else is a signal for steering ads.

Tracking Mistakes I Find on Inherited Sites

Most broken tracking comes from the same few mistakes. Check for these on any site you take over.

  • Two installs of the same tool, such as a theme option plus a plugin.
  • Firing the lead event on button click instead of form success.
  • No transaction_id on purchases, so page reloads count as new orders.
  • Wrong currency, sending USD values for taka orders.
  • Accounts owned by a freelancer instead of your business.
  • Never testing after a theme or plugin update.
  • Trusting placed orders as sales when many are cash on delivery.

Tracking also needs a site that loads properly. If your WordPress site is slow or stuffed with old plugins, my WordPress development service can clean it up first. For the server side in more depth, read my guide to the Facebook Conversion API.

What Should a Small Business Check in GA4 Each Week?

Three things: where visitors came from, which key events happened, and which pages led to them. Leave the rest alone until you need it.

  • Traffic acquisition report: which channels bring visits and key events.
  • Key events by source: did Facebook, Google or organic search bring the WhatsApp clicks?
  • Landing pages: which pages turn visitors into leads, and which leak them.

Pair this with Search Console to see free search traffic. My guide on how to increase organic traffic in Bangladesh shows what to do with those numbers.

Would one page of numbers be easier than GA4?I build the tracking and a one-page weekly report showing leads and sales by channel. You open it on Monday morning and see where the money worked.
Book a Free Call

FAQ: Setting Up GA4 and the Facebook Pixel

Do I need Google Tag Manager to set up GA4?
No, but it helps. You can add GA4 with a plugin or the Google tag directly. Tag Manager lets you add WhatsApp, call and form events later without touching site code.
Can I install the Facebook Pixel with Google Tag Manager?
Yes. Add the pixel base code as a Custom HTML tag on all pages, then add event tags for Contact, Lead and Purchase. Just don’t install it with a plugin as well.
Is the Conversions API necessary for small businesses?
It isn’t required to run ads, but it’s well worth it once you spend regularly. It catches conversions the browser pixel misses. Set up deduplication with a matching event ID so orders aren’t counted twice. Meta deduplicates matching events received within 48 hours.
How do I track WhatsApp clicks in GA4?
In Tag Manager, create a Click – Just Links trigger where Click URL contains wa.me or api.whatsapp.com. Attach a GA4 Event tag named whatsapp_click, test it in Preview, then mark it as a key event in GA4.
Why does GA4 show fewer orders than WooCommerce?
Ad blockers, consent tools and buyers who close the page before the thank-you page loads can all stop events. Small gaps are normal. Large gaps usually mean a broken purchase tag.
Why does Meta show more purchases than I received?
Usually the pixel is installed twice, deduplication is missing, or Meta is counting view-through conversions. Cash on delivery returns widen the gap further. Check with Pixel Helper and Test Events, then compare with your delivered order list.
How long does tracking setup take?
A basic GTM, GA4 and pixel setup takes a few hours. Adding WooCommerce purchase data, Conversions API and full testing usually takes a day or two.

Track First, Spend Second

That’s how to set up GA4 and Facebook Pixel in a way you can trust. It isn’t glamorous work. Every good ad decision rests on it anyway.

Before you close this tab, make the note I promised. One page, kept where your team can find it. Fill it in today, even if half the boxes say “not yet”.

ItemWrite down
GTM container IDGTM-… and who has admin access
GA4 Measurement IDG-… and the property owner email
Meta dataset (Pixel) IDThe ID, and which business portfolio owns it
Install methodFor example: GA4 via GTM, pixel via one named plugin
Key eventswhatsapp_click, call_click, generate_lead, purchase
Conversions APIOn or off, which method, and what the event_id is
Last full testDate, who did it, and the test order number

Update the last row after every theme or plugin update. The day that row is older than your last update is the day your numbers stop deserving trust.

Amanat Mossalli Taju
Written by

Amanat Mossalli Taju

Senior Digital Marketer & SEO Expert, Dhaka, Bangladesh

I have grown 235+ brands over more than seven years with SEO, Google and Meta Ads, server-side tracking, WordPress and AI automation. Half of my clients are in the UK, USA, Australia and Canada. Everything I write here comes from real client work.

About me

Want this done for your business?

Book a free 15-minute call. I look at your site and ads before we talk, so you leave with clear next steps.

WhatsApp Me
Call 01782-790018