Skip to Content
Tag ManagerTagsTikTok Pixel Tags

TikTok Pixel Tags

Use a TikTok Pixel tag to tell TikTok what visitors do on your site. TikTok uses these events to measure which ads led to conversions, to show ads to the people most likely to convert, and to build retargeting audiences.

Nitoriq loads TikTok’s library, loads your pixel once per page, and sends each event only to that pixel, even if other TikTok pixels are on the page.

Preparation

Before you start

  • you have the pixel code from TikTok Events Manager (for example C4ABCDEFGH1234567890)
  • the container has triggers for the page views and actions you want to send
  • variables exist for values such as order ID, order value, and cart contents
  • if you also send conversions server-side, the TikTok integration is set up in Nitoriq

Configure a TikTok Pixel tag

Create the tag

Open the container, choose Tags, choose New Tag, then choose TikTok Pixel under Advertising.

Enter the pixel code

Paste the pixel code from TikTok Events Manager, or enter a single variable that holds it, such as {{tiktok_pixel_code}}.

Choose the event

New tags start on Page view. For conversions, pick a standard event such as CompletePayment (purchase), AddToCart, or CompleteRegistration. To send your own event name, choose Custom event and enter a name of up to 100 characters.

For a purchase, choose CompletePayment rather than Purchase if you also send purchases through Nitoriq’s TikTok integration. That’s the name the integration sends by default, and TikTok only merges a browser event and a server event that have the same name.

Fill in parameters

Map each parameter to a fixed value or a variable:

  • Value: a number such as 49.90, sent as a number
  • Currency: pick it from the list, or choose + to use a variable if you sell in several currencies
  • Content IDs: a list variable, or comma-separated IDs
  • Contents: a variable holding a list of content objects, for example from the data layer
  • Quantity: a whole number

Use Additional Parameters for anything else.

Turn on deduplication for conversions

For conversion events, Deduplication defaults to Match server-side. Set Transaction ID to the same variable your Report Conversion tag uses, and Conversion Type to the same conversion type. See Browser pixels alongside the Conversions API.

Select triggers, save, and publish

Choose the triggers, save the tag, and publish the container.

TikTok Pixel fields

Pixel Code

The TikTok pixel to send to, or a single variable that holds it.

A value that isn't a valid pixel code is refused on save; a variable is checked again when the tag fires.

Event

A TikTok standard event, or Custom event with a name.

Standard events are what TikTok optimizes and reports on.

Parameters

The parameters TikTok documents for the chosen event.

Values are sent with the types TikTok expects; unusable values are left out and noted in the debug overlay.

Deduplication

Sends an event ID so TikTok counts a browser event and the same server-side event once.

Without it, a conversion sent by both the pixel and the TikTok integration is counted twice.

Fire once per page

Sends the event at most once per page load.

Useful for events whose trigger can match more than once.

Allow TikTok in a Content Security Policy

If your site sets a Content Security Policy, allow:

  • script-src: https://analytics.tiktok.com
  • connect-src: https://analytics.tiktok.com and https://analytics-ipv6.tiktokw.us

TikTok can change the hosts it sends to. If events stop after a TikTok update, check the browser console for blocked requests.

Check that it works

Open your page with ?niq_debug=1 to see the debug overlay. Each TikTok call appears as tiktok · track CompletePayment along with the values sent.

In TikTok Events Manager, open the pixel and use Test events, or install the TikTok Pixel Helper browser extension. When deduplication is set up, a conversion sent by both the pixel and the TikTok integration is counted once.

Validation

A TikTok Pixel tag is set up when

  • the tag type is TikTok Pixel and the pixel code is valid
  • page-view tags fire on DOM Ready, plus Route Change on single-page apps
  • purchase tags use the same event name as your server-side integration
  • conversion tags have deduplication set to match your server-side integration
  • the site’s own TikTok snippet, if any, isn’t also sending the same events
  • the container is published

Was this page helpful?