Documentation

Log Events

Events provide insight on what is happening in your app. You can use MIKROS LogEvent() function to track user experience and player behavior across various major areas:

  • Application: Track the usage of basic elements in your application user interface.
  • Progression: Track player progress through your application or game.
  • Onboarding: Track the earliest interactions players have with your application or game.
  • Engagement: Track important actions related to social sharing, achievements and milestones.
  • Monetization: Track revenue-related events as well as your in-game economies.

In addition to the events that you track, MIKROS automatically logs some events for you. You don’t need to add any code to receive them. If your app needs to collect additional data or has specific needs, we also allow you to log hundreds of different Analytics Event types in your app. Note that event names are case-sensitive and that logging two events whose names differ only in case will result in two distinct events.

Before You Begin

Make sure that you’ve set up your project and have your appGameId and apiKeys issued as described in Getting Started With Mikros Unity SDK.

Mikros Analytics

Once you have initialized the SDK, you can immediately start logging events for analytics. Make sure you have the following namespaces defined at the top of your scripts:

using MikrosApiClient;
using MikrosApiClient.MikrosAnalytics;

Track Custom Events

Events can be tracked by the following ways:

  1. Log events without any parameters.

    // log events
    AnalyticsController.LogEvent("custom_event_name", (Hashtable customEventWholeData) =>
    {
       // handle success
    },
    onFailure =>
    {
       // handle failure
    });

  2. Log events with only one parameter of String datatype.

    // log events
    AnalyticsController.LogEvent("custom_event_name", "parameter", "parameter_value", (Hashtable customEventWholeData) =>
    {
       // handle success
    },
    onFailure =>
    {
       // handle failure
    });

  3. Log events with only one parameter of Double datatype.

    // log events
    AnalyticsController.LogEvent("custom_event_name", "parameter", 1.5, (Hashtable customEventWholeData) =>
    {
       // handle success
    },
    onFailure =>
    {
       // handle failure
    });

  4. Log events with only one parameter of Long datatype.

    // log events
    AnalyticsController.LogEvent("custom_event_name", "parameter", 1, (Hashtable customEventWholeData) =>
    {
       // handle success
    },
    onFailure =>
    {
       // handle failure
    });

  5. Log events with multiple parameters of any datatype.

    // create Hashtable
    Hashtable parameterData = new Hashtable();
    parameterData.Add("parameter1", "parameter_value");
    parameterData.Add("parameter2", 1.5);
    parameterData.Add("parameter3", 1);
    parameterData.Add("parameter4", true);

    // log events
    AnalyticsController.LogEvent("custom_event_name", parameterData, (Hashtable customEventWholeData) =>
    {
       // handle success
    },
    onFailure =>
    {
       // handle failure
    });


All custom events are uploaded automatically to backend at a feasible time whenever the phone is idle. However, these events can also be uploaded any time in the following way:

AnalyticsController.FlushEvents();

View Events on the Dashboard

Now that you have logged your events, you can view aggregated statistics about your events in the MIKROS console dashboards. These dashboards update periodically throughout the day and are available for viewing in relatively real time.