Skip to content
🚀 Find us on Product Hunt

TikTok Pixel Tracking Setup for WooCommerce

Quick answer: Use the free container builder wizard to select TikTok 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.

TikTok 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 TikTok Pixel container →

Events you can track

ecommerce events

engagement events

By Humayun Kabir Naim — Last updated: 8 November 2026

Quick answer

To track a WooCommerce store in TikTok through Google Tag Manager, first check whether TikTok is already being sent to — because the official TikTok for WooCommerce plugin installs the Pixel and the Events API by itself, with its own automatic deduplication. If that plugin is active and healthy, the correct GTM setup is no TikTok tags at all: a second sender doubles your purchases. If you want TikTok inside GTM — one data layer feeding GA4, Meta and TikTok identically, events the plugin never sends, and deduplication keys you control — remove the plugin first, then build in GTM: a base pixel tag on every page (it captures the ttclid click ID), one event tag per TikTok event reading the same GA4-format data layer as your other hubs (view_item → ViewContent, add_to_cart → AddToCart, begin_checkout → InitiateCheckout, purchase → Purchase), contents built from the data layer items, and the order ID sent as the event_id on the Purchase tag so the server copy from the Events API merges with it instead of counting twice.

TikTok for WooCommerce plugin settings with Pixel and Events API connected

What gets tracked

TikTok does not understand GA4 event names, so the table below is the translation — with the column that matters on WooCommerce: who already sends it.

WooCommerce dataLayer eventTikTok eventOfficial plugin sends it?
view_itemViewContentYes
add_to_cartAddToCartYes
begin_checkoutInitiateCheckoutYes
purchasePurchaseYes — browser and server (Events API)
add_to_wishlist actionAddToWishlistYes
sign_up / registrationCompleteRegistrationYes
Newsletter subscribeSubscribeYes
Form submissionLeadPartly — SubmitForm on supported forms
searchSearchNo — GTM custom build
add_payment_infoAddPaymentInfoNo — GTM custom build
Order refunded— (no page exists)No — server-side only, no standard event

One name change runs through this table. In May 2025 TikTok renamed its two most important events: CompletePayment became Purchase, and SubmitForm became Lead. The old names still work — TikTok converts them automatically in reporting, audiences and optimisation — and older guides, plugins and this site's own older pages still say CompletePayment. For a new GTM build, use the new names. What you must never do is split them: a pixel sending CompletePayment and a server sending Purchase for the same order are two different event names, and deduplication keys on the name — the pair will not merge.

Every event carries the parameters TikTok matches and optimises on: a contents array (each item's content_id, content_type, quantity, price), plus value and currency on the money events. Purchase also carries the order ID as its event_id — not a reporting parameter, but the deduplication key explained below.

Deep dives: Purchase, Add to Cart, Begin Checkout, View Item, Refund. Running GA4 too? Build the shared layer first: WooCommerce + GA4. See all options on the WooCommerce hub.

Before you start

  1. Choose who sends TikTok — before touching any setting. Option A (keep the official plugin): the TikTok for WooCommerce extension stays as the only TikTok sender, with its built-in Events API and automatic deduplication; GTM does not get TikTok tags. Option B (replace with GTM): deactivate the plugin, and GTM (browser) plus your Events API route (server) send everything, under your control. Both are legitimate. The illegitimate setup is the accidental third option — plugin active *and* GTM firing the same events — because the two senders' deduplication keys never match (see the Events API section). Decide, write it down, and make every later step match.
  2. Check for the plugin and the other quiet senders. Look for TikTok for WooCommerce under Plugins, plus all-in-one pixel plugins with TikTok enabled, and a ttq snippet pasted into the theme or a header/footer plugin. TikTok's own recommendation, if you do adopt its plugin, is to let it create a new pixel — an existing pixel carried over from a custom setup is exactly where its deduplication gets messy.
  3. A TikTok pixel and its ID — the same one in every sender. In TikTok Ads Manager: Tools → Events → Web Events, create or open the pixel. If the plugin created its own pixel and your GTM work points at a different one, Events Manager will look broken while both setups are "working" — reconcile the pixel first.
  4. GTM installed on the store, and the dataLayer working (Option B; Option A needs neither for TikTok). One web container, and a dataLayer source (GTM4WP with WooCommerce enhanced ecommerce enabled) pushing the GA4-format events above. If your GA4 hub setup already works, this is done — TikTok reads the same pushes.
  5. Your catalog's ID convention, confirmed. The catalog synced to TikTok (by the plugin, or your feed) identifies products by WooCommerce product ID or by SKU — open TikTok's catalog and check which. Your GTM contents must use the same identifier, or TikTok receives healthy events it cannot match to products, and catalog ads quietly stop learning.
TikTok Events Manager pixel overview with browser and server event sources

Route 1: Use the free TagManagerBuilder container

Open the GTM Container Builder, choose WooCommerce, then TikTok Pixel, 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. This container is the Option B build — the full standard set as Custom HTML tags from GTM (TikTok has no native GTM tag type) — so if you chose Option A, do not import it: the plugin is already your sender. If a GA4 or Meta container from this site is already in the workspace, import into the same workspace so the containers share the data layer variables. Test with the testing section below before publishing.

Route 2: Build it manually in GTM

Step 1 — Settle the sender (Option B only)

Deactivate the TikTok for WooCommerce plugin, and remove or disable TikTok inside any all-in-one pixel plugin. Do this before the GTM tags go live, not after: overlap on TikTok is only forgiven when both senders share an event_id, and the plugin's internal IDs are not yours to match (its purchase IDs are generated inside the plugin, not taken from your order ID) — so every day of overlap is a day of doubled purchases. Keep the plugin's catalog sync question separate: if the plugin was also syncing your product catalog to TikTok, arrange the feed another way before deactivating, or your catalog ads lose their products along with the pixel.

Step 2 — The base pixel tag

Tags → New, choose the TikTok Pixel template from the Community Template Gallery (or a Custom HTML tag with the base code if you prefer raw code — the TagManagerBuilder container uses Custom HTML), enter your Pixel ID, and set the trigger to All Pages. This tag loads the pixel and sends Pageview on every page — and, just as importantly, it reads the ttclid click ID from TikTok ad landing URLs and stores it in the first-party _ttp cookie. That cookie is what later browser and server events use to attach the sale to the click, and it is also TikTok's fallback deduplication key when a server event arrives without an event_id. A base tag that only fires on some pages, or loads late, loses click IDs that no later setting can recover.

TikTok Pixel base tag in GTM on the All Pages trigger for a WooCommerce store

Step 3 — Variables that translate the data layer into TikTok parameters

TikTok wants a contents array; the data layer holds ecommerce.items with item_id, price and quantity. Create these in Variables → New:

function() {
  var items = {{DLV - ecommerce.items}} || [];
  return items.map(function(item) {
    return {
      content_id: String(item.item_id),
      content_type: 'product',
      quantity: item.quantity || 1,
      price: item.price
    };
  });
}

The mapping only works if item_id in the push is the identifier your TikTok catalog uses — WooCommerce product ID or SKU, whichever the feed carries. If GTM4WP emits SKUs and the catalog holds product IDs (or the reverse), fix the mapping here. TikTok will not warn you; the events simply match no products.

Custom JavaScript variable mapping WooCommerce items to TikTok contents

Step 4 — One event tag per TikTok event

Create a tag of the TikTok Pixel template type (or a Custom HTML tag with a ttq.track() call) for each standard event you are responsible for. Each tag needs three things: the TikTok event name, the parameters from Step 3, and a Custom Event trigger on the matching data layer event (view_item → ViewContent, add_to_cart → AddToCart, begin_checkout → InitiateCheckout, purchase → Purchase). Do not trigger TikTok events on clicks or page views — the data layer event is the only reliable signal that the shop action actually happened, and it carries the product data with it.

For the Purchase tag, the parameters are contents (the Custom JS variable), value (from ecommerce.value), currency, and — in the template's dedicated Event ID field, not in the parameters — an event_id equal to the transaction_id. In a ttq.track() call the tag looks like:

ttq.track('Purchase', {
  contents: [{ content_id: '123', content_type: 'product', quantity: 1, price: 129.99 }],
  value: 129.99,
  currency: 'USD'
}, { event_id: '1042' });

That third argument is where TikTok deduplication lives: the ID rides outside the event parameters, and a Purchase tag that buries the order ID inside the parameters object has sent no deduplication key at all.

TikTok Purchase tag in GTM with the order ID in the Event ID field

Step 5 — The events the plugin covered differently (both options)

Under Option A, the plugin's list is what you get — its nine events, its definitions. Under Option B you own the gaps as well as the standard set:

TikTok Pixel Helper showing ViewContent with contents on a WooCommerce product page

Test it: GTM Preview, Pixel Helper and Test Events

GTM Preview purchase event with the TikTok tag fired for a WooCommerce order
  1. Click Preview in GTM and open the store in Tag Assistant. Shop like a customer: product page, add to cart, checkout, test order.
  2. In the Preview timeline, click view_item, add_to_cart, then purchase. Under Option B, your TikTok tags sit under Tags Fired each time with the right parameters. Under Option A, confirm the opposite: no TikTok tags fire from GTM at all — if they do, you have built the accidental third architecture.
  3. Install the TikTok Pixel Helper Chrome extension and repeat the flow on the live store. It shows each event as the pixel sent it — names, parameters, and warnings — and it is the fastest way to catch a contents array that left the page malformed.
  4. In TikTok Events Manager, open your pixel's Test Events, browse the store with the test code active, and repeat the purchase. Events should arrive within seconds, each once. Filter by source: a Purchase arriving twice from the browser is a second browser sender; once from browser and once from server with no merge is an event_id or event-name mismatch — check the name first (Purchase vs CompletePayment) before the ID.
  5. Run the rename check: if any sender in your estate still emits CompletePayment or SubmitForm, confirm in Events Manager that it reports as Purchase / Lead, and then schedule its rename properly — mixed names are a standing deduplication risk every time a server copy joins.
  6. Only when the funnel is clean end to end, click Submit in GTM to publish. Then watch the pixel's event list for the first days: browser + server volume should roughly agree, with the deduplicated total visibly below the sum.
Duplicate Purchase events from the plugin and GTM in TikTok Test Events

Events API and deduplication — TikTok's rules are not Meta's

The Events API sends the same events from your server, recovering what the browser loses to blockers, privacy settings and dropped connections — TikTok's own figures credit the pair with capturing about 19% more events and improving CPA by about 15% on average. On WooCommerce the server copy normally comes from the official plugin (Option A, where it is automatic) or from a server GTM container / dedicated Events API integration (Option B). Either way, deduplication follows TikTok's own rules, which differ from Meta's in ways that matter:

The key is three-part. Copies merge only when pixel ID, event name and event_id are all identical. On this platform the shared key is ready-made: the order ID. Your GTM Purchase tag sends event_id: transaction_id; the server copy must carry the same order ID as its event_id, under the same event name — Purchase, not CompletePayment.

Timing decides the outcome. If the second copy arrives within 5 minutes of the first, TikTok *merges* them — one event, with parameters and match data combined from both copies. If it arrives later, up to 48 hours after the first, TikTok *deduplicates*: the first copy is kept and the later one dropped. Beyond 48 hours, both stand.

TikTok forgives what Meta does not — up to a point. The same 48-hour deduplication applies to repeats within one channel (pixel-only or API-only duplicates with a matching event_id are also dropped). Meta never merges two browser copies; TikTok can. But the forgiveness is entirely conditional on an event_id you control. The official plugin generates its own event IDs internally, so a plugin purchase and a GTM purchase for the same order carry different keys and are both kept — the one combination this platform produces most is the one deduplication cannot save. And if a server event arrives with no event_id at all, TikTok falls back to matching on the _ttp cookie value when one is present — better than nothing, and no basis for a design.

Mechanics that follow: under Option A, add nothing — no sGTM TikTok tag for events the plugin already sends server-side. Under Option B, generate the ID once, at the order, and pass that single value down both paths; IDs generated independently per path never match. Verify in Test Events that each doubly-sent Purchase shows as one event with browser + server sources, not two events. The full server-side build lives in the Server-Side Tracking guide.

Purchase received once in TikTok Test Events from browser and server

WooCommerce-specific troubleshooting

Purchase is counted twice. Look for two senders before touching any setting: the official plugin still active alongside GTM is the classic cause here, and deduplication will not rescue it because the plugin's event IDs are not your order IDs. Search your page source for ttq — it should load only through GTM (Option B) or only through the plugin (Option A), never both.

Events fire in Preview but never appear in Events Manager. Check the Pixel ID first — TikTok pixel IDs are long alphanumeric codes, and one wrong character sends everything to a pixel nobody watches. Then confirm the base 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 arrives, but catalog ads do not learn. Inspect content_id inside contents against the catalog in TikTok: product IDs where the feed holds SKUs (or the reverse) is the usual break, and content_type must be product. Fix the mapping in the variable, not in the catalog.

Browser and server Purchases both arrive, unmerged. Read the name before the ID: a pixel sending CompletePayment and a server sending Purchase never merge, however perfect the event_id. Then check that the ID sits in the tag's Event ID field (the third argument of ttq.track()), not inside the parameters, and that the server copy carries the same order ID.

Events look fine but attribution is weak. Check the click ID chain: land on the store from a TikTok link (or a URL carrying ttclid) and confirm the _ttp cookie is set on the first page. If the base tag loads late, is consent-blocked, or is missing from landing pages, the cookie is never written and later events cannot be tied to the click. Advanced Matching — hashed email and phone, sent with consent — is the other lever; it raises match quality rather than fixing broken events.

AddToCart is missing but Purchase works. AJAX add-to-cart is the usual suspect: the cart updates without a page load, and some data layer plugins only push on a full page view. Test the exact add-to-cart button in Preview and watch whether the add_to_cart push appears.

Next steps once this is clean: WooCommerce + Google Ads and WooCommerce + Meta from the same data layer, then Consent Mode v2 so consent choices reach every tag correctly.

Frequently asked questions

Should I keep the official TikTok plugin or move TikTok into GTM?

Either can be right; running both for the same events is always wrong. Keep the plugin if its nine events, its catalog sync and its automatic deduplication cover your TikTok activity — it is a genuinely complete sender. Move to GTM when you want one data layer feeding GA4, Meta, Google Ads and TikTok identically, events the plugin never sends, custom parameters, or deduplication keys built on your order IDs. What you cannot do is decide later — overlap first, questions second is how stores end up with a month of doubled purchases.

TikTok deduplicates better than Meta, so is running both actually safe?

Safer than on Meta, not safe. TikTok will merge or drop a repeat copy — even a second browser copy — when pixel, event name and event_id all match. But the official plugin's event IDs are generated inside the plugin, not taken from your order ID, so a plugin purchase and a GTM purchase for the same order never match on the key. The forgiveness exists; this combination cannot use it.

Should I use Purchase or CompletePayment in my tags?

Purchase — TikTok renamed CompletePayment to Purchase (and SubmitForm to Lead) in May 2025, and new builds should use the current names. Legacy names still fire and are converted automatically in reporting. The one hard rule: every sender of the same action must use the same name, because deduplication keys on the event name.

Does the official plugin send the Events API too, or only the pixel?

Both. The plugin installs the Pixel and enables the Events API together, with Advanced Matching and catalog sync — which is precisely why adding a GTM pixel "just for the browser events" still doubles purchases: the plugin was never a browser-only sender.

My TikTok catalog uses SKUs, but my data layer sends product IDs. Does it matter?

Yes — silently. Events arrive and look healthy in Events Manager, but content_id values that match nothing in the catalog cannot power catalog ads or product-level optimisation. Align the variable's mapping to the feed's identifier, whichever side is easier to change — and keep every sender on the same convention.

I removed the plugin and my TikTok catalog disappeared. What happened?

The plugin was doing two jobs: measurement and catalog sync. Removing it removes both unless you replace the feed separately. Before deactivating, check whether your catalog in TikTok is plugin-sourced; if it is, stand up a standalone feed first, then remove the plugin, then publish the GTM build — in that order.

Share with