I’m not an experienced programmer, just an artist trying to make my second game bit more professionally, I was using Unity analytics but my publisher wants me to use Facebook analytics and I couldn’t figure this one thing for last 2 good weeks… some one help me please
My Objective: Make a “Breakdown” in Facebook analytics with level numbers, i.e. I want to know how many people played a specific level. I found out how to display the “Count”, “Count percent” etc. But what I did not find is, how to display the “LevelNumber”/“LevelName” like the image(Unity.png) attached. In the image we can see there are level numbers(marked in red) listed vertically.
I tried writing this code to do so:
My Code 1:
public void LogCompletedEvent(string levelName, double levelNumber)
{
var parameters = new Dictionary<string, object>();
parameters[“LevelName”] = levelName;
FB.LogAppEvent(“LevelCompleted”, (float)levelNumber, parameters);
}
Result: I don’t see level numbers in the “Breakdowns” dashboard (Activity>Breakdowns), instead I see one word which is “All Others”. I’m passing a string for “Level numbers” as levelName.
second thing I tried was to use a standard Event for Casual games, it can be found here on this page and it’s called “AchievedLevel”: Gaming (Casual) - Meta App Events - Documentation - Meta for Developers
My Code 2:
public void LogAchievedLevelEvent(string level)
{
var parameters = new Dictionary<string, object>();
parameters[AppEventParameterName.Level] = level;
FB.LogAppEvent(AppEventName.AchievedLevel, parameters);
}
As I said earlier, above code is a standard event provided by Facebook, but whenever I directly copy and paste it, it throws an error (cannot convert from ‘System.Collections.Generic.Dictionary<string, object>’ to ‘float?’), no idea why Facebook is giving me a code that throws error like this.
Any help will be greatly appreciated and thank you very much in advance