📈️ InsightsKit

Trail's own detailed Analytics module.

What is InsightsKit?

InsightsKit is Trail's own analytics module; it offers detailed insights (no pun intended) into how players play and access your game out of the box. Just by building for Trail, you are already using InsightsKit and can gain lots of helpful information about player behavior out of the box. Nonetheless, it also offers the ability to fire custom events in case you need something specific for your game.

What does InsightsKit track automatically?

InsightsKit tracks quite a bit of information; fundamental metrics focusing on retention, conversion, monetization, error rates and performance. However, one of the most important features that InsightsKit offers is Attribution tracking. It can show you where players are coming from; a Facebook ad, a Youtube video or maybe a post on Reddit? This should help you with A/B testing your marketing strategy to see what works best for your game.

Attribution trackingAttribution tracking

Attribution tracking

Not only that but we also offer a sales funnel tracker to allow you to understand the buying behaviour of your players and thus change your monetization strategy:

That said, you can also gain insights that can inform your game design decisions such as how many players reach a certain scene in your game or how long they spend in that scene:

The same goes for performance tracking; InsightsKit offer information about performance in your game and some of the device specs they use:

The median FPS per sceneThe median FPS per scene

The median FPS per scene

🚧

Insights View

While InsightsKit is operational and you can use both the built in evens and custom ones, the dashboard where you view these events isn't currently public and is a work in progress. You can however get a snapshot if you reach out to us on Discord of the data you need.

Sending Custom Events

Despite InsightsKit tracking lots of data and has lots of metrics out of the box, we understand that every game has its own unique use case. On top of out-of-the-box tracking, we offer custom events that you can fire when you want and we'll track them for you.

// Remember to initialize the SDK first.

// A struct used to define the data to be sent if you need to send custom data with the custom event.
[System.Serializable]
public PayloadStruct
{
  public int hp;
  public int damage;
}

// Some kind of event in your game, say a player takes damage
public void TakeDamage(int damageAmount)
{
  if(currentHP - damageAmount > 0)
    currentHP -= damageAmount;
  else
    currentHP = 0;
  
  // If in case you want to send specific data with the event not just an empty event
  
  PayloadStruct payload = new PayloadStruct();
  payload.hp = currentHP;
  payload.damage = damageAmount;
  
  string payloadString = JsonUtility.ToJson(payload);
  
  // You can omit passing a payload and the default null value will be detected and we'll treat it as a default, empty event.
  Result result = SDK.InsightsKit.SendCustomEvent("playerDead", payloadString);
  
  if(result.IsError()) {
    Debug.LogErrorFormat("Failed to send custom event: {0}", result);
    }
}

🚧

InsightsKit Error Handling

Sometimes when you're calling a custom event, you may encounter errors. We provided the Result enum to help you find out what the exact error is and resolve it. The three main issues you can encounter with InsightsKit are:

Result.INKCustomEventJsonInvalid: This is when you are passing an invalid JSON as a second parameter; we recommend you double check the JSON you are sending.

Result.INKCustomEventJsonTooBig: This happens when you're passing a very big JSON; max JSON size is 1 KB

Result.INKFirstGameplayEventAlreadySent: This happens when you're sending a game start event manually (instead of Trail handling it automatically) multiple times and we've already detected the first one.

Updated 2 months ago

📈️ InsightsKit


Trail's own detailed Analytics module.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.