WooCommerce6 min read1 view

WooCommerce Facebook Pixel Purchase with GTM

Track WooCommerce Purchase with GTM. Map purchase to Purchase, inspect product data and compare the event in Meta.

Watch on YouTube

Jump to the code

The short answer

Track WooCommerce Purchase activity by mapping purchase from GTM4WP to Meta's Purchase event in Google Tag Manager. The tutorial export uses a standard Meta event for this mapping. This guide is for store owners and implementers who need to verify the event and its product data.

  • GTM trigger: purchase; Meta event: Purchase.
  • If an existing integration sends this event, inspect it before adding another tag.
  • Use a staging store and a test GTM container.
  • Steps and settings checked against linked documentation and tutorial files on 25 October 2026.

Ask an assistant

ChatGPTClaudePerplexity

FREE CALL

30 MIN

Meta stopped counting your leads? Get them counted again.

  1. Pick a time
  2. Check your Meta account with Hassan
  3. See what to do next

On a free 30-minute call, Hassan checks your Meta account with you and shows you what to do next.

Book my free recovery callFree 30-minute call with Hassan.

Not ready to talk? Run a free check

How do I prepare GTM for WooCommerce purchases?

Use purchase as the GTM source and Purchase as the Meta destination. GTM4WP's event referencegtm4wp.com lists purchase among its WooCommerce ecommerce events. Compare the event to the completed test order, including the meaning of value, tax and shipping.

1. Connect the test store to GTM

Use one installation method.

  1. On a staging WooCommerce store, install and activate GTM4WP by Thomas Geigerwordpress.org.
  2. In its settings, enter the intended test container ID.
  3. Enable container output.
  4. Start GTM Previewsupport.google.com and connect the staging URL.

Done when Tag Assistant identifies that container and shows the page events.

Which Facebook Pixel should receive Purchase?

Use the intended existing pixel ID in a separate PageView tag, then verify that base event before adding the conversion tag.

2. Check the PageView tag

Do not add a second base tag if one already sends PageView.

  1. Create a separate base tag from the template in Meta's GTM repositorygithub.com.
  2. Enter your intended pixel ID.
  3. Set the standard event to PageView.
  4. Set All Pages as its trigger.
  5. Apply the store's consent controls before testing.

Done when the preview session shows the intended PageView tag and you can identify the same pixel in Events Manager.

How do I inspect the WooCommerce purchase data layer?

Enable the GTM4WP ecommerce integration, perform the action and inspect purchase in Preview.

3. Enable and inspect ecommerce data

  1. In GTM4WP's WooCommerce settings, enable Track e-commerce. The plugin settings referencegtm4wp.com locates older versions under Integration > WooCommerce.
  2. Complete a test order.
  3. Record its order ID and totals.
  4. In GTM Preview, select purchase.
  5. Inspect its data layer, the values a page makes available to tags.

Done when the event exists and its ecommerce fields agree with the action you performed.

How do I map and test Meta Purchase?

Use ecommerce.transaction_id, with an underscore. The existing Purchase export uses that path, as does Google's purchase exampledevelopers.google.com; the earlier prose incorrectly used transactionId.

The original Facebook Parameter Generator repository is archivedgithub.com. To retain this tutorial's mapping, import its template into the test container, following Google's template import instructionsdevelopers.google.com.

  1. Download the generator's template.tplraw.githubusercontent.com.
  2. In the test container, go to Templates > Variable Templates > New.
  3. Use More actions > Import.
  4. Select the file and save.

Done when Facebook Parameter Generator appears as a variable template with the documented array and key fields.

4. Map the event fields

The Purchase tutorial export contains the original Facebook Parameter Generator mappings: input ecommerce.items, ID key item_id, name key item_name, price key price, and quantity key quantity.

  1. Create Version 2 Data Layer Variables for the paths in the table below; Google describes how these variables read data-layer valuessupport.google.com.
  2. Create a Facebook Parameter Generator variable for each output: contents, IDs, name and number of items.
  3. In each generator variable, keep the export's inputs listed above.

value

Input
ecommerce.value
Check
The value on this event

currency

Input
ecommerce.currency
Check
The currency on this event

contents / content_ids / content_name

Input
ecommerce.items
Check
Facebook Parameter Generator outputs

num_items

Input
ecommerce.items
Check
Generator quantity total

content_type

Input
Literal product
Check
The tutorial export's setting

order_id

Input
ecommerce.transaction_id
Check
Order identifier

tax / shipping / affiliation / coupon

Input
Matching ecommerce fields
Check
Keep the export's mappings when those fields are present
Keep the event data and the Meta property names separate when checking the mapping.

Done when the variables on the selected event resolve to its own products and amounts, with no missing required input.

5. Save the event tag and trigger

A trigger is the condition that tells GTM when to run this tag.

  1. Create a tag from the Meta Pixel templateraw.githubusercontent.com.
  2. Select Standard and enter or choose Purchase.
  3. Enter your pixel ID.
  4. Map the properties above under Object Properties.
  5. Leave automatic ecommerce mapping off for this explicit mapping.
  6. Create a Custom Event trigger named purchase, with regular-expression matching off.
  7. Save the tag and trigger.

Done when the saved tag shows Purchase, the intended pixel ID and only the intended purchase trigger.

6. Compare the source event with Meta

  1. In GTM Previewsupport.google.com, complete a test order.
  2. Record its order ID and totals.
  3. Select purchase.
  4. Inspect the fired tag and variable values.
  5. In Meta Events Manager, open Test Events for the same pixel.
  6. Compare Purchase with that action.
  7. Test the store's consent choices and record the expected behavior for each.
  8. Reload the order confirmation and repeat the check.
  9. Record whether the plugin emits purchase again.
  10. Record whether Meta receives another event for that order.

A fired tag is a local execution check. Keep destination receipt and the field comparison in your notes before handing the draft to the person responsible for release.

Do not assume an order_id property prevents duplicates.

Done when the source event, tag and received Meta event agree, every extra firing has an explained cause, and your notes show whether the order confirmation reload produced another source event and another Meta event.

Can I reuse the tutorial container?

Use the existing export as a reference or import it into a separate test container. Google's import workflowsupport.google.com lets you preview changes before confirming them.

DownloadLocked
Download the tutorial GTM container
  • Download the file
  • Emailed to you

Unlock this file

Two details, and the full file is yours

No account needed. Unlock once and every snippet on the blog opens.

We email you a copy.

Optional. Review the imported configuration

  1. Choose Admin > Import Container.
  2. Select the file.
  3. Select a test workspace.
  4. Review the Merge preview.
  5. Replace the imported pixel ID before running any tag.
  6. Check that the export's consent settings match your test plan.
  7. Check that its included base tag matches your test plan.

Done when the import preview contains only the intended changes, the pixel ID is yours and the tags remain a reviewed test draft.

When is this setup the wrong fix?

Use this guide for a custom browser event mapping. If another integration already sends the same action correctly, repair or document that integration before adding another sender. A missing source event needs a plugin or theme investigation first.

  • Adding a second sender: the same action can be sent twice. Inventory app, theme and GTM senders before adding this tag.
  • Using All Pages for Purchase: unrelated visits qualify. Restrict the event tag to purchase and its intended page or action.
  • Mapping absent fields: the tag can send incomplete product data. Check variables on the event itself before changing the Meta tag.

What should I check after this event?

Compare the earlier checkout start with the completed order using the Initiate Checkout guide. Keep separate notes for each source event so you can find where the funnel stops matching.

What changed in this guide

  • 25 October 2026: Documented the archived generator import path. Added event-specific field and completion checks and replaced live-publish instructions with test-container review. Corrected the order ID path to ecommerce.transaction_id and flagged the export's embedded pixel ID for replacement.

Sources

12 sources
  1. 1GTM4WP's event reference↩
  2. 2GTM Preview can inspect an unpublished draft↩
  3. 3GTM4WP by Thomas Geiger↩
  4. 4Meta's GTM repository↩
  5. 5plugin settings reference↩
  6. 6Google's purchase example↩
  7. 7Facebook Parameter Generator repository is archived↩
  8. 8Google's template import instructions↩
  9. 9template.tpl↩
  10. 10Google describes how these variables read data-layer values↩
  11. 11Meta Pixel template↩
  12. 12Google's import workflow↩