Connect TikTok Events API
Connect TikTok Events API -- Perspection Setup Guide
Connect Perspection to TikTok Events API in under 5 minutes. Server-side tracking with SHA-256 hashing, 1,000 req/min rate limit, and quality scoring.
Perspection connects to the TikTok Events API v1.3 through a server-side integration that bypasses browser ad blockers and cookie restrictions. The setup requires 2 credentials -- a Pixel ID and an Access Token -- both obtained from TikTok Ads Manager. Perspection automatically normalizes and SHA-256 hashes all personally identifiable information (email, phone) before dispatching events to TikTok servers. The TikTok connector supports 1,000 requests per minute per access token, maps 20+ event types to TikTok standard events, calculates a real-time Event Match Quality score for every dispatch, and enforces GDPR/CCPA compliance through the Limited Data Use flag. An optional Baseline Pixel Code field enables side-by-side comparison of server-side conversion recovery against existing browser pixel tracking.
Why is server-side TikTok event tracking more reliable than the browser pixel?
The TikTok browser pixel loses 25-40% of conversion data to ad blockers, ITP cookie restrictions, and third-party cookie deprecation. Perspection sends event data directly from server to server via the TikTok Events API v1.3, eliminating browser-level interference. Perspection tracks TikTok's 1,000-request-per-minute rate limit in real time to prevent throttling.

Browser-based TikTok tracking faces three compounding reliability problems:
Ad blocker interference -- Browser extensions like uBlock Origin, AdGuard, and Brave Shields block requests to
analytics.tiktok.comandevents.tiktok.comdomains. Ad blocker adoption exceeds 40% on desktop browsers, meaning the TikTok pixel never fires for a significant share of visitors.Cookie restrictions -- Safari's Intelligent Tracking Prevention (ITP) caps third-party cookie lifetimes at 7 days for first-party and 24 hours for classified tracking scripts. The TikTok
_ttpcookie andttclidclick identifier degrade under these restrictions, reducing attribution accuracy for return visitors.Client-side JavaScript failures -- Network timeouts, Content Security Policy (CSP) violations, and page-load race conditions prevent the TikTok pixel from executing. When a user closes the browser tab before the pixel fires on a purchase confirmation page, TikTok never receives the conversion signal.
Perspection eliminates all three failure modes by processing events server-side. Perspection's browser SDK captures the raw event -- including the _ttp cookie and ttclid click identifier -- and sends the event payload to Perspection's ingestion endpoint. The Perspection processing pipeline enriches the event with identity resolution data, then the dispatch worker transmits the event directly to the TikTok Events API v1.3 endpoint (https://business-api.tiktok.com/open_api/v1.3/event/track/). Because the server-to-server request originates from Perspection infrastructure, ad blockers and browser cookie policies have no effect on delivery.
The TikTok connector also implements automatic retry with exponential backoff. Failed requests retry up to 3 times with delays of 500ms, 1,000ms, and 2,000ms. HTTP 5xx errors and 429 rate-limit responses trigger retries; HTTP 4xx validation errors do not retry, preventing wasted quota on malformed payloads.
For a comparison of how server-side tracking works across advertising platforms, see Connect Meta Conversions API.
How do you connect Perspection to the TikTok Events API?
Connecting Perspection to TikTok requires 2 credentials: the Pixel ID (pixel_code in the TikTok API) and an Access Token, both from TikTok Ads Manager under Tools > Events. Setup takes under 5 minutes, and Perspection validates the connection by sending a test ViewContent event to the TikTok API after saving.
Step-by-step connection setup
Open the Perspection dashboard -- Sign in at
dashboard.perspection.appand select the workspace where TikTok tracking will be configured.Navigate to Connectors > Destinations -- Click "Connectors" in the sidebar, then select "Destinations" from the submenu.
Select TikTok -- Locate the TikTok card (labeled "TikTok -- Events API") in the destination list. Click the card to expand the configuration form.
Obtain the Pixel ID from TikTok Ads Manager -- Open TikTok Ads Manager at
ads.tiktok.com. Navigate to Tools > Events. Select the pixel associated with the advertising account. Copy the Pixel ID displayed on the pixel overview page.Enter the Pixel ID -- Paste the Pixel ID into the "Pixel ID" field in the Perspection dashboard. The Pixel ID is a numeric string (e.g.,
C5TPJNOLCF77U9T0JG3G).Generate an Access Token in TikTok Ads Manager -- In TikTok Ads Manager, navigate to Events Manager > select the pixel > Settings. Click "Generate Access Token." Copy the token immediately -- TikTok does not display the token again after generation.
Enter the Access Token -- Paste the Access Token into the "Access Token" field in Perspection. The field uses a password mask to protect the credential.
Save the destination -- Click "Save" to store the configuration. Perspection encrypts the access token at rest in the data plane database.
Test the connection -- Click "Test" to send a validation event. Perspection dispatches a test
ViewContentevent to the TikTok Events API and reports success or failure with latency in milliseconds.Enable the destination -- Toggle the "Live" switch to start dispatching production events to TikTok.
Required and optional fields
Field | API Key | Required | Description |
|---|---|---|---|
Pixel ID |
| Yes | The TikTok pixel identifier from Ads Manager > Tools > Events |
Access Token |
| Yes | Server-side API token generated in Events Manager > Pixel > Settings |
Baseline Pixel Code |
| No | An existing TikTok pixel code for conversion recovery comparison |
Perspection stores destination credentials in the data plane database, encrypted and scoped to the workspace's tenant ID with row-level security.
What data does Perspection send to TikTok for each event?
Perspection sends 5 categories of data to TikTok for every event: event metadata (event name, ID, timestamp), user identifiers (SHA-256 hashed email and phone, external_id, ttp cookie, ttclid, IP, user agent), page context (URL, referrer), commerce properties (value, currency, content_type, contents array), and a Limited Data Use flag for GDPR/CCPA compliance.
Event payload structure
The TikTok connector transforms every Perspection event into the TikTok Events API v1.3 data format. The following table shows the complete field mapping:
Event Metadata
TikTok Field | Source in Perspection | Example |
|---|---|---|
| Mapped from |
|
|
|
|
|
|
|
User Data
TikTok Field | Source in Perspection | Hashing |
|---|---|---|
|
| SHA-256 (lowercased, trimmed) |
|
| SHA-256 (digits only) |
|
| Sent as-is |
|
| Sent as-is (first-party cookie) |
| Extracted from | Sent as-is (click identifier) |
|
| Sent as-is |
|
| Sent as-is |
|
| Converted to |
|
| Sent as-is |
Page Data
TikTok Field | Source in Perspection |
|---|---|
|
|
|
|
Commerce Properties (for purchase, cart, and checkout events)
TikTok Field | Source in Perspection |
|---|---|
|
|
|
|
| Set to |
| Mapped from |
Event name mapping
Perspection automatically maps raw event names to TikTok standard event names. The connector strips any dl_ prefix (from Google Tag Manager DataLayer events) before mapping:
Perspection Event | TikTok Standard Event |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All other events |
|
Internal events such as identify, session_start, page_hidden, perspection_consent_update, and GTM lifecycle events (gtm.dom, gtm.load, gtm.js) are automatically skipped and never dispatched to TikTok.
How does Perspection handle TikTok PII hashing and compliance?
TikTok requires SHA-256 hashing for all PII sent through the Events API. Perspection normalizes and hashes server-side: emails are lowercased, trimmed, and SHA-256 hashed; phone numbers are stripped to digits and hashed. The _ttp cookie and ttclid click identifier are sent unhashed for click attribution. Perspection applies a Limited Data Use flag for GDPR/CCPA compliance based on consent.
Hashing protocol
Perspection's base connector implements two hashing functions used by the TikTok connector:
Email hashing -- The
hashEmailfunction converts the email to lowercase, removes leading and trailing whitespace, and produces a SHA-256 hex digest. Example:User@Example.combecomes the SHA-256 hash ofuser@example.com.Phone hashing -- The
hashPhonefunction strips all non-digit characters (spaces, dashes, parentheses, plus signs) and produces a SHA-256 hex digest of the numeric string. Example:+1 (555) 123-4567becomes the SHA-256 hash of15551234567.
If the Perspection SDK (v3.0+) has already pre-hashed user data on the client side, the connector uses the pre-hashed values directly from user_data.email_hash and user_data.phone_hash, avoiding double hashing.
Limited Data Use (LDU) compliance
The TikTok connector applies the limited_data_use flag based on two sources:
Consent enforcement service -- When Perspection's consent pipeline has evaluated user consent, the connector reads the
sendable_to_ads,ad_storage, andad_user_dataconsent signals and calculates the appropriate LDU flag via theconsentEnforcementService.getTikTokLDU()function.Default fallback -- When consent signals are not available, the connector defaults
limited_data_usetotrue, ensuring privacy-compliant behavior until explicit consent is collected.
When limited_data_use is true, TikTok restricts the use of event data for audience building and ad optimization, ensuring compliance with GDPR, CCPA, and other privacy regulations.
How do you set up TikTok baseline comparison to measure conversion recovery?
Perspection's Baseline Pixel Code field enables side-by-side comparison between server-side and existing TikTok browser pixel tracking. Enter the existing TikTok Pixel Code in the optional "Baseline Pixel Code" field when configuring the TikTok destination. Perspection compares server-side conversion counts against TikTok's browser pixel numbers, surfacing a recovery value showing additional conversions Perspection captured that the browser pixel missed.
Setting up baseline comparison
Identify the existing TikTok Pixel Code -- Open TikTok Ads Manager > Tools > Events. Copy the Pixel ID of the browser pixel currently installed on the website.
Open the TikTok destination in Perspection -- Navigate to Connectors > Destinations and expand the TikTok card.
Enter the Baseline Pixel Code -- Paste the existing pixel code into the "Baseline Pixel Code" field (marked as Optional).
Save the configuration -- Click "Save." Perspection begins collecting comparison data immediately.
Review recovery metrics -- Open the Analytics section to view baseline comparison reports. The recovery value represents the delta between Perspection's server-side conversion count and the TikTok browser pixel's self-reported count.
What the recovery value measures
The recovery value quantifies conversions that Perspection's server-side dispatch captured but the TikTok browser pixel missed. Common sources of recovered conversions include:
Ad-blocked sessions -- Visitors running ad blockers where the TikTok browser pixel never loaded.
Cross-browser and cross-device purchases -- Users who clicked a TikTok ad on mobile but completed the purchase on desktop, where identity resolution links the sessions.
Delayed conversions -- Purchases completed after the TikTok browser pixel's
_ttpcookie expired (ITP caps at 7 days on Safari).JavaScript failure scenarios -- Checkout completions where the browser pixel failed to fire due to CSP restrictions, network errors, or race conditions with single-page application routing.
For detailed analysis of match quality across destinations, see Event Match Quality Scoring.
How do you verify TikTok events are being received correctly?
Perspection provides 3 verification methods for TikTok event delivery: the built-in connection test button (sends a test ViewContent event with latency reporting), TikTok's Test Events tool in Ads Manager (sandbox testing via Test Event Code), and the Perspection destination health dashboard (delivery success rates, error codes, latency percentiles). Use all three during initial setup to confirm end-to-end flow.
Method 1: Perspection connection test
Navigate to Connectors > Destinations -- Expand the TikTok destination card.
Click "Test" -- Perspection sends a test
ViewContentevent to the TikTok Events API using the configured Pixel ID and Access Token.Review the result -- Perspection displays "Connection test successful!" with latency in milliseconds for a passing test, or an error message with the TikTok API error code for a failing test.
Quality coaching -- The test result includes an Event Match Quality score with recommendations for improving data quality. A minimal test event scores low because the test event contains no user identifiers; production events score higher.
Method 2: TikTok Test Events tool
Open TikTok Ads Manager -- Navigate to Tools > Events > select the pixel.
Click "Test Events" -- TikTok displays the Test Events tab where incoming test events appear in real time.
Copy the Test Event Code -- If TikTok displays a test event code, copy the code.
Enter the code in Perspection -- Paste the test event code into the "Test Event Code" field in the TikTok destination configuration on the Perspection dashboard. Note: the TikTok connector currently does not expose a separate test event code field in the UI, but the field is supported in the API payload as
test_event_code.Trigger test events -- Browse the website to generate page views, add-to-cart actions, or test purchases. Events sent with a test event code appear in TikTok's Test Events tab without affecting production reporting.
Verify event parameters -- In TikTok's Test Events view, confirm that event names (e.g.,
PlaceAnOrder,AddToCart), user parameters (hashed email, hashed phone), and commerce properties (value, currency, contents) match expected values.Remove the test event code -- After verification, clear the test event code field in Perspection and save. Production events will no longer be tagged as test events.
Method 3: Perspection destination health monitoring
Open the Pipeline section -- Navigate to the Pipeline page in the Perspection dashboard.
Review dispatch status -- Perspection displays real-time delivery metrics per destination, including success rate, error rate, average latency, and most recent error messages.
Check for common errors -- The most frequent TikTok API errors include:
40001-- Invalid access token (regenerate the token in TikTok Ads Manager).40002-- Invalid pixel code (verify the Pixel ID matches the value in TikTok Ads Manager).40100-- Rate limit exceeded (Perspection automatically tracks the 1,000 requests per minute limit and backs off).50000-- TikTok internal server error (Perspection retries automatically with exponential backoff up to 3 attempts).
For detailed guidance on monitoring destination health across all connected platforms, see Destination Health Monitoring.
How does Perspection score TikTok event match quality?
Perspection calculates a real-time Event Match Quality score for every TikTok dispatch across 5 weighted factors: email (30%), phone (25%), external ID (20%), browser data (15%), and event data (10%). Maximum score is 100. Events below 70 for browser sources or below 50 for offline conversions trigger quality coaching recommendations in the Perspection logs.
Quality score breakdown
Factor | Weight | Maximum Points | What Earns Full Points |
|---|---|---|---|
Email quality | 30% | 10 | SHA-256 hashed email present |
Phone quality | 25% | 10 | SHA-256 hashed phone present |
External ID quality | 20% | 10 | Customer |
Browser data quality | 15% | 10 | TikTok |
Event data quality | 10% | 10 | Value (3 pts) + currency (2 pts) + contents array (3 pts) + content_id (2 pts) |
Quality thresholds
Browser events: 70 minimum -- Standard events from the Perspection browser SDK should score 70 or higher because the SDK captures user agent, IP address, and the TikTok
_ttpcookie automatically.Offline conversions: 50 minimum -- Events from CSV uploads, Shopee COD confirmations, or Lazada COD confirmations score lower because offline sources lack browser context (no user agent, no IP, no
_ttpcookie). The 50 threshold requires at least a hashed email or hashed phone for TikTok to match the conversion.Excellent: 85+ -- Events with hashed email, hashed phone, external ID, full browser data, and commerce properties achieve scores above 85, enabling optimal TikTok attribution and audience building.
Improving event match quality
Capture email at checkout -- Ensure the checkout form collects email before the purchase event fires. Perspection's identity resolution pipeline automatically associates the email with the user's event stream.
Preserve the TikTok
_ttpcookie -- Deploy Perspection's first-party domain tracking to set the_ttpcookie under the website's own domain, extending the cookie lifetime beyond ITP restrictions.Pass product details in e-commerce events -- Include
itemsorline_itemsarrays withproduct_id,name,quantity, andpricein purchase and add-to-cart event properties.Include phone numbers when available -- Phone number hashing adds 2.5 points to the weighted quality score, significantly improving TikTok's ability to match conversions to ad clicks.
For a comprehensive guide to optimizing match quality across all advertising platforms, see Event Match Quality Scoring.
Methodology
All TikTok Events API configuration steps and event mapping tables in this guide were verified against the Perspection production dashboard and live TikTok Events Manager as of February 2026.
"TikTok's Events API attribution model weights the
_ttpcookie andttclidclick identifier more heavily than hashed email or phone for real-time ad optimization. However, the hashed identifiers become critical for offline conversions and cross-device attribution where click cookies are unavailable. Perspection's quality scoring reflects this reality -- browser data quality is weighted at 15%, but for offline conversions, that 15% is effectively unreachable, which is why the offline threshold drops to 50 from 70. The practical takeaway: invest in first-party domain tracking to preserve the_ttpcookie across Safari and Firefox, and ensure email capture happens before the purchase event fires." -- Perspection Engineering Team
Sources & References
TikTok Events API -- Getting Started, https://business-api.tiktok.com/portal/docs?id=1741601162187777
TikTok Events API -- Parameters, https://business-api.tiktok.com/portal/docs?id=1741601162187777
TikTok for Business -- Conversion Tracking Best Practices, https://ads.tiktok.com/help/article/conversion-events
Perspection Product Guide -- Event Match Quality, /library/event-match-quality-guide
Perspection Product Guide -- Destination Health, /library/destination-health-failed-events-guide