Meta Pixel Tracking Setup for WooCommerce
Quick answer: Use the free container builder wizard to select Meta Pixel and your events, enter your tracking ID, then import the generated file into Google Tag Manager - no manual tag setup needed for any of the 23 events below.
Facebook/Instagram Pixel base code and standard events, generated as Custom HTML. This platform does not have a native GTM tag type, so the container wraps its base code in a Custom HTML tag.
Build my Meta Pixel container →
Events you can track
ecommerce events
- Meta Pixel Page View event setup
- Meta Pixel View Item event setup
- Meta Pixel View Item List event setup
- Meta Pixel Add to Cart event setup
- Meta Pixel Remove from Cart event setup
- Meta Pixel Begin Checkout event setup
- Meta Pixel Add Payment Info event setup
- Meta Pixel Purchase event setup
- Meta Pixel Refund event setup
- Meta Pixel Add to Wishlist event setup
- Meta Pixel Coupon Applied event setup
- Meta Pixel Search event setup
- Meta Pixel Login event setup
- Meta Pixel Sign Up event setup
engagement events
- Meta Pixel Form Submission event setup
- Meta Pixel Lead event setup
- Meta Pixel Phone Click event setup
- Meta Pixel WhatsApp Click event setup
- Meta Pixel Email Click event setup
- Meta Pixel Outbound Click event setup
- Meta Pixel Scroll event setup
- Meta Pixel File Download event setup
- Meta Pixel Calendly Booking Scheduled event setup
By Humayun Kabir Naim — Last updated: 7 November 2026
Quick answer
To track WooCommerce sales in Meta through Google Tag Manager, reuse the dataLayer you already built for GA4: a plugin such as GTM4WP pushes every shop action into the dataLayer, and GTM turns those pushes into Meta standard events. You need a base Pixel tag on every page, one event tag per Meta event (ViewContent, AddToCart, InitiateCheckout, Purchase), and variables that translate the GA4-style ecommerce object into Meta's parameters — content_ids, value, and currency. If you later add the Conversions API, the same event must carry the same event_id from both the browser and the server, or Meta counts the purchase twice.
What gets tracked
Meta does not understand GA4 event names, so the table below is the translation.
| WooCommerce dataLayer event | Meta standard event | Why it matters |
|---|---|---|
view_item | ViewContent | Builds product-view audiences and feeds dynamic ads |
add_to_cart | AddToCart | The start of every retargeting funnel worth having |
begin_checkout | InitiateCheckout | Shows where checkout actually starts, not just where it ends |
purchase | Purchase | The conversion your ads optimise for |
view_item_list | ViewContent (list) | Optional; useful for category-level audiences |
add_payment_info | AddPaymentInfo | Optional; marks shoppers who reached payment |
search (if pushed) | Search | Optional; powers search-based audiences |
Each event carries parameters Meta uses for matching and reporting: content_ids (the product SKUs), content_type (product), value, and currency. Purchase also needs the order's transaction_id — not as a Meta parameter, but as the deduplication key explained below.
Deep dives: Purchase, Add to Cart, Begin Checkout. If GA4 is not set up yet, do that first — the same dataLayer feeds both: WooCommerce + GA4. See all options on the WooCommerce hub.
Before you start
- GTM installed on the store, and the dataLayer working. One web container, and a dataLayer source (GTM4WP with WooCommerce enhanced ecommerce enabled) pushing the events above. If your GA4 hub setup already works, this is done — Meta reads the same pushes.
- A Meta dataset (Pixel) and its ID. In Events Manager: Connect Data Sources → Web → Meta Pixel. Meta now calls it a dataset; the dataset ID is the same number as the old Pixel ID.
- One sender only. Disable every other Facebook/WooCommerce tracking integration first: the official Facebook for WooCommerce plugin, any all-in-one pixel plugin, a Pixel snippet in the theme header, or a Pixel tag in an old container. Two integrations sending the same purchase is the most common cause of inflated conversion counts, and the theme snippet is the one people miss because it never shows in the plugin list.
- Admin access to GTM and Events Manager, to publish the container and check Test Events.
Route 1: Use the free TagManagerBuilder container
Open the GTM Container Builder, choose WooCommerce, then Meta, and tick the events you want. Enter your Pixel ID, download the JSON, then in GTM go to Admin → Import Container and choose Merge → Overwrite conflicting tags, triggers, and variables. Test with the testing section below before publishing.
Note: the container does not replace GTM4WP. The container holds the tags that read the dataLayer; the plugin creates it. You need both — and if you already imported the WooCommerce × GA4 container, import this one into the same workspace so the two share the dataLayer variables.
Route 2: Build it manually in GTM
Step 1 — The base Pixel tag
Tags → New, choose the Meta Pixel template from the Community Template Gallery (or a Custom HTML tag if you prefer raw code), enter your Pixel ID, and set the trigger to All Pages. This tag initialises the Pixel and sends PageView on every page. If a Pixel tag already exists in this container, keep that one and skip this step — two base tags double every event.
Step 2 — Variables that translate the dataLayer into Meta parameters
Meta wants SKUs in content_ids and a contents array; the dataLayer holds ecommerce.items with item_id, price, and quantity. Create these in Variables → New:
- Data Layer Variable (Version 2) for
ecommerce.value,ecommerce.currency, andecommerce.transaction_id. - Custom JavaScript Variable called
Meta Content IDsthat turns the items array into a SKU list:function() { var items = {{DLV - ecommerce.items}} || []; return items.map(function(item) { return item.item_id; }); } - Custom JavaScript Variable called
Meta Contentsthat builds the array Meta expects:function() { var items = {{DLV - ecommerce.items}} || []; return items.map(function(item) { return { id: item.item_id, quantity: item.quantity || 1 }; }); }
If item_id is empty in Preview, your dataLayer plugin is sending product IDs in a different field — check the push before blaming the tag.
Step 3 — One event tag per Meta event
Create a tag of the Meta Pixel template type (or a Custom HTML tag with an fbq() call) for each row of the mapping table. Each tag needs three things: the Meta event name, the parameters from Step 2, and a trigger on the matching dataLayer event.
For the Purchase tag, the parameters are value (from ecommerce.value), currency, content_ids (the Custom JS variable), content_type set to the fixed text product, and — this is the detail that saves you later — an eventID equal to the transaction_id. In an fbq() call that looks like:
fbq('track', 'Purchase', {
value: 129.99,
currency: 'USD',
content_ids: ['SKU-123'],
content_type: 'product'
}, { eventID: '1042' });
The same pattern holds for the other events: ViewContent takes content_ids, content_type, value, and currency; AddToCart adds the contents array; InitiateCheckout adds num_items.
Step 4 — Triggers on the dataLayer events
Attach a Custom Event trigger to each tag, matching the dataLayer event name: view_item for ViewContent, add_to_cart for AddToCart, begin_checkout for InitiateCheckout, purchase for Purchase. Do not trigger Meta events on clicks or page views — the dataLayer event is the only reliable signal that the shop action actually happened, and it carries the product data with it.
What a correct purchase push looks like
Compare your thank-you page push against this, field by field. It is the same push the GA4 hub uses — Meta reads the same object, through different variables:
dataLayer.push({ ecommerce: null }); // clear the previous object first
dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "1042",
value: 129.99,
tax: 10.00,
shipping: 5.00,
currency: "USD",
items: [{
item_id: "SKU-123",
item_name: "Trail Running Shoes",
item_category: "Footwear",
price: 119.99,
quantity: 1
}]
}
});
Two details catch people out: value, price, and quantity must be numbers, not text, and the clearing push matters — without it, items from an earlier add_to_cart can leak into the purchase.
Test it: GTM Preview and Meta Test Events
- Click Preview in GTM and open your store in Tag Assistant.
- Shop like a customer: product page, add to cart, checkout, and a test order.
- In the Preview timeline, click
view_item,add_to_cart, thenpurchase. Your Meta tags should sit under Tags Fired each time, with the right parameters visible on the tag. - In Events Manager, open Test Events, enter your store URL, and repeat one purchase. The event should arrive within seconds showing its parameters, the source (Browser), and its Event Match Quality score. If it is missing here, it never left the browser — fix the tag, not the ad account.
- Only then click Submit in GTM to publish.
Conversions API and deduplication — add this before you scale spend
The Pixel alone loses events to ad blockers, browser privacy settings, and dropped connections. The Conversions API (CAPI) sends the same events from your server, and Meta recommends running both. But running both without deduplication counts every purchase twice, inflates reported conversions, and corrupts optimisation.
The rule is simple and unforgiving: the Pixel event and the CAPI event for the same action must carry the same event_name and the same event_id, and the second copy must arrive within 48 hours of the first. Meta keeps the first copy it receives and discards the other. For Purchase, use the transaction_id as the event_id on both sides — it is unique per order and already exists. For other events, generate the ID once at the moment the action happens and pass that single value to both the browser call and the server payload. Generating IDs independently on each side is the most common deduplication failure.
If you use the Meta Pixel template in GTM, the server side is a separate step: a server GTM container with the Meta CAPI tag, or Meta's one-click web CAPI option in Events Manager. Either way, verify in Test Events that each purchase shows two sources merged into one event, not two separate events. Full walkthrough: Server-Side Tracking for WooCommerce.
WooCommerce-specific troubleshooting
Events fire in Preview but never appear in Events Manager. Check the Pixel ID first — one wrong digit sends everything to a dataset nobody watches. Then check that the base Pixel tag fired on the same page view; an event tag without a working base tag sends nothing. Finally, test with an ad blocker disabled: a blocked Pixel looks exactly like a broken tag.
Purchase is counted twice. Look for two senders, not two triggers: a second plugin, a theme snippet, or a hardcoded Pixel may send purchase alongside GTM. Search your page source for your Pixel ID — it should appear only through GTM. If you run Pixel + CAPI, check the eventID/event_id match instead; a mismatch here also doubles the count.
AddToCart is missing but Purchase works. AJAX add-to-cart is the usual suspect: the cart updates without a page load, and some dataLayer plugins only push the event on a full page view. Test the exact add-to-cart button in Preview and watch whether the add_to_cart push appears.
Value is $0 or missing. Inspect value and currency on the purchase push. A formatted string such as "$129.99", a missing currency, or a zero-value test order all cause this. Fix the format in the dataLayer, not in Events Manager.
Audiences are empty even though events arrive. Check content_ids: if they are product names, internal IDs, or empty, Meta cannot match them to your catalogue. The IDs in the event must be the same IDs in the catalogue feed, and content_type must be product. Fix the ID mapping in the variable, not in the catalogue.
Event Match Quality is low. Meta scores how well the customer information you send matches its accounts, from 1 to 10. Sending hashed contact details with the event (Advanced Matching, with consent) raises the score. Low match quality does not mean the event is broken — it means fewer events can be attributed to people.
Next steps once this is clean: WooCommerce + Google Ads from the same dataLayer, then Consent Mode v2 so consent choices reach Meta correctly.
Frequently asked questions
Do I still need GTM4WP if I use the TagManagerBuilder container?
Yes. The container holds the tags, triggers, and variables that read the dataLayer; GTM4WP creates the WooCommerce dataLayer. Without a dataLayer source, the Meta tag fires with no product or order data to send.
Should I use the Pixel, CAPI, or both?
Both, deduplicated. The Pixel catches what the browser sees; CAPI catches what the browser misses. Either one alone leaves gaps, and both without matching event_id values double-counts. If you must choose one to start, start with the Pixel — then add CAPI before scaling spend.
My events arrive but my ads still do not optimise — why?
Check that the Purchase event carries value and currency, and that Events Manager shows it as a conversion event the ad account can use. An event with no value optimises for volume, not revenue.
Does this work with the WooCommerce block checkout?
Core events — view, cart, purchase — generally do, if your dataLayer plugin supports the block checkout. The checkout-step events are fragile, because shipping and payment update in place. Test those in Preview on your own store before relying on them.
Can I track refunds in Meta?
Meta has no standard refund event for the Pixel. Handle refunds by excluding refunded orders from reporting, or by sending a custom event from the server. Do not send a negative-value Purchase — it will not behave the way you expect.
Does Consent Mode change what Meta receives?
Yes. Visitors who decline marketing consent should not have the Pixel fire at all, and server events must respect the same choice. Your banner must actually send consent signals to GTM, or every visitor will look like a refusal — or worse, like consent that was never given.