question

Timo avatar image
Timo asked

How to store the daily data in Playfab?

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.

Player DatadataTitle 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

·
Citrus Yan avatar image
Citrus Yan answered

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

5 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.

Timo avatar image Timo commented ·

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.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Timo commented ·

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.

0 Likes 0 ·
Timo avatar image Timo Citrus Yan commented ·

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.

0 Likes 0 ·
Show more comments
Timo avatar image Timo commented ·

Thank you so much for your support!!! I will try following your comments.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]