question

rupindergill avatar image
rupindergill asked

session data

Hi in regards to this code, how does this calculate the number of sessions, is it by the timestamp as per summarise line? I am just figuring out how exactly it knows when a new session starts (client_session_start is triggered again)? How would we know a player is not in the same session and in fact it is different?

['events.all'] | where FullName_Name == "client_session_start" | project format_datetime(Timestamp,'yyyy-MM-dd'),Entity_Id,FullName_Name | summarize PlayerNum=dcount(Entity_Id), SessionNum=count() by Timestamp | extend AverageSession=SessionNum/PlayerNum

Player Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Neils Shi avatar image
Neils Shi answered

Based on the code you provide, it aggregates the data by timestamp and counts the number of sessions per timestamp. The event “client_session_start" is triggered when player logins in, and this session support is currently only available in Unity SDK. You can distinguish different sessions based on the EventId (PlayFab-assigned unique identifier for this event).

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rupindergill avatar image rupindergill commented ·

I wanted to see the duration of each session and what events happen within each session. I noticed for this player (entityID) for example A78D9F928C490E60, I can't see which events occurred within x session because the EventID is different across each event name. How can we get each sessionID to be the same across events if they occur in one session?

0 Likes 0 ·
Neils Shi avatar image Neils Shi rupindergill commented ·

I'm not expert at Kusto query, but if you want to check what events happen within each session, you may query the events which generated between two client_session_start events, and if you want to see the duration of session, you can query the “client_focus_change” event and check the “FocusStateDuration” property from “PayLoadJSON”.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.