-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUM-7795 Anonymous RUM Identifier #2172
base: develop
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 1970 Passed, 1789 Skipped, 1m 4.43s Total duration (1m 25.33s time saved) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT! Only a few minor comments.
|
||
featureScopeMock.set(anonymousId: "test") | ||
|
||
anonymousIdentifierManager.manageAnonymousId(shouldTrack: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we test when the anonymousId
is set but shouldTrack
is false
? In other words, should we delete this line in order to make sure that the anonymousId
is nil
even without calling again anonymousIdentifierManager.manageAnonymousId(shouldTrack: false)
.
/// is used to link RUM Sessions belonging to the same anonyomus user. | ||
/// | ||
/// Default: `true`. | ||
public var trackAnonymousUser: Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion/ I'd consider renaming trackAnonymousUser
to trackAnonymousUserID
to emphasize that we’re persisting and using only ID, rather than tracking any personal user data. This explicit naming could also helps clarify that the data is purely non-personal, which might avoid confusion and potential privacy concerns. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid point, but AFAIK that's the API that was used in the browser.
Let me check if we can make an alignment.
If not - I'll make the docs more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great overall 👌 - I only left suggestions on naming and documenting the public API.
Requesting a change tho, to add integration unit tests for this feature. Using real instance of the SDK + proxy and asserting that anonymous ID is generated and inserted into events of two RUM sessions started in two instances of the SDK. I can help and pair on this 🙌
Co-authored-by: Maciek Grzybowski <maciek.grzybowski@datadoghq.com>
7ca3267
What and why?
Adds capability of tracking anonymous id (enabled by default). This data allows linking sessions coming from the same device.
How?
Following proposal from this RFC (internal) it reuses data store mechanism, and based on configuration it generates and reuses stored identifier.
This identifier is attached to
UserInfo
object (schema already updated), which is enriching other SDK events.Review checklist
make api-surface
)