snowplow / snowplow/snowplow-javascript-tracker
Add functionality to set the Network User Id
@igneel64 is already working on this.
Since Sep 12, 2023.
- Dominant language
- TypeScript
- Stars
- 590
- Forks
- 232
- Avg merge
- 2h 22m
- Merged PRs (30d)
- 3
Description
Is your feature request related to a problem? Please describe.
I need to set my own Network User ID. The advantages of setting a seperate value is that it is one defined by the platform to give a common anonymous user ID. This way different tools can have a same user definition.
Another major advantage is guarding against Apple ITP resetting the user ID on every return visit.
The collector cookie (Network user ID) is designed to solve this but another difficulty is that we use an API gateway that is on a seperate domain to our customer facing sites. If we did get the header cookie to be forwarded it would not resolve our issue.
Describe the solution you'd like
A new function setNetworkUserId and/or setNetworkUserIdFromCookie that sets the tnuid value in the tracker protocol.
Describe alternatives you've considered
Setting a new custom context including the value. The main disadvantages with this are:
- We would need to do this everywhere with every request adding unnecessary bloat to the payload and making for a more complex implementation for all FE engineers.
- The data is less accessible and something this important should be available on root level.
Additional context
The tracker protocol offers a network user override here. It would make sense give the option to use this.
Contributor guide
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.
Assessment
This issue has not been assessed yet.