Unreal Engine SDK: Tracking Events and Revenue

 

Tracking Events (Non Revenue)

Singular can collect data about in-app events in order to help analyze the performance of your campaigns and measure KPIs.

For example, your organization may want to collect data about user logins, registrations, tutorial completions, or leveling up in a gaming app.

You can send events to Singular from your app using the SendEvent and SendEventWithArgs method.

Note: We highly recommend passing event names and attributes in English to guarantee compatibility with third-party partners and analytics solutions if you plan to use them.

SingularSDK SendEvent Method
Description Send a user event to Singular for tracking, with a custom event name.
Signature
public static void SendEvent(FString eventName)

Usage Example

// Send an event without any parameters, just a name
  USingularSDKBPLibrary::SendEvent("Login");
SingularSDK SendEventWithArgs Method
Description Send a user event to Singular for tracking, with a custom event name and additional custom parameters.
Signature
public static void SendEventWithArgs(FString eventName, 
TMap<FString, FString> args)

Usage Example

TMap<FString, FString> args;
args.Add(TEXT("Key"), TEXT("Value"));
USingularSDKBPLibrary::SendEventWithArgs("Login", args);

Tracking Revenue

Singular can collect data about revenue gained through the app in order to help analyze the performance and ROI of your campaigns. Singular will make the data available to you in reports, log export, and postbacks.

Notes: Any revenue reported in a different currency will be auto-converted to your organization's preferred currency as set in your Singular account.

Use SendRevenue to pass information about a purchase to Singular, including a custom event name, the transaction currency, and the transaction amount. SendRevenueWithArgs is very similar but allows you to add additional custom parameters.

SingularSDK SendRevenue Method
Description Send a revenue event to Singular.
Signature
public static void SendRevenue(FString eventName,
FString currency, float amount)
Note: Pass currency as a three-letter ISO 4217 currency code, such as "USD", "EUR", "INR".
Usage Example
USingularSDKBPLibrary::SendRevenue("Purchase Completed", "USD", 9.99);
SingularSDK SendRevenueWithArgs Method
Description Send a revenue event to Singular with additional custom parameters.
Signature
public static void SendRevenueWithArgs(FString eventName, 
FString currency, float amount, TMap<FString, FString> args)
Note: Pass currency as a three-letter ISO 4217 currency code, such as "USD", "EUR", "INR".
Usage Example
// Send a revenue event with product details
  TMap<FString, FString> args;
args.Add(TEXT("Key"), TEXT("Value"));
USingularSDKBPLibrary::SendRevenueWithArgs("Purchase Completed",
"USD", 9.99, args);

Hybrid Event Tracking (Advanced)

Singular recommends sending all events and revenue through the Singular SDK integrated into your app. However, Singular can collect events and revenue from other sources.

Any event NOT sent from the Singular SDK must comply with Singular's Server-to-Server Event documentation requirements and provide the matching device identifier to correctly attribute an event.

Important:

Discrepancies will occur if device identifiers used on Server-to-Server event requests do not have a matching device identifier in Singular. Be aware of the following possibilities:

  • If an event request is received "before" the Singular SDK has recorded the device identifier, from an App Session, then the event request will be considered the "first session" for the unknown device, and Singular will attribute the device as an organic attribution.
  • If the Singular SDK did record a device identifier, but the Singular SDK identifier differs from the device identifier specified in the Server-to-Server Event request then the event will be attributed incorrectly.

Hybrid Event Tracking Guides

Sending Events from an Internal Server

Singular can collect data about revenue from your Server to help analyze the performance and ROI of your campaigns.

Requirements:

  • From an in-app Registration or Login Event, capture and pass the device identifiers and store this data with the User ID on your server. Because device identifiers may change for a user, be sure to update the identifiers when a user generates an app session. This guarantees the server-side event will be attributed to the correct device.
  • Server-side events are platform specific and should only be sent with the device identifier matching the device platform (e.g., IDFA or IDFV for iOS devices).
  • You can use the Singular Internal BI postback mechanism to push an event in real time to your internal endpoint so that you can update the data set on the server side. See the Internal BI Postback FAQ.
  • Review the "Tracking Revenue" section in the Server-to-Server Integration guide for details.
Sending Events from a Revenue Provider
Third-party providers like RevenueCat or adapty can provide Purchase and Subscription Revenue to Singular.

Follow the links below for details on how to enable these partners.

Sending Events from Segment

To enable Segment to send events to Singular, in parallel with the Singular SDK, you must add a "Cloud-Mode" Destination in Segment. Follow our guide HERE.