Skip to main content
Version: SDK 5.0.x

AppEvent API

When you build a AppEvent, you can either:

  • Provide values to the constructor.
  • Initialize an empty event and later call setters for other properties.

AppEvent constructors

AppEvent has the following constructors:

public class AppEvent {
public AppEvent(string pName)
public AppEvent(string pName, double pValue, Unit pUnit)
public AppEvent(string pName, Money pMoney)
}

The only requirement for a new event is a name (pName). Once you've assigned an event name, it can later no longer be changed.

The value and unit can only be provided together and default to 0.0 and no unit if not provided. Alternatively, an event can carry a monetary value instead of a value with a unit.

AppEvent setters

You can also set properties and dimensions after initialization, using the following methods:

public AppEvent AddDimension(string pDimension, string pValue)
public AppEvent AddDimension(Dimension pDimension, string pValue)
public AppEvent RemoveDimension(string pDimension)
public AppEvent RemoveDimension(Dimension pDimension)
public AppEvent SetValue(double pValue, Unit pUnit)
public AppEvent SetValue(Money pMoney)

// convenience wrappers for .set()
public AppEvent SetCount(double pCount)
public AppEvent SetSeconds(double pSeconds)
public AppEvent SetMilliseconds(double pMilliseconds)

Publishing method

To send your event to the justtrack backend, use the following method:

namespace JustTrack {
public class JustTrackSDK {
public static void PublishEvent(AppEvent pEvent);
}
}

AppEvent restrictions

When you create a custom event, you must adhere to the following requirements:

  • The event name:
    • can't be empty.
    • Must be shorter than 256 characters.
    • Is case-sensitive.
    • Can only consist of printable ISO 8859-1 characters (U+0020 to U+007E as well as U+00A0 to U+00FF).
  • Dimension names:
    • Must be shorter than 256 characters.
    • May only consist of:
      • lowercase letters in the Latin alphabet (U+0061 to U+007A)
      • underscores (U+005F)
      • numbers (U+0030 to U+0039)
  • Dimension values:
    • Must be shorter than 4096 characters
    • Can only consist of printable ISO 8859-1 characters (U+0020 to U+007E as well as U+00A0 to U+00FF).
  • The event can have a maximum of 10 total dimensions.
  • The value of an app event must be finite (i.e., not NaN or ±Infinity).
  • If you provide a monetary value, the currency needs to be a 3 letter uppercase ISO 4217 string.
danger

If your event doesn't match the following criteria, it won't be recorded in the justtrack platform.