snowplow / snowplow/snowplow-javascript-tracker

Add functionality to set the Network User Id

Open
#1,236 7 comments 0 reactions 1 assignee View on GitHub

@igneel64 is already working on this.

Since Sep 12, 2023.

type:enhancement
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:

  1. 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.
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.