ADJEvent class

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

Methods

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.

+ (nullable ADJEvent *) eventWithEventToken: (nonnull NSString *) eventToken	
Objective-C
Swift
ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"];

Parameters

Set a unique callback ID

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

- (void) setCallbackId: (nonnull NSString *) callbackId	
Objective-C
Swift
[event setCallbackId:@"Your-Custom-Id"];

Parameters

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: (nonnull NSString *) key
                        value: (nonnull NSString *) value 
Objective-C
Swift
[event addCallbackParameter:@"foo" value:@"bar"];

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: (nonnull NSString *) key
                       value: (nonnull NSString *) value 
Objective-C
Swift
[event addPartnerParameter:@"foo" value:@"bar"];

Pass revenue details back to Adjust

You can pass revenue details to the Adjust backend with financial events. To do this, you can invoke the setRevenue method and pass it the currency and amount of the transaction.

- (void) setRevenue: (double) amount
           currency: (nonnull NSString *) currency 
Objective-C
Swift
[event setRevenue:1.5 currency:@"EUR"];

Parameters