TikTok

What Is TikTok?

TikTok for Business is a global platform designed to give brands and marketers the solutions to be creative storytellers and meaningfully engage with the TikTok community.

Streamline TikTok customer data streaming with MetaRouter's unified tracking tag. Easily route your website and mobile events to TikTok to create advertising audience segments, measure campaign performance, and attribute conversions to ads that your customers have viewed on TikTok.

What are the benefits of integrating MetaRouter with TikTok for Business?

  • Enables TikTok tag removal.
  • No effect on website load latency.
  • Ensures event data is streaming into TikTok for Business for accurate ad decisioning and measurement.

Capabilities and Considerations

  • This integration uses the TikTok Events 2.0 API as the main connector.
  • Starter-kit is default to web events. For event sources outside of web events, please check TikTok’s API Reference to ensure all required and recommended parameters are included for the event source.
  • Captures key user interactions like page views, purchases, and sign-ups server-side, ensuring data accuracy.
  • Measures conversions (e.g., purchase) effectively using server-side data.
  • Maintains campaign attribution by sending necessary data (e.g., ttclid) through the API.
  • Creates custom audiences and retarget users based on server-side events.
  • This integration sends limited_data_use set to false by default. When set to true, TikTok applies restricted processing to the event, limiting its use for ad targeting, optimization, and audience creation. Advertisers should update this value as needed to align with regional privacy requirements or internal compliance policies.

Limitations

  • Behavioral Tracking: The range of tracked behaviors is less comprehensive compared to pixel tracking, which captures more granular user interactions.
    • The TikTok pixel can track user behaviors like page scroll depth, hover actions, and clicks on expandable product descriptions. Server-side tracking typically only captures high-level events like page views or form submissions.
  • Creative Interaction Data: Server-side tracking may lack the detail provided by the pixel regarding user engagement with ad creatives.
    • Pixel tracking can capture how long a user watches a video ad, whether they mute it, or if they click on a "Shop Now" button within the ad. Server-side tracking usually only registers whether the user clicked a link, missing these finer interaction details.
  • Audience Insights: Insights may be less detailed compared to those obtained through the pixel.
    • The pixel can provide detailed insights such as which ad elements users interacted with most or the specific paths they took on your website before converting. Server-side tracking may not capture the full sequence of these interactions.

Getting Started - From Your TikTok Ads Manager Account

Determine the Event Source for the event_source field:

  • web: The events took place on your website and are measured by a Pixel Code.
    • The default value in the starter-kit is web.
  • app: The events took place on your app and are measured by a TikTok App ID.
  • offline : The conversions took place in a physical store and are measured by an Offline Event Set ID.
  • crm: The lead events took place in a CRM system and are measured by a CRM Event Set ID.

Note: Reporting App Events using Events API 2.0 is currently an allowlist-only feature. If you would like to access it, please contact your TikTok representative.

Acquire the following keys and IDs:

  • Access Token - Please see here for instructions.
  • Event Source ID - When event_source is set to web, specify a Pixel Code through this field. To obtain a Pixel Code, refer to FAQs - Where can I find the Pixel Code. Please note that the default starter-kit is set to web.
    • When event_source is set to offline, specify an Offline Event Set ID through this field.To obtain an Offline Event Set ID, refer to Setup Guide for Offline.
    • When event_source is set to app, specify a TikTok App ID through this field.To obtain a TikTok App ID, refer to Setup Guide for App.
    • When event_source is set to crm, specify a CRM Event Set ID through this field.To obtain a CRM Event Set ID, use /crm/list/.

Getting Started - From Your MetaRouter Account

Adding a TikTok integration.

From the integration library, add a TikTok integration. Then, fill out the Connection Parameters:

Connection ParameterDescription
API_VERSIONDefault v1.3
ACCESS_TOKENTikTok access token.
EVENT_SOURCEDefault web. Please see above for references to offline, app, or crm event sources.
EVENT_SOURCE_IDFor web event source, please use Pixel Code. If using another event source, please refer to the details above.

Adding a TikTok Sync

To gather the ttclid value and the ttp value, you must add a TikTok sync.

  1. From the Pipelines page, find the pipeline associated with the web property you’d like to add a sync to. Hover over the three dot dropdown and select “Build AJS File.”
  2. In the Identity Syncs section, select the TikTok sync.
  3. Fill out the following fields:
    1. Consent Category
    2. Cookie Time to Live - Default 7 days
    3. Pixel ID - Your Pixel Code as mentioned in the steps above.
  4. Scroll down and click the Save and Build File button.
  5. Deploy your AJS file to propagate changes to your web property.

Event Mappings

MetaRouter provides all of the event mappings that TikTok integrations typically require. You may add custom events, parameters or mappings in accordance with TikTok’s API documentation.

Global

Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.

Output KeyDescriptionExpected Input
partner_name RequiredString: Represents that the data is being sent by MetaRouter.Mr
limited_data_useBoolean: Indicates limited data use status for the event.Enrichment – false
event_id RequiredString: A unique identifier for the event.Expression – hash of anonymousId + _ + messageId
event_time RequiredInteger: The timestamp of the event in seconds since UNIX epoch.Expression – converts timestamp or receivedAt to epoch seconds
page.urlString: The URL of the webpage where the event occurred.context.page.url
page.referrerString: The referrer URL that led to the event.context.page.referrer
user.ttclidString: TikTok Click ID, used to track the origin of the user.context.providers.tiktok.ttclid
user.ttpString: TikTok pixel ID for tracking user sessions across devices.context.providers.tiktok.ttp
user.external_idString: Advertiser-provided user identifier, hashed using SHA-256.anonymousId
user.emailString: The user's email address, hashed using SHA-256.Expression – SHA-256 of normalized traits.email
user.phoneString: The user's phone number, hashed using SHA-256.Expression – SHA-256 of normalized traits.phone
user.ipString: The IP address of the user at the time of the event.context.ip
user.user_agentString: The user agent of the user at the time of the event.context.userAgent
user.localeString: User locale / language tag (BCP 47).context.locale

Event Specific

Page

Output KeyDescriptionExpected Input
event RequiredString: The type of event.Enrichment – 'ViewContent'
properties.descriptionString: A description of the event.Enrichment – 'page'
properties.contentsArray: Content objects for the page (path/title).Expression – builds from context.page.path and context.page.title

Products Searched

Output KeyDescriptionExpected Input
properties.search_stringString: The search query entered by the user.properties.query
event RequiredString: The type of event.Enrichment – 'Search'

Product List Viewed

Output KeyDescriptionExpected Input
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: Total value of products viewed.Expression – total value of properties.products
properties.num_itemsInteger: Total item quantity across products.Expression – sum of properties.products[].quantity (default 1)
properties.content_idsArray: Product identifiers (product_id or sku).Expression – map properties.products[].product_id or sku
properties.contentsArray: Details of the products viewed.Expression – builds array from properties.products
event RequiredString: The type of event.Enrichment – 'ViewContent'
properties.descriptionString: A description of the product list viewed.Enrichment – 'product list viewed'
properties.content_typeString: The content type.Enrichment – 'product'

Product Viewed

Output KeyDescriptionExpected Input
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: The value of the product viewed.properties.price
properties.num_itemsInteger: Quantity for the viewed product.properties.quantity
properties.content_idsArray: Product identifier list.Expression – {properties.product_id or properties.sku}
properties.contentsArray: Details of the product viewed.Expression – builds single-item contents array
event RequiredString: The type of event.Enrichment – 'ViewContent'
properties.descriptionString: A description of the product viewed.Enrichment – 'product viewed'
properties.content_typeString: The content type.Enrichment – 'product'

Product Added

Output KeyDescriptionExpected Input
properties.descriptionString: A description of the product added.properties.name
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: The value of the product added to the cart.Expression – total value of properties
properties.num_itemsInteger: Quantity added.properties.quantity
properties.content_idsArray: Product identifier list.Expression – {properties.product_id or properties.sku}
properties.contentsArray: Details of the product added to the cart.Expression – builds single-item contents array
event RequiredString: The type of event.Enrichment – 'AddToCart'
properties.content_typeString: The content type.Enrichment – 'product'

Cart Viewed

Output KeyDescriptionExpected Input
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: The value of the products in the cart.Expression – total value of properties.products
properties.num_itemsInteger: Total item quantity across cart products.Expression – sum of properties.products[].quantity (default 1)
properties.content_idsArray: Product identifiers (product_id or sku).Expression – map properties.products[].product_id or sku
properties.contentsArray: Details of the products in the cart.Expression – builds array from properties.products
event RequiredString: The type of event.Enrichment – 'ViewContent'
properties.descriptionString: A description of the cart viewed.Enrichment – 'cart viewed'
properties.content_typeString: The content type.Enrichment – 'product'

Checkout Started

Output KeyDescriptionExpected Input
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: The value of products in checkout.Expression – total value of properties.products
properties.num_itemsInteger: Total item quantity across products.Expression – sum of properties.products[].quantity (default 1)
properties.content_idsArray: Product identifiers (product_id or sku).Expression – map properties.products[].product_id or sku
properties.contentsArray: Details of the products in checkout.Expression – builds array from properties.products
event RequiredString: The type of event.Enrichment – 'InitiateCheckout'
properties.content_typeString: The content type.Enrichment – 'product'

Order Completed

Output KeyDescriptionExpected Input
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: The value of the completed order.Expression – total value of properties.products
properties.num_itemsInteger: Total item quantity across products.Expression – sum of properties.products[].quantity (default 1)
properties.content_idsArray: Product identifiers (product_id or sku).Expression – map properties.products[].product_id or sku
properties.contentsArray: Details of the products in the completed order.Expression – builds array from properties.products
event RequiredString: The type of event.Enrichment – 'Purchase'
properties.order_idString: The ID of the completed order.properties.order_id
properties.content_typeString: The content type.Enrichment – 'product'

Payment Info Entered

Output KeyDescriptionExpected Input
event RequiredString: The type of event.Enrichment – 'AddPaymentInfo'
properties.order_idString: The order ID associated with payment info.properties.order_id
properties.descriptionString: The payment method description.properties.payment_method

Product Added to Wishlist

Output KeyDescriptionExpected Input
properties.descriptionString: A description of the product added to wishlist.properties.name
properties.currencyString: The currency of the transaction.properties.currency
properties.valueInteger: The value of the product added to wishlist.Expression – total value of properties
properties.num_itemsInteger: Quantity wishlisted.properties.quantity
properties.content_idsArray: Product identifier list.Expression – {properties.product_id or properties.sku}
properties.contentsArray: Details of the product added to wishlist.Expression – builds single-item contents array
event RequiredString: The type of event.Enrichment – 'AddToWishlist'
properties.content_typeString: The content type.Enrichment – 'product'

Required & Recommended Identifiers

These identifiers must be mapped to TikTok in order for successful user matching to occur. Without these IDs, any events sent to TikTok may not be accurately reflected in reporting. For your convenience, required and recommended IDs are mapped as Global parameters to ensure they are added to every event.

Attribute

Example

Sync Injector Required?

event_id Required

"80fba0ae1c48e3978e43e4efc365e14e12ea0c830ba8ba5b9a2dafc7e3f2ab8b”

No

ttclid
Highly Recommended

?ttclid=1223123132123

Yes

ttp
Recommended

QRNtGPTKx_AiGeQv8-Ux6WD6s7y

Yes

external_id
Recommended

"80fba0ae1c48e3978e43e4efc365e14e12ea0c830ba8ba5b9a2dafc7e3f2ab8b”

No

ip
Recommended

"203.0.113.1" "2001:0db8:85a3:0000:0000:8a2e:0370:7334"

No

user_agent
Recommended

"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604”

No

email
Recommended

"848a771458438fc2ec420560d769fb9b9b86851ee338ec56517baabd79d3bb4f”

No

phone
Recommended

"9f7ec22d72092cd3c0b58726ed9c2d91b92e51a3f29837508fb2948bb22dd2fd”

No


Additional Identifiers

These identifiers should be mapped to TikTok whenever possible to ensure the highest user match rates possible. If using these identifiers, they must be added as Global or Event Specific mappings.

Attribute

Description

Example

idfa

The iOS IDFA for app events only.
For iOS 14 and above, ensure that IDFA data collection follows Apple’s policies.

Both raw and SHA-256 IDFAs are accepted: For raw IDFAs, all characters must be UPPERCASE.For SHA-256 IDFAs, all characters must be lowercase, and any leading/trailing spaces must be trimmed before hashing.

Raw IDFA: "EA7583CD-A667-48BC-B806-42ECB2B48606" SHA-256 IDFA: "70574fa9c8f498a7b2e5c8712b1126de7b1406fd02fdc591821c5bd33092fd1c"

idfv

The iOS IDFV for app events only.

gaid

The GAID (Google Advertising ID) for app events only
Both raw and SHA-256 GAIDs are accepted.

For both raw and SHA-256 GAIDs:All characters must be lowercase.Leading/trailing spaces must be trimmed before hashing

Raw GAID: "aaaaaa-2222-1111-8787-809e92233ba0" SHA-256GAID: "0ebad966881e1eebffe69b3abf624631cf83ec9bf8cb3ce134c7c75c6d8ee7fc"

locale

For web and app events only.
The BCP 47 language identifier.

For reference, refer to the IETF BCP 47 standardized code.

"en-US""zh-CN"

att_status

For app events only.
Whether the user has authorized your mobile app to access app-related data for measuring the user or the device. This is an iOS only field.

Enum values:

AUTHORIZED: The user has authorized access to app-related data that can be used for measuring the user or the device.

DENIED: The user has not agreed to authorize your mobile app to access app-related data for measuring the user or the device via Apple's AppTrackingTransparency framework. If this field is set to DENIED, TikTok will not use the PII data (for instance, user email address or phone number) in this App Event for user-level matching.

NOT_DETERMINED: The user has not yet received an authorization request to authorize access to app-related data that can be used for measuring the user or the device.

RESTRICTED: The authorization to access app-related data is restricted.

NOT_APPLICABLE: The iOS version is below 14 or the device is running Android.

"AUTHORIZED”


Additional TikTok Documentation

TikTok Events API 2.0 - API Reference

Authentication