Best analytics approach for level difficulty

Hi there,
I’m new to Unity Analytics and have been trying to use them in order to track the difficulty of levels in my puzzle game. I’d love to get your feedback on the best way to do this as I think my current method is problematic.

Basically, I want to get a feel of how hard my levels are by seeing how many people beat each level, how many people lose on each level, and how many moves it took them to get to that state (along with other data).

The way I’ve gone about this is by implementing my own Analytics class which contains the following method:

    /// <summary>
    /// Sends specific custom event to server for when the player finishes a level.
    /// Here we try to track how difficult levels are and how many people try them.
    /// </summary>
    /// <param name="levelName">Name of level the player is currently in.</param>
    /// <param name="won">True if the player managed to beat the level this time. False if he lost before he got to finish the level.</param>
    /// <param name="levelPlaytime">Amount of time the player has spent on this level.</param>
    /// <param name="moveCount">Amount of moves the player made before getting here.</param>
    /// <param name="lifeCount">Amount of lives left the player had before getting here.</param>
    /// <param name="fillPercentage">Percentage of fill the player performed before getting here.</param>
    public static void OnFinishedLevel(string levelName, bool won, float levelPlaytime, int moveCount, int lifeCount, int fillPercentage)
    {
        AnalyticsResult res = Analytics.CustomEvent(levelName + " - levelFinish", new Dictionary<string, object>
        {
            { "wonLevel", won },
            { "levelPlaytime", levelPlaytime },
            { "moveCount", moveCount },
            { "lifeCount", lifeCount },
            { "fillPercentage", fillPercentage }
        });
        Debug.Log("OnFinishedLevel status: " + res);
    }

In concept, this makes sense as it groups all my relevant data together.
However, in practice when looking at my data it’s all scrambled up:

  • The Event Manager view just summarises my custom event so I can’t see individual results there, or link parameters inside to one another (I.E. I can’t tell which levelPlaytime belongs to which moveCount and so on)
  • The Data Explorer view can’t handle such a large number of events (as each level is its own Custom Event by name), so it crashes frequently and still doesn’t let me view individual results.
  • The Funnel Analyzer doesn’t seem to work for me (I created a funnel for each Custom Event’s wonLevel condition but since the creation of the funnel it has not shown any data)

I’m sure there’s a better way than what I’m doing. Could anyone give me their two cents on where I went wrong?

Thanks in advance!

@Clicksurfer A Funnel is what you want, they were designed exactly for this purpose. Can you share the conditionals you have set for your first funnel step? Perhaps share a screenshot?

Absolutely. Thanks for dropping by :slight_smile:

As you can see, Funnel Analyzer reports that no users have progressed through my funnel:

When previewing, I can see the conditions - It checks for the Level(X) - levelFinish event, when wonLevel is set to 1:

This goes on like this for each level in my game, of course.

Any idea what may be causing the issue?

EDIT:

I can see that the event I create in the code defines wonLevel as a boolean. So could it be my issue is stemming from the fact that I am checking if it’s equal to 1, when I should be checking if it’s equal to “TRUE”?
What’s the correct syntax for checking for booleans in a Funnel condition?

@Clicksurfer Now that is a very good question! I believe you are on the right track, I’m not exactly sure what the boolean syntax would be without testing, sorry about that. Can you try with a new funnel and check? Also, keep in mind that a funnel only begins to process events AFTER the funnel is created, it doesn’t back fill with previously sent events. And it can take 8-16 hours for the funnel data to show up, after we receive the event, and sometimes longer.

No worries. I created a new Funnel, which coincides with my new event format.
I decided that putting the level name as a parameter inside the event would be more correct than to create an individual event type per level. Please let me know if this seems more/less correct to you.

    public static void OnFinishedLevel(string levelName, bool won, float levelPlaytime, int moveCount, int lifeCount, int fillPercentage)
    {
        AnalyticsResult res = Analytics.CustomEvent("levelFinish", new Dictionary<string, object>
        {
            { "levelName", levelName },
            { "wonLevel", won },
            { "levelPlaytime", levelPlaytime },
            { "moveCount", moveCount },
            { "lifeCount", lifeCount },
            { "fillPercentage", fillPercentage }
        });
        Debug.Log("OnFinishedLevel status: " + res);
    }

That should work but you’ve just introduced another variable, I would have suggested just a single change. But you’re on the right track.

Hi there Jeff, and anyone else reading this!
I’m happy to say I found the solution - booleans are all lowercase. A filter with wonLevel with value ‘true’ works for me :slight_smile:

Indeed, the filters are what I needed. Thanks for your help!

1 Like