How to get values for session_isFirst using application insights query

39 Views Asked by At

Azure Application Insights continues export data json contains following fields,

"context": {
    "session": {
        "id": "5JMv4",
        "isFirst": false
    }
}

But I could not find this session IsFirst in app insights ( pageViews | getschema) how azure is mapping this values in continues export, because I want to manually export data, and wants know from which field I need read data for isFirst fields.

1

There are 1 best solutions below

0
Suresh Chikkam On

When we manually exporting data from Application Insights, we might have the option to include additional properties or manipulate the data before exporting it. In this case, isFirst appears to be a property that is derived or added during the export process, rather than being a native property of telemetry data.

  • In Azure Application Insights, the session_isFirst property is typically not directly available as a top-level field in the pageViews table. Instead, it is derived or computed based on the session information available in the context field.

It means that the session_isFirst property is being derived from the context.session.isFirst field. To manually export this information, you would need to extract it from the context field.

Query:

pageViews
| project timestamp, user_Id, session_Id = tostring(customDimensions.SessionId), session_IsFirst = tostring(customDimensions.SessionIsFirst)
| summarize isFirstSession = any(session_IsFirst == "true"), count() by user_Id
| project user_Id, isFirstSession

Here I have Tracked a sample user sessions in Azure Application Insights and then exported the data manually.

enter image description here

  • customDimensions.SessionId and customDimensions.SessionIsFirst are placeholders for the actual field names that the Application Insights schema might use.