feat: add identify/group - #210
Merged
Merged
Conversation
Adds identify() and group() to the browser and server entries, posting to /_vercel/insights/identify and /group with flat traits. Every operation (track, pageview, identify, group, trackExposure) now forwards a runtime-only __cdp envelope untouched, next to the regular payload. The field is deliberately absent from the public type declarations, as agreed in the CDP transport ADR.
|
Your Vercel team Analytics Test Projects is not permitted to deploy from this git repository. Contact an administrator to add github organization vercel as a Protected Git Scope in Analytics Test Projects on Vercel. Once added, commit again to see your changes. Learn more: https://vercel.com/docs/security/protected-git-scopes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🖖 What's in there?
identify()andgroup()to@vercel/analyticsand@vercel/analytics/server. They post to/_vercel/insights/identifyand/groupwith flat traits.track,pageview,identify,group,trackExposure) forwards an optional, internal envelope untouched, next to the regular payload.🤺 How to test?
pnpm -F @vercel/analytics testpnpm -F @vercel/analytics build, then check thatdist/**/*.d.tsdoes not expose the internal option.🔬 Notes to reviewers
InternalOptions. Tests usewithCdp()as the single assertion CDP will also need.trackproperties: ingestion only accepts primitives ined.trackExposureconvention:VERCEL_WEB_ANALYTICS_ENDPOINTas base URL,VERCEL_WEB_ANALYTICS_IDENTIFY_ENDPOINT/_GROUP_ENDPOINTas verbatim overrides.🔗 Related PRs