Tracking

How to add the TikTok Pixel and Events API to WooCommerce

By Wasika Rahman, founder of Wasika Studio · Updated 3 December 2026 · 2 min read

Short answer

To add the TikTok Pixel to WooCommerce, copy your web pixel code from TikTok Ads Manager → Tools → Events, add it to one tracking plugin, and for server purchases also add an Events API access token from the pixel's settings. Connect your cookie banner, then check purchases in the pixel's Test Events tab before running ads.

What you are setting up

TikTok PixelTikTok Events API
Where it runsThe visitor's browserYour server
SendsPage views, product views, add to cart, checkout, purchasePurchases
Weak whenAd blockers, browser limits, closed tabsThe access token is wrong or the server cannot reach TikTok
Needs consent where the law requires itYesYes

Use both with the same event ID, so TikTok counts each purchase once.

What you need

  • A WooCommerce shop on a recent WordPress version
  • A TikTok Ads Manager account with a web pixel
  • An access token for the Events API (optional, recommended)
  • A cookie banner, if you have visitors in places that require consent
  • One tool that sends TikTok events. Two tools usually mean double counting

Step 1: find your Pixel ID

  1. In TikTok Ads Manager, open Tools → Events.
  2. Choose your web pixel (or create one for your website).
  3. Copy the pixel code: a string of letters and digits.

TikTok changes menu names from time to time. If a name differs, search TikTok's help for "web pixel".

Step 2: create an access token (for server purchases)

  1. Open the pixel's Settings.
  2. Find the Events API section and Generate access token.
  3. Treat it like a password: don't email it or paste it into a page builder.

Step 3: add both to your shop

With TagBuni, a free plugin on WordPress.org:

  1. In WordPress, go to Plugins → Add New Plugin, search for "TagBuni", then Install Now and Activate.
  2. Open TagBuni → Platforms, choose how consent works, and open the TikTok card.
  3. Tick Turn on, paste the Pixel ID, and paste the access token if you want server purchases.
  4. Click Save.

TagBuni sends ViewContent, AddToCart, InitiateCheckout and Purchase with product IDs, prices, quantities and currency taken from the WooCommerce order.

Step 4: test before you spend

  1. In the pixel's Test Events tab, copy the test event code.
  2. Paste it into the plugin and place a test order in a private window after accepting cookies.
  3. Check that Purchase arrives from the browser and the server, with the same value and currency.
  4. Remove the test code, or real purchases keep going to Test Events only.

Common problems

SymptomLikely cause
No events at allConsent not given, or you are logged in as an administrator
Purchases counted twiceA second plugin or Tag Manager also sends TikTok events
Server purchases missingToken missing or wrong, test code still set, or WordPress cron not running
Events arrive with no valueThe event is sent from a button instead of the order
Works for you, not for visitorsPage cache or a JavaScript optimizer delays the pixel

A small gap between TikTok and your shop is normal: blockers, declined consent and attribution windows all play a part.

Common questions

Is the TikTok Events API free?

TikTok does not charge for it. Some plugins charge for server events; TagBuni sends TikTok purchases from the server for free.

Do I need both the TikTok Pixel and the Events API?

The Pixel alone works, but browsers and ad blockers miss some purchases. Sending purchases from the server too, with the same event ID, fills that gap without double counting.

Which events should a WooCommerce shop send to TikTok?

ViewContent, AddToCart, InitiateCheckout and Purchase, with product IDs, value and currency taken from the order.

Why don't I see my own visits in TikTok?

Many plugins don't track logged-in administrators, and nothing is sent before consent. Test in a private window after accepting cookies.

Tools that help

  • TagBuni

    WordPress plugin

    FreeAvailable

    Meta Pixel and Conversions API, GA4, Google Ads, TikTok, Pinterest and more, with purchase values taken from the WooCommerce order.

    View details

Want it done for you?

More guides

Have a project in mind?

Tell us your goal and we will reply with a written plan and quote.