Unity

Setup

  1. Download the tracker from: https://github.com/cooladata/cooladata-unity

  2. Add the Unity package to your project.

  3. Open the unity package with the unity IDE, or add the package as an asset to your project.

  4. Add the following import to classes that use the Journey Analytics tracker:
    using com.cooladata.tracking.sdk.unity;
  5. Create and initialize the Journey Analytics tracker instance:
    CoolaDataTracker.getInstance().setup(String appKey, String serviceEndPoint, String userId)

Tracking Events

After the Journey Analytics Tracker SDK is properly set up, you are ready to report events from your application. To start doing so, you need to call the trackEvent function with suitable parameters on every user's action that you would like to track.

  • Prepare the parameters
    Dictionary<string,string> myMap = new Dictionary<string, string>();
    myMap.Add("unity param 1", "value1");
  • Add the event to the queue
    CoolaDataTracker.getInstance().trackEvent("eventName", myMap);

Other event tracking examples:

CoolaDataTracker.getInstance().trackEvent(eventName, eventProperties);
CoolaDataTracker.getInstance().trackEvent(eventName, userId, eventProperties);
CoolaDataTracker.getInstance().trackEvent(eventName, eventProperties, eventId, callback);
CoolaDataTracker.getInstance().trackEvent(eventName, userId, eventProperties, eventId, callback);

Parameters Descriptions:

ParameterMandatoryDescription
eventNameYesThe name of the event to report.
userIdNoThe User ID relevant for this instance of the CoolaDataTracker. Can be provided either in the setup or the trackEvent method. If no userId is provided one will be generated automatically.
eventPropertiesNo