question

doronhn avatar image
doronhn asked

I created two custom events - how can i see data based on that inner json body?

hey,

i created two custom events:

1. player_play_level - triggered every time when player plays in a level
2. player_passed_level - triggered every time when player passed to a new level

In both of the events i add "body" with some data that i want to search by.

i checked and i can see the data in the JSON of the event:

"level_id": 3,
"total_attempts": 1


what is the next step?
how can i see this event data for my all title?


in the end,

i want to understand which are the levels that players find it hard to pass?

what is the AVG attempts for each level based on dates?

and so on.

is it possible?

Thanks

dataanalyticsPlayStream
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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> how can i see this event data for my all title?

You can use PlayFab Explorer to query the whole title’s “player_play_level” and “player_passed_level” event. You can navigate to the [GameManger]->[Data]->[Explorer(Preview)], then use the following Kusto statements to query all “player_play_level” and “player_passed_level” events.

['events.all']
| where FullName_Name == 'player_play_level'or FullName_Name =='player_passed_level'

>> i want to understand which are the levels that players find it hard to pass?

For example, you can use the following statements to count and render these events by “level_id” and “event name”. By comparing the columns of the column chart, you can find out which level harder to pass.

['events.all']
| where FullName_Name == 'player_play_level'or FullName_Name =='player_passed_level'
| summarize count() by tostring(parse_json(tostring(EventData.PayloadJSON)).level_id),
FullName_Name
| render columnchart kind = stacked

>> what is the AVG attempts for each level based on dates?

You can use the following statements to get the total number of attempts for each level in each day.

['events.all']
| where FullName_Name == 'player_play_level'
| summarize count() by bin(Timestamp, 1d),tostring(parse_json(tostring(EventData.PayloadJSON)).level_id)
| render columnchart kind = stacked

If you want to get the average number of attempts per day for each level in a time period, you can try the following statements. This example is used to get the daily average of attempts within a week.

['events.all']
| where FullName_Name == 'player_play_level'and Timestamp > ago(7d) 
| summarize event_avg = count()/7 by tostring(parse_json(tostring(EventData.PayloadJSON)).level_id)

For more detailed information about PlayFab Explorer and Kusto, please refer to the documentation -- Getting started with PlayFab Explorer and Write queries for Azure Data Explorer.

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.

doronhn avatar image doronhn commented ·

Hey,

its not working for me, the result is not as i expected, i will try explain again:

lets say i have 5 levels, i want to get this result:

level 1 : 15 (Avg total attempts for level 1 of all users)

level 2 : 30

and etc

The logic is:

sum all the total_attempts for each level and divide them with count of events for the same level_id (count of players).

example:

events

{
  
  "Source": "1660",
  "TitleId": "1660",
  "level_id": 1,
  "total_attempts": 3
}
{
  
  "TitleId": "1660",
  "level_id": 2,
  "total_attempts": 4
}
{

  "Source": "1660",
  "TitleId": "1660",
  "level_id": 2,
  "total_attempts": 6
}

level 1 - 3

level 2 - (6+4) /2 = 5

each level has its own stack bar

is it possible?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang doronhn commented ·
['events.all']
| where FullName_Name == 'player_play_level'
| extend eventData = EventData
| extend total_attempts = parse_json(tostring(eventData.PayloadJSON)).total_attempts
| extend  levelId = parse_json(tostring(eventData.PayloadJSON)).level_id
| summarize level1avg = avgif(toint(total_attempts), levelId == 1), level2avg = avgif(toint(total_attempts), levelId == 2) by tostring(levelId)
| render columnchart kind = stacked
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.