segmentio / segmentio/analytics.js-integrations
Feature request: Support for passing traits to analytics.track()
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 125
- Forks
- 136
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 1
Description
My current understanding of Segment's API:
analytics.track()supports passing properties associated with the event.analytics.identify()supports passing traits that are associated with the user.- #1 and #2 above are two separate API calls and there is no ordering guarantee; that is, they'll won't be delivered to the destination in the same order they were called.
This is a problem because some destinations, such as Amplitude, will associate traits with events under-the-hood. So if the event was sent to the destination, Amplitude, before the traits, the traits won't be associated with that event and thus will be useless.
For this reason, Amplitude supports passing user traits along with API calls to create events here,. This essentially combines analytics.track() and analytics.identify() into a single, atomic API call to:
- Create a new event
- Associate properties with that event
- Update traits on the user that are queryable in Amplitude at the time of that event
Would it be possible to add the ability to pass traits to analytics.track() that will be forwarded to destinations that support it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the analytics.track() entry point and review how integrations receive event properties and identify traits. Check the linked Amplitude API documentation and determine which destinations can accept traits with events; done means supported destinations forward them atomically without changing existing track behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100