1
votes

I'm trying to integrate Azure Insights telemetry with our SPA and trying to add authenticated user tracing. For this, after logging in, I call ReactAI.ai().setAuthenticatedUserContext(user_id). I can see the user_id on that specific trace, but not on subsequent ones. If I grab the session id in that trace, I can reconstitute the user journey, but would ideally like to not go through the extra step of figuring out the session id.

1
So did you ever find out the most bullet-proof way to get Auth ID set on all telemetry?Don Cheadle

1 Answers

1
votes

The full signature of the method would be:

setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string, storeInCookie = false)

You would need to set storeInCookie to true to make sure UserId is preserved across traces.

This cookie was marked as non-essential upon cookies review as per the new cookie laws and could not be an on-by-default cookie. I think you'd need "Cookie statement" on the site if you'd drop this.