AdjustEvent class

The AdjustEvent class contains information about events triggered in your application. This information can be passed to the Adjust backend by passing the AdjustEvent object to the trackEvent method of the Adjust SDK.

Functions

Set up the event object

To record events, you need to set up an event object using an event token from your Adjust dashboard. Each event you want to track must have a unique token from the dashboard. This ensures the Adjust backend can differentiate the events.

AdjustEvent (String eventToken)
Java
Javascript
AdjustEvent adjustEvent = new AdjustEvent("abc123");
Adjust.trackEvent(adjustEvent);

Set a unique event ID

You can pass an optional identifier to avoid tracking duplicate events. The SDK stores the last ten identifiers. This means that it will skip over revenue events with duplicate transaction IDs.

void setOrderId (String orderId)
Java
Javascript
AdjustEvent adjustEvent = new AdjustEvent("abc123");
adjustEvent.setRevenue(0.01, "EUR");
adjustEvent.setOrderId("{OrderId}");
Adjust.trackEvent(adjustEvent);

Set a unique callback ID

You can set a custom identifier to events you want to track by using the setCallbackId method. You can then use this ID to report on success and failure events.

void setCallbackId (String callbackId)
Java
Javascript
AdjustEvent adjustEvent = new AdjustEvent("abc123");
adjustEvent.setCallbackId("Your-Custom-Id");
Adjust.trackEvent(adjustEvent);

Send callback parameters to Adjust

You can set up callback URLs in your Adjust dashboard. The Adjust SDK will then call these when a user triggers an event in your app. You can also send callback parameters by calling the addCallbackParameter method.

void addCallbackParameter (String key, String value)
Java
Javascript
AdjustEvent adjustEvent = new AdjustEvent("abc123");
adjustEvent.addCallbackParameter("key", "value");
adjustEvent.addCallbackParameter("foo", "bar");
Adjust.trackEvent(adjustEvent);

Send callback parameters to network partners

You can send parameters back to network partners when a user triggers an event in your app. To do this, call the addPartnerParameter method.

void addPartnerParameter (String key, String value)
Java
Javascript
AdjustEvent adjustEvent = new AdjustEvent("abc123");
adjustEvent.addPartnerParameter("key", "value");
adjustEvent.addPartnerParameter("foo", "bar");
Adjust.trackEvent(adjustEvent);