Skip to content

fix(tiktok): send the Events API 2.0 body - #769

Open
laurentdav wants to merge 1 commit into
elbwalker:mainfrom
laurentdav:fix/tiktok-events-api-2
Open

laurentdav wants to merge 1 commit into
elbwalker:mainfrom
laurentdav:fix/tiktok-events-api-2

Conversation

@laurentdav

Copy link
Copy Markdown

Fixes #768.

What

  • Request body is now the Events API 2.0 format the /open_api/v1.3/event/track/ endpoint expects: top-level event_source: "web", event_source_id (pixel code), partner_name?, test_event_code?, data[]; each item has event, event_time (seconds), event_id, user, page, properties (no more pixel_code, context, ISO timestamp).
  • Client IP and user agent go to user.ip / user.user_agent.
  • phone_number is still accepted as a mapping key and sent as phone; phone works too.
  • Email (trimmed, lowercased), phone (digits and +) and external_id (trimmed) are normalised before SHA-256; an existing SHA-256 hex digest is kept. ttp, ttclid, locale stay in clear as before.
  • Types, step examples, tests, settings descriptions and website/docs/destinations/server/tiktok.mdx follow. Changeset: patch.

Why

With the 1.0 body on the 2.0 endpoint no server event reached TikTok in our production flow. We have been running a patched copy with this body since.

Verify

npm run verify:touched -- server-destination-tiktok: typecheck, lint, 32 tests and step examples pass.

🤖 Generated with Claude Code

The destination posted the Events API 1.0 body (pixel_code, context) to
the 2.0 endpoint /open_api/v1.3/event/track/: TikTok recorded nothing.
Now event_source/event_source_id, user/page per event, event_time in
seconds, phone_number sent as phone, identity fields normalised before
hashing.

Fixes elbwalker#768

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a46a7722-32e3-4687-8864-545cac9d0b2e
Commits

Reviewing files that changed from the base of the PR and between dedbdf7 and 0069cf2.

Files selected for processing: 9

  • .changeset/tiktok-events-api-2.md
  • packages/server/destinations/tiktok/src/__tests__/hash.test.ts
  • packages/server/destinations/tiktok/src/__tests__/index.test.ts
  • packages/server/destinations/tiktok/src/examples/step.ts
  • packages/server/destinations/tiktok/src/hash.ts
  • packages/server/destinations/tiktok/src/push.ts
  • packages/server/destinations/tiktok/src/schemas/settings.ts
  • packages/server/destinations/tiktok/src/types/index.ts
  • website/docs/destinations/server/tiktok.mdx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server-destination-tiktok: Events API 1.0 body sent to the 2.0 endpoint

1 participant