I am using the Azure Application Insights JavaScript library to keep track of some business flow in my application. AppInsights uses a session_id
(saved to a cookie) to connect separate events into a flow. This value is automatically generated and managed.
The problem is that now the business flow requires me to track events from multiple domains. Can I somehow tell AppInsights-JS that I want to continue a previous session? If the current session could be serialized into a string, and loaded on an other page, that would be perfect, I could just pass it along as a query parameter to the page on the other domain.
My first thought was to save the ai_user
and ai_session
cookie values, but it feels like hacking the system.
The solution I am currently using is to maintain a custom sessionid myself, and pass it to every tracked event as a custom dimension. This way I can filter the events based on this field to obtain the events of a business flow. It's a bit harder to use this way.
Is it safe to just save and store the cookie values? Or is there any better way to do this?