feat(tiktokPixel): production hardening - region, CAPI dedup, advanced matching#776
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR extends the TikTok Pixel integration with region-aware routing and enhanced event tracking capabilities. It adds a Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
commit: |
|
fyi @felixgabler |
🔗 Linked issue
Follow-up to #773.
❓ Type of change
📚 Description
Builds on the typed
event_id/standard-events surface added in #773 to make the registry entry production-ready for enterprise setups.region: 'us' | 'global'— routes the Pixel SDK throughanalytics.us.tiktok.com(defaultanalytics.tiktok.com) for US data residency. Bundle resolver and proxy domain allowlist both updated.TrackOptions.test_event_code— TikTok's Test Events sandbox identifier so QA traffic doesn't pollute production reporting.EventProperties.order_id— transaction-level dedup, complementing the event-levelevent_id.IdentifyProperties— addsfirst_name,last_name,city,state,country,zip_code(advanced matching fields beyond email/phone/external_id).identify()now logs a console warning in dev when a SHA-256 hex check fails for any matching field. Tree-shaken in production viaimport.meta.dev.ohashSHA-256 example).✅ Verification
pnpm test:types— 38/38 pass (12 pre-existing posthog version-mismatch errors unrelated to this PR).region: 'us'-> SDK loads fromanalytics.us.tiktok.com.identify({ email: 'plain@x.com' })-> console warning logged.