Track Events

Tracking events allow us to report how each variation is performing. For example, if you are logging transactions, our web app will show you which variation is producing the most transactions. Using our Unity package, you can log ad activity, transactions, and custom events.

Initializing Elecular

Before we start logging events, we must first initialize Elecular by calling the initialize method in a Start or Awake function.

using Elecular.API;
using UnityEngine;

public class GameManager : MonoBehaviour
{
    void Start()
    {
        ElecularApi.Instance.InitializeWithTracking();
    }
}

Please check the Opt-out section for opting players out of tracking.

Logging Events

An ad impression must be logged whenever an ad is displayed to a user. An ad click must be logged whenever a user clicks an ad.

//Import Statement
using Elecular.API;

//Logging Ad Impression
ElecularApi.Instance.LogAdImpression("ad-placement-id");

//Logging Ad Click
ElecularApi.Instance.LogAdClick("ad-placement-id");

Field

Type

Description

Example

Placement Id

string

Placement id of the ad

reward-video

It can take up to 3 hours for your logged events to show up on our web app. This is because the player might trigger an event 3 hours after she has started a session, and to attribute all these events to the session, we need to wait for at least 3 hours.

Debug Window

To verify if you are logging events as expected, you can drag the Debug Window prefab into the scene. This prefab is under Elecular/Debug Window. This Debug Window shows all the events that are emitted from Elecular.

Last updated

Was this helpful?