Hi team,
I want to store all daily data of users in Playfab server in order that I can make the daily report in our app.
For example,
On Monday, an user does the task list: Task 1 -> Task 2 -> Task 3....
On Tuesday, he does other task list: Task 3 -> Task 2 -> Task 4...
And continuing...
So could you tell me how to store the user's data of all days in Playfab server?
Many thanks.
Answer by Citrus Yan · Oct 12, 2020 at 08:24 AM
In your case I would suggest you use PlayStream events to keep track of players’ daily data. For instance, when player A finishes task A, write an event looks like the following:
{ ... "EventNamespace": "title.xxx", "Timestamp": "2020-10-12T00:00:00.0000000Z", "EventName": "player_completed_task", "EntityId": "xxx", "TaskName": "A", ... }
All the event data generated by your title will be stored in PlayFab Insights, where you can query them freely and therefore make a report from it. There are many ways to access Insights data, you can either use our built-in query tool Explorer, or connect other external tools to it: Connecting external tools to Insights.
In additional, please also note that Insights data has default retention setting of 30 days, if you need more than that, you can adjust it in Insights Management under the data section in Game Manager: https://docs.microsoft.com/en-us/gaming/playfab/features/insights/insights/performance-retention#retention
Thanks Citrus, following your comments, I understand that I can use PlayFabClientAPI.WritePlayerEvent() to write an event when an player finishes an task. And then we will have the list of events.
But I am confusing about making the report in my app. For example, if player queries the data in one week then the data list following date from Monday to Sunday will be shown in the client. (Not an admin page)
So how to do like this? In Playfab, do we have any API function for reading events or some thing to do this?
Thank you again.
I was assuming that you wanted to make a report based on all the players' event data and analyze it internally. Clients have no authority to read events or something similar. In your case, I think you could just use Player Data instead, every time a player completes a task, add it with the timestamp into player data, players can request it and make a report based on this.
Thanks, but how do I store player data with the timestamp in Playfab? what kind of API that we will use to store data? Because we have a lot of player data day by day after they finish tasks.
Thank you so much for your support!!! I will try following your comments.