TikTok
What Is TikTok for Business?
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.
Getting Started - From Your TikTok Account
From the TikTok Events Manager
- In Settings, generate access token used for authentication.
- Click the pixel to view its configuration details.
- In the Test Events tab, click the test code button to copy the code.
- In the body of your API request for reporting events, add a new field
test_event_code
and paste the code you get from Step 2 as the value of the field. - Send the API Request.
- Replace values for
Access-Token
,pixel_code
, andtest_event_code
with your own. For more information on retrieving the access token, pixel code, and the test event code, please refer to TikTok's documentation here.
From the TikTok Ads Manager
- Look for the test event in the Event Activity section to verify setup. Please refer to this document for verifying server-side integration setup.
Grab your Pixel ID
- From the TikTok Ads Manager, go to Tools in the upper-navigation.
- Click on Events.
- Click Manage under Web Events.
- Your Main Pixel ID will be listed.
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 Parameter | Description |
---|---|
API_VERSION | Default version v1.2. |
API_KEY | Access token generated under Settings in TikTok Events Manager. |
PIXEL_ID | Your pixel ID. |
Adding a TikTok Sync
To gather the ttclid
value (TikTok click ID) and ttp
(TikTok tracking parameter) value, you must add a TikTok sync.
- 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.”
- In the Identity Syncs section, select the TikTok sync.
- Fill out the following fields:
- Consent Type
- Cookie Lifetime (in days) - default 7 days
- Scroll down and click the Save and Build File button.
- 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 Key | Description | Expected Input |
---|---|---|
event_id Required | Type: string Unique identifier for the event, generated by combining anonymousId and messageId. | N/A - Expression |
timestamp Required | Type: int The timestamp of the event. | timestamp |
context.ad.callback Required | Type: string TikTok ad callback identifier. | context.providers.tiktok.ttclid |
context.page.url Required | Type: string The URL of the page where the event occurred. | N/A - Expression |
context.page.referrer | Type: string The referrer URL of the page where the event occurred. | context.page.referrer |
context.user.ttp Required | Type: string TikTok tracking parameter. | context.providers.tiktok.ttp |
context.user.external_id Required | Type: string External user identifier, hashed. | N/A - Expression |
context.user.email | Type: string User email address, hashed. | N/A - Expression |
context.user.phone_number | Type: string User phone number, hashed. | N/A - Expression |
context.ip Required | Type: string IP address of the user. | context.ip |
context.user_agent Required | Type: string User agent string of the browser. | context.userAgent |
Event Specific
page
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string The name of the event. | Enrichment - ViewContent |
properties.description | Type: string Description of the event. | Enrichment - page |
products_searched
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - Search |
properties.query Required | Type: string - Search query text. | properties.query |
product_list_viewed
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - ViewContent |
properties.description | Type: string - Description of the event. | Enrichment - product list viewed |
properties.currency Required | Type: string - Currency used in the transaction, converted to uppercase. | properties.currency , default USD |
properties.value Required | Type: float - Total value of the viewed products. | N/A - Expression |
properties.contents Required | Type: list of objects - List of contents in the product list viewed. | N/A - Expression |
product_viewed
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - ViewContent |
properties.description | Type: string - Description of the event. | Enrichment - product viewed |
properties.value Required | Type: float - Price of the viewed product. | properties.price |
properties.contents Required | Type: list of objects - Details of the viewed product. | N/A - Expression |
product_added
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - AddToCart |
properties.currency Required | Type: string - Currency used in the transaction, converted to uppercase. | properties.currency , default USD |
properties.value Required | Type: float - Total value of the added product. | N/A - Expression |
properties.contents Required | Type: list of objects - Details of the added product. | N/A - Expression |
cart_viewed
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - InitiateCheckout |
properties.currency Required | Type: string - Currency used in the transaction, converted to uppercase. | properties.currency , default USD |
properties.value Required | Type: float - Total value of the cart. | N/A - Expression |
properties.contents Required | Type: list of objects - Details of the cart contents. | N/A - Expression |
order_completed
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - CompletePayment |
properties.currency Required | Type: string - Currency used in the transaction, converted to uppercase. | properties.currency , default USD |
properties.value Required | Type: float - Total value of the order. | N/A - Expression |
properties.contents Required | Type: list of objects - Details of the ordered products. | N/A - Expression |
signed_up
Output Key | Description | Expected Input |
---|---|---|
event Required | Type: string - The name of the event. | Enrichment - CompleteRegistration |
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? |
---|---|---|
external_id Required | SHA-256 hash: a84b5f3151b8b3de6bbd9067d3ed1bc3e4f9b30b6a6cfaf6746dbf8bb8f3adcc | No |
ip Required | "192.168.0.1" | No |
ttclid Required | "123e4567-e89b-12d3-a456-426614174000" | Yes |
timestamp Required | "2023-05-28T14:45:00Z" | No |
userAgent Required | "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" | No |
ttp Required | "a1b2c3d4e5f6" | Yes |
email Recommended | SHA-256 hash: 587dfd511a0c05a6d71c4afae60bece0a5f8ccf2f7e7b1c74e3b9f1a5f8f5152 | No |
phone_number Recommended | SHA-256 hash: b1a8fd06fc2a2d5f2f03027e6d0d85ad9a9c0d1dcb8821b4d4cfc4d6d38b8b82 | No |
Additional TikTok for Business Documentation
Updated 1 day ago