How to retrieve player data from Unity Cloud Save for Analytics?

Hi everyone!

I’m working on a Unity WebGL project where I’ve been saving player-specific data (like player name, button presses, and time taken for puzzles…) using Unity Cloud Save. However, Unity Cloud Save currently stores data separately for each player. How can I retrieve and aggregate data from all players at once to analyze things like who entered the game first, who presses the button the fastest, etc.? Any insights on how to approach this?

1 Like

(moved thread to Unity Services category)

Sounds like a job for Leaderboards because that’s about logging fastest, smallest, most, etc.
You can also use Cloud Code to perform queries on Cloud Save.

Thank you for your response. If I understand correctly from what I check out with leaderboard, it seems like Leaderboards can only save one score per player. However, I don’t just want to save one score; I also want to store other types of data, such as the player’s name, which button they pressed, whether their answer was correct or not, and so on. Does this also work with Leaderboards, or can you suggest another tool?

Hi @nguyenngoclan1401

Unity Cloud Save is designed for storing individual player data, meaning it doesn’t support querying or aggregating data across multiple players. If you’re looking to analyze trends like first-time logins, button press frequency, or puzzle completion times across your entire player base, Unity Analytics is the better tool for the job.

While Unity Analytics provides some built-in events, these don’t automatically track specific player actions like button presses or time taken to complete puzzles. To gather this type of data, you’ll need to send custom events. Custom events allow you to track specific in-game actions and attach relevant parameters—like when a player enters the match (matchEntered), when they press a button (buttonPress), when they solved a puzzle (puzzleCompleted), etc.

Once these events are sent to Unity Analytics, you can analyze them across all players to determine things like who entered first or who pressed a button the fastest.

However, keep in mind that tracking frequent actions like button presses can generate a large volume of events, which may become overwhelming. If your project has a lot of button interactions, consider only logging key moments (e.g., first press, last press, or presses within a specific time frame) rather than every single input, or consolidating many button presses actions into a single event, or only tracking important button presses vs all button pressed. Judging by your opening message, I’d say you’ve already got this ironed out, but just in case!

3 Likes

I’d recommend Analytics for being able find out the answers to questions like the ones you’ve got here.

However, if you’re wanting to use the data you have in Unity Cloud Save, then you could get part of the way there using querying - which could let you refine your searches for specific values.

Generally though, the aggregation is something you’d need to accomplish yourself if you’re using Cloud Save for this.

I’d recommend Randy’s solution of using Analytics for game performance metrics, and Cloud Save for player progress data and the like.

1 Like

+1 to everything @RandolfKlemola and @unity_Ctri have said!

I wanted to add to this to acknowledge this sort of use case is something we are actively working on and we are working on improving the developer experience and integrations between products like Unity Cloud Save and Unity Analytics.

I really appreciate this requests as we have been discussing aggregated data, which is something Unity Analytics supports, but Unity Cloud Save does not, and how we can help developers best solve for use cases that might involve one or both.

As it stands today, in some cases Cloud Save Queries will be the best approach and in some cases it will Analytics, possibly depending on if it’s real time / player scale for game mechanics or not.

Regarding Leaderboards, a common approach, depending on the use case, is to use Leaderboards Metadata, if you just wanted to be able to display this information in-game.

We recently updated the Leaderboards documentation to improve the examples for Metadata:

[Serializable]
public class ScoreMetadata
{
    public string levelName;
    public int timeTaken;
}

public async void AddScoreWithMetadata(string leaderboardId, int score)
{
    var scoreMetadata = new ScoreMetadata { levelName = "LEVEL_01", timeTaken = 120 };
    var playerEntry = await LeaderboardsService.Instance
        .AddPlayerScoreAsync(
            leaderboardId,
            score,
            new AddPlayerScoreOptions { Metadata = scoreMetadata }
        );
    Debug.Log(JsonConvert.SerializeObject(playerEntry));
}

As things stand today, you would still need to send the Metadata data to Analytics to do analysis afterwards though.

I don’t think we’ve explored also automatically sending Leaderboards Metadata to Analytics - for example as a configuration option on a Leaderboard - I’ve only had conversations around doing this with Cloud Save specifically but I would be very open to us exploring Leaderboards + Analytics integrations if thats a common use case (please let us know if you are a developer interested in that!).

Related to this, we are also looking at surfacing data from Cloud Save in the Data Explorer, so it can be used for queries. I would be similarly interested to hear if using Leaderboards data would also be something developers want to use.

Again - as folks were saying above - it’s all possible today, but you would currently need to explicitly send that data to Unity Analytics, but I’m very interested in doing this automatically or at least making it possible through configuration rathe than needing code.

Best regards,

Iain

Hi,

We’re using Cloud Save to store data like player ranks in their public data. What would be the best approach for analyzing this for example, determining how many players are above level 10?