adjust-icon

Send event information

You can configure the SDK to send event information to Adjust's servers when your users take specific actions. Adjust records these events and displays them in your Datascape reports, server callbacks, and cloud storage uploads.

To learn how to configure events in Adjust, visit the Add events guide.

Send an event

The Adjust SDK provides an AdjustEvent object which you can use to structure and send event information from your app to Adjust’s servers.

Reference

To send event information with the Adjust SDK, you need to instantiate an AdjustEvent object. This object contains variables that are sent to Adjust when an event occurs in your app.

  1. Create an event token in the Adjust dashboard, and copy it.
  2. Create a new AdjustEvent instance in your button’s click handler method.
  3. Pass the following parameters:
eventToken: String

Your Adjust event token.

import com.adjust.sdk.AdjustEvent;
private static function TrackEventClick(Event:MouseEvent):void {
trace ("Track simple event button tapped!");
var adjustEvent:AdjustEvent = new AdjustEvent("abc123");
Adjust.trackEvent(adjustEvent);
}

Record event revenue

You can record revenue associated with an event by setting the revenue and currency properties on your event instance. Use this feature to record revenue-generating actions in your app.

Reference

To set these properties, call the setRevenue method and pass the following arguments:

revenue: Number

The amount of revenue generated by the event.

currency: String

TheISO 4217 codeof the event currency.

import com.adjust.sdk.AdjustEvent;
private static function TrackRevenueClick(Event:MouseEvent):void {
trace ("Track revenue event button tapped!");
var adjustEvent:AdjustEvent = new AdjustEvent("abc123");
adjustEvent.setRevenue(0.01, "EUR");
Adjust.trackEvent(adjustEvent);
}

When you set a currency token, Adjust automatically converts the incoming revenue into the reporting revenue of your choice. Read more about currency conversion and the list of supported currencies.

Deduplicate revenue events

You can pass an optional identifier to avoid recording duplicate events. By default, the SDK stores the last 10 identifiers and skips revenue events with duplicate IDs.

IS THIS CORRECT? If you would like the SDK to store more than 10 identifiers, set the desired number of identifiers by assigning the value to eventDeduplicationIdsMaxSize of the AdjustConfig instance.

Reference

To set the identifier, assign your deduplcation ID to the deduplicationId property of your event instance.

The setDeduplicationId method requires the following argument:

id: String

The revenue event identifier.

adjustConfig.eventDeduplicationIdsMaxSize = 20;
Adjust.initSdk(adjustConfig);
// ...
var adjustEvent:AdjustEvent = new AdjustEvent("abc123");
adjustEvent.setDeduplicationId("deduplicationId");
Adjust.trackEvent(adjustEvent);

Callback identifier

You can add a custom string identifier to each event you want to monitor. Access this identifier in your event callbacks to keep track of which event was successfully recorded.

Reference

To set this identifier, call the setCallbackId method on your AdjustEvent instance.

The setCallbackId method requires the following argument:

id: String

The custom string identifier.

var adjustEvent:AdjustEvent = new AdjustEvent("abc123");
adjustEvent.setCallbackId("Your-Custom-Id");
Adjust.trackEvent(adjustEvent);