I
I
i__egor2020-09-07 20:34:13
Unity
i__egor, 2020-09-07 20:34:13

How to implement firebase for analytics in unity?

Unity plugin installed, google play console connected with firebase and firebase with google play console. I found that for initialization you need to write something like this:

void Start()
        {
            FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
            {
                var app = FirebaseApp.DefaultInstance;
            });
        }


Then I can register events anywhere, just write FirebaseAnalytics.LogEvent(...) and it will automatically go, for example:
FirebaseAnalytics.LogEvent("level_begin",
              new Parameter(FirebaseAnalytics.ParameterValue, type_game.ToString()),
              new Parameter(FirebaseAnalytics.ParameterValue, difficult.ToString()),
              new Parameter(FirebaseAnalytics.ParameterLevelName, name)
            );

As I understand it, you can send several parameters in order to filter it in detail later.
Maybe some simple examples?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question