Built for Shopify & WooCommerce · Tracking checked every 30 minutes.

How to install Facebook Pixel on WooCommerce with Google Tag Manager (every standard event)

Abir Molla
Abir MollaNov 20, 2026 · 11 min read
How to install Facebook Pixel on WooCommerce with Google Tag Manager (every standard event)Video · 26:51 · plays from YouTube

To install the Facebook Pixel on WooCommerce with Google Tag Manager, you first give the store a data layer (a plugin such as GTM Kit adds one, along with the container code), then build one Meta Pixel tag in Google Tag Manager per event: PageView, ViewContent, AddToCart, InitiateCheckout, AddPaymentInfo and Purchase. Each tag reads the product and order details from the data layer, and the Purchase tag also sends the customer's details for advanced matching. Before you publish, make sure no other plugin is sending the same pixel, or every sale gets counted twice.

The video above shows the full build on a WooCommerce store in about 27 minutes, including two mistakes I made and fixed while testing. This post is the written version: the steps in the same order, what goes in each tag, and what to check. If your store is on Shopify instead, here is the Shopify version of this setup.

Why use Google Tag Manager for the pixel on WooCommerce

The quick way to get a Facebook Pixel on WooCommerce is a plugin. Meta has its own, now called Meta for WooCommerce (it used to be Facebook for WooCommerce), and there are many others. They work, but each one decides for you what every event sends, and when numbers look wrong you have little to look at.

Google Tag Manager puts that control in one place. Your tags, triggers and variables live in a container you can inspect in Preview mode, you choose exactly which parameters go with each event, and changing something doesn't mean touching your theme. It's also the base you build the Conversions API on later.

What you need

  • A Meta Pixel ID. Meta now calls the pixel a dataset in Events Manager; the ID works the same way. This guide shows where to find it.
  • A Google Tag Manager account with a Web container.
  • Admin access to WordPress, to install a data layer plugin.
  • A WooCommerce data layer. This is what tells Google Tag Manager which product was viewed, what went into the cart and what was ordered. In the video I use the free GTM Kit plugin.
  • The Meta Pixel Helper Chrome extension, for testing.

Before you start: one pixel, one source

This is the trap that catches most WooCommerce stores. If Meta for WooCommerce or another pixel plugin is already sending events to the same pixel, adding your Google Tag Manager tags means Meta receives two copies of each event. They carry different event IDs, so Meta can't tell they're the same, and your purchases look doubled.

Meta for WooCommerce installs the pixel and, according to WooCommerce's own documentation, has the Conversions API built in (WooCommerce, Meta for WooCommerce). So check three places before you go on:

  • Plugins. Look for Meta for WooCommerce, PixelYourSite, Pixel Manager or any plugin with "pixel" or "Conversions API" in its description.
  • Your theme. Old pixel code pasted into the header, or into a "header and footer scripts" plugin.
  • Google Tag Manager itself. An older container may already have a Meta tag in it.

Pick one source per pixel. If you want to keep Meta for WooCommerce for its catalog sync, WooCommerce documents a code filter that turns off the plugin's pixel and Conversions API while leaving the rest of it working. Ask your developer to add it, or remove the plugin if you don't need it.

Step 1: get your Meta Pixel ID

If you've run Meta ads before, you almost certainly have a pixel already. Use it. A new pixel starts with no history.

If you need one, open Events Manager in Meta Business Suite, click Connect data, choose Web, then Create new dataset, give it a name and create it. Copy the ID. You'll paste it into Google Tag Manager in Step 5.

Step 2: create your Google Tag Manager container

Go to tagmanager.google.com and create an account with your business name and country. Name the container after your website, choose Web as the platform, accept the terms, and Google Tag Manager gives you a container ID starting with GTM-.

You don't need to paste the container code into your theme. The plugin in the next step adds it for you.

Step 3: add a WooCommerce data layer

The data layer is a small object on each page that holds what the visitor just did: the product they're viewing, the items in the cart, the order they placed. Google Tag Manager reads it, and your pixel tags pass it on to Meta.

In the video I install GTM Kit. In WordPress, go to Plugins → Add New, install and activate GTM Kit, paste your GTM- container ID into its settings and save. GTM Kit adds the Google Tag Manager container code to the site and pushes WooCommerce events into the data layer in the GA4 ecommerce format: view_item, add_to_cart, begin_checkout, add_payment_info, purchase and more (GTM Kit on WordPress.org). Other data layer plugins work too; only the variable names may differ.

Then check it. In Google Tag Manager, click Preview, enter your store's address and connect. Open a product, and in the Preview panel you should see a view_item event. Click it and look at the data layer: an ecommerce object with an items array holding the item ID, item name, category, price, plus the currency and value. Those are the values your pixel will use.

Step 4: create the variables and triggers

Meta and the data layer describe products differently. The data layer has an items array in Google's format; Meta wants contents, content_ids, content_name, num_items and value. So you need variables that translate one into the other.

First, create a Data Layer Variable called ecommerce.items. Then, in the video, I import a variable template (Meta Parameter Generator) under Templates → Variable templates → New → Import, and use it to build one variable per Meta parameter from that items array:

  • contents: item ID, quantity and price for each product. Meta needs this for catalog ads.
  • content_ids: the item IDs.
  • content_name: the item names.
  • num_items: the total quantity. Look at the begin_checkout event in Preview to find the quantity key, because view_item doesn't show one.
  • value: the price total.
  • content_category is optional. I skip it in the video.

Add a few plain Data Layer Variables too:

  • ecommerce.currency for the currency.
  • ecommerce.transaction_id for the order ID on Purchase.
  • The customer's email, phone, first and last name, city, state, zip code and country for the purchase, from wherever your data layer puts them.

Two more make life easier:

  • A Constant variable with your Pixel ID, so you type it once instead of in six tags.
  • An external ID variable. In the video I use a Custom JavaScript variable that creates an ID for the visitor (the code is linked in the video description). Meta describes the external ID as your own unique ID for a person, such as a user ID or a cookie ID, and it helps match events to people.

Keep them tidy in a folder, such as "Meta Pixel variables".

Triggers. Create a Custom Event trigger for each data layer event you'll use: view_item, add_to_cart, begin_checkout, add_payment_info and purchase. The event name has to match the data layer exactly. PageView uses the built-in All Pages trigger.

Step 5: build the Meta Pixel tags

Create a new tag and choose a Facebook Pixel tag template from the Community Template Gallery. Every tag gets the same base:

  • Pixel ID: your constant variable.
  • Event: the standard event for this tag.
  • Advanced matching: turned on, with the external ID variable.
  • Event ID: a variable that creates a new unique ID for each event. The pixel works without it, but the Conversions API needs it later, because Meta pairs a browser event and a server event only when they share the same event name and event ID (Meta, handling duplicate pixel and Conversions API events). Adding it now saves you rebuilding every tag.

Then, tag by tag:

  • PageView: the base only. Trigger: All Pages.
  • ViewContent: add the object properties content_type, content_name, content_ids, contents, value and currency. Trigger: view_item.
  • AddToCart: the same properties. Trigger: add_to_cart.
  • InitiateCheckout: the same, plus num_items. Trigger: begin_checkout.
  • AddPaymentInfo: content_type, contents, value and currency. Trigger: add_payment_info.
  • Purchase: the same properties plus order_id from ecommerce.transaction_id. Trigger: purchase.

For content_type, use product when your products have no variations, or product_group when they come in sizes or colours. A constant variable for it saves typing the word in every tag.

On the Purchase tag, turn on advanced matching with the full set of customer details: email, phone, first name, last name, city, state, zip code, country and external ID. Meta's documentation says the pixel hashes these values with SHA-256 before they're sent (Meta, advanced matching). The more of them you send, the more purchases Meta can tie to real people.

Step 6: publish the container

Click Submit, give the version a name you'll recognise later, such as "Meta Pixel v1", and Publish. You'll likely publish again after testing; that's normal.

Step 7: test in Preview, the Pixel Helper and Events Manager

Use three checks together.

  1. Google Tag Manager Preview. Connect to your store and go through it as a buyer: open a product, add to cart, start checkout, choose a payment method, place a test order. Each Meta tag should show under Tags Fired on its own event, and nowhere else.
  2. Meta Pixel Helper. On each page it shows which events fired and the parameters they carried: contents, value, currency, external ID.
  3. Events Manager. Open your pixel and watch the events arrive. Click Purchase and check the value, currency, content IDs, contents, order ID and the customer details.

Testing caught two mistakes in the video, and both are common:

  • A tag on the wrong trigger. My ViewContent tag was firing on the wrong event. Open the tag, set the trigger to view_item, publish again.
  • The order ID was missing on Purchase. The order_id property wasn't pointing at the right variable. Setting it to ecommerce.transaction_id fixed it.

I also saw some events fire twice. In the video I fix it by setting the tag's firing option to Once per page under Advanced Settings. That works for Purchase. For AddToCart, look first at why the data layer pushes the event twice, because "once per page" also blocks a real second add to cart on the same page.

The case study in the video

At the end of the video I show Events Manager for a WooCommerce client where I set up the pixel this way. PageView and the shopping events are all arriving with their parameters. That store also shows Event Match Quality scores, because I set up the Conversions API for it as well, which is the step I recommend after this one.

Next step: add the Conversions API

What you've built runs in the visitor's browser. Ad blockers, browser privacy settings and iOS rules stop some of those events from reaching Meta. The Conversions API sends the same events from a server, and because each tag already has an event ID, Meta can keep one copy of each. The full setup is here: set up the Facebook Conversions API with Google Tag Manager.

Common mistakes

A pixel plugin is still active. Meta for WooCommerce or another pixel plugin sending the same pixel means two copies of every event with different IDs. Turn its pixel off or remove it.

The variable names don't match your data layer. GTM Kit uses ecommerce.items, ecommerce.currency and ecommerce.transaction_id. If your plugin uses different names, your tags send empty values. Check the real names in Preview.

A trigger listens for the wrong event. begin_checkout is not initiate_checkout. The trigger must use the exact name the data layer pushes.

No event ID on the tags. It doesn't matter until you add the Conversions API, then every purchase can count twice.

A fixed value on Purchase. The value must come from the data layer, so each order sends its own total and currency.

The Pixel ID typed by hand in every tag. One typo sends events to the wrong pixel. Use a constant variable.

Questions people ask

Can I install the Facebook Pixel on WooCommerce without the Meta for WooCommerce plugin?

Yes. That's what this setup does. A data layer plugin feeds Google Tag Manager, and the pixel runs from Google Tag Manager. If you keep Meta for WooCommerce for other reasons, turn its pixel off so you don't send events twice.

Does this work on WordPress sites without WooCommerce?

The pixel, PageView and the testing steps are the same. The shopping events need a store, so on a lead-gen site you'd send events such as Lead or CompleteRegistration from your form instead.

Which events should a WooCommerce store send to Meta?

PageView, ViewContent, AddToCart, InitiateCheckout and Purchase cover what most stores need. AddPaymentInfo is optional. Purchase matters most, so give it the most care: real value, currency, order ID and customer details.

Why does Events Manager show an event twice?

Either two sources send the same pixel (a plugin plus Google Tag Manager), or the data layer pushes the event twice on one page. Check plugins first, then watch the event in Google Tag Manager Preview.

Do I need the Conversions API too?

For most stores running Meta ads, yes. The browser pixel misses some events, and the Conversions API sends them from a server. The event ID you added here is what stops them being counted twice.

Where KiteTrack fits

KiteTrack takes this setup the rest of the way on WooCommerce. It runs your own tracking server on your store's subdomain and sends your purchases to Meta through the Conversions API next to the pixel, with one event ID so each sale counts once. The same server sends to Google Ads, GA4 and TikTok, customer details are hashed before they leave it, and your tracking is checked every 30 minutes, so a broken event becomes an alert instead of a surprise. See how it works for Meta on WooCommerce.

Not sure whether your pixel is sending what it should, or sending it twice? Start with the free Tracking Check. It looks at your site in about two minutes, no signup. If you'd rather talk it through, book a call with me.

Sources

Get tracking tips by email

Short, practical fixes for Meta, Google Ads and GA4, from Abir.

You’re in. First tip lands soon.

Abir Molla
Written by Abir Molla

Tracking specialist. He builds and runs KiteTrack, and explains tracking on YouTube.

Keep reading

Let your ads see every sale.

30-day money-back guarantee · free migration · cancel any time