marius-O
marius-O

Reputation: 395

Azure Insights telemetry not showing Auth ID on all transactions

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.

Upvotes: 1

Views: 1332

Answers (1)

Dmitry Matveev
Dmitry Matveev

Reputation: 2679

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.

Upvotes: 1

Related Questions