Skip to main content

TikTok Pixel

Web Source code Package

The TikTok Pixel forwards browser conversions to TikTok Ads for optimization, audience building, and reporting. This destination wraps the standard TikTok Pixel snippet (loaded from analytics.tiktok.com/i18n/pixel/events.js); there is no npm SDK for the browser pixel. Events become ttq.track(name, params, { event_id }) calls; identity becomes ttq.identify({ email, phone_number, external_id }); consent toggles ttq.enableCookie / ttq.disableCookie.

Where This Fits

TikTok Pixel is a web destination in the walkerOS flow:

Loads the TikTok Pixel SDK, forwards every walkerOS event with a stable event_id for deduplication, and lets you layer on Advanced Matching and consent cookie toggling.

Installation

Loading...

Setup

Loading...

Configuration reference

PropertyTypeDescriptionMore
apiKey*stringYour TikTok Pixel ID. Find it in TikTok Ads Manager under "Assets" → "Events" → "Web Events" → select your pixel → "Setup Web Event" → "Pixel ID".
auto_configbooleanTikTok default: true. Enable automatic form field detection for Advanced Matching.
limited_data_usebooleanTikTok default: false. Restrict data use for compliance with U.S. state privacy laws.
identifyanywalkerOS mapping value resolving to an Advanced Matching object with any of: email, phone_number, external_id. All values are auto-hashed (SHA256) by the TikTok SDK before sending.
* Required fields

Standard events

TikTok recognizes 14 standard events for ad optimization. Use mapping.name to flip walkerOS event names into the rigid taxonomy. Custom names still work but receive no optimization signal.

TikTok nameWhen to use
ViewContentProduct / content detail view
ClickButtonGeneric CTA click
SearchSite search
AddToWishlistItem added to a wishlist
AddToCartItem added to cart
InitiateCheckoutUser started checkout
AddPaymentInfoPayment details entered
CompletePaymentOrder successfully placed (primary conversion)
PlaceAnOrderOrder placed (alternative)
ContactLead / contact form
DownloadAsset download
SubmitFormGeneric form submission
CompleteRegistrationUser signup
SubscribeSubscription start

Mapping data.examples

tip

The code data.examples are interactive. You can edit the code to generate your individual event mapping.

ViewContent via mapping.name

The canonical TikTok pattern: walkerOS product view becomes TikTok's ViewContent standard event with the native parameter shape.

Event
Loading...
Mapping
Loading...
Result
Loading...

CompleteRegistration with per-event Advanced Matching

User signup is the moment to fire Advanced Matching for the session.

Event
Loading...
Mapping
Loading...
Result
Loading...

CompletePayment with multi-product contents

The hero example: mapping.data builds the TikTok-native shape; loop walks event.nested to produce one contents entry per product; { key, value: 'EUR' } provides a fallback currency.

Event
Loading...
Mapping
Loading...
Result
Loading...

Minimal example: a single mapping.data field maps the query string.

Event
Loading...
Mapping
Loading...
Result
Loading...

Destination-level Advanced Matching

Set identity once on the destination and the runtime state diffing skips redundant ttq.identify() calls when nothing changed.

Event
Loading...
Mapping
Loading...
Result
Loading...

Advanced Matching

TikTok matches conversions back to TikTok users via three optional parameters: email, phone_number, external_id. The SDK hashes them with SHA256 before sending, so it's safe to pass raw values.

settings.identify (destination-level) fires on first push and re-fires only when the resolved value changes (runtime state diffing). mapping.settings.identify (per-event) overrides for one push, which is useful for signup and checkout flows where the identity becomes available mid-session.

ttq.identify() always fires before ttq.track() so Advanced Matching is set for the conversion event.

TikTok is an advertising platform. The typical walkerOS consent key is marketing (whatever name your CMP reports). The walkerOS config.consent gate blocks unconsented events from reaching the destination in the first place; the destination's on('consent') handler then toggles TikTok's own cookie state for attribution.

Loading...

The handler iterates every key in config.consent and calls ttq.enableCookie() only when all required keys are granted. Otherwise it calls ttq.disableCookie(). This is the conservative semantic that matches walkerOS's gating model.

Auto page view

TikTok's SDK auto-fires ttq.page() once on load. The destination has no knob to suppress it. Letting the auto page view fire is the expected behavior.

💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)