Skip to content

feat(tiktokPixel): support event_id options on track + add missing st…#779

Closed
harlan-zw wants to merge 5 commits into
mainfrom
feat/tiktok-pixel-event-id-options
Closed

feat(tiktokPixel): support event_id options on track + add missing st…#779
harlan-zw wants to merge 5 commits into
mainfrom
feat/tiktok-pixel-event-id-options

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

…andard events

Adds optional fourth options arg to ttq('track', ...) typed overload
exposing event_id for Pixel + Events API deduplication, and adds the
current TikTok standard events Purchase and StartTrial to the
StandardEvents union.

Closes #767### 🔗 Linked issue

📚 Description

harlan-zw added 5 commits May 14, 2026 14:55
…andard events

Adds optional fourth `options` arg to `ttq('track', ...)` typed overload
exposing `event_id` for Pixel + Events API deduplication, and adds the
current TikTok standard events `Purchase` and `StartTrial` to the
`StandardEvents` union.

Closes #767
…d matching

- region: 'us' option routes SDK through analytics.us.tiktok.com for data residency
- TrackOptions: add test_event_code for Test Events sandbox
- EventProperties: add order_id (transaction-level dedup)
- IdentifyProperties: add first_name/last_name/city/state/country/zip_code
- dev warning when identify() receives unhashed values (SHA-256 required)
- docs: server-side dedup, region, test events, advanced matching sections
@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripts-playground Error Error May 14, 2026 6:28am

@harlan-zw harlan-zw closed this May 14, 2026
@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 577b20bb-f8d1-4f15-b776-c77f68042adb

📥 Commits

Reviewing files that changed from the base of the PR and between 05d3250 and 6ca5047.

📒 Files selected for processing (5)
  • docs/content/scripts/tiktok-pixel.md
  • packages/script/src/registry.ts
  • packages/script/src/runtime/registry/schemas.ts
  • packages/script/src/runtime/registry/tiktok-pixel.ts
  • test/types/types.test-d.ts

📝 Walkthrough

Walkthrough

This PR extends the TikTok Pixel script integration with data residency support and event deduplication. It adds an optional region option ('global' or 'us') that routes SDK requests to region-specific endpoints. The type contracts expand to support passing event_id in track call options (for server-side deduplication) and additional advanced-matching identity fields. A new tiktokPixelSrc() resolver handles region-specific URL generation. Dev-time validation warns when identify calls provide unhashed values for fields that TikTok requires to be SHA-256 hashed. Documentation covers the region config, deduplication workflow, sandbox testing, and hashing requirements.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tiktok-pixel-event-id-options
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/tiktok-pixel-event-id-options

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Update TikTok Pixel types for event_id options and current standard events

1 participant