Adjust
This guide describes how to add and configure Adjust integration.
Adjust is the industry leader in mobile measurement and fraud prevention.

How does Integration Work?

This integration works in two ways.

1. Receive Attribution Data from Adjust

Once you successfully configured Adjust integration, Apphud will receive attribution data from it. You can view this data on user's page:

2. Send Subscription Events to Adjust

Apphud can also send all subscription events to Adjust. So you could view these events in Adjust dashboard and Adjust could pass this data to their partners. This will help to measure efficiency of your ad campaigns.

How to Add Integration?

Step 1
2
3
4
5
6
7
8
✅ 9
Open Adjust and sign in.
Copy App token. Select your app and click here:
Copy App token:
Create desired subscription events in Adjust, for example, "trial_started", "trial_converted", "subscription_renewed" etc. You can view the list of all available events here. You can create event tokens only for events that you need, there is no need to add all events.
In Adjust open app's "All Settings", go to "Events" section and create necessary events. For each event, Adjust will generate unique Event token.
As a result, you will have something like this:
At Apphud go to "Integrations" section and add Adjust:
Paste Adjust App Token into "App token" field:
Paste Adjust Event tokens from step 4 into corresponding fields and turn on switches. Enable events that you need:
Enable integration:
Save changes:

Pass Attribution Data to Apphud (required)

Send attribution data to Apphud (or at least Adjust ID):
Swift
Objective-C
Kotlin
1
adjustConfig?.delegate = self
2
...
3
4
func adjustAttributionChanged(_ attribution: ADJAttribution?) {
5
if let data = attribution?.dictionary() {
6
Apphud.addAttribution(data: data, from: .adjust) { (result) in }
7
} else if let adid = Adjust.adid() {
8
Apphud.addAttribution(data: ["adid" : adid], from: .adjust) { (result) in }
9
}
10
}
11
12
func adjustSessionTrackingSucceeded(_ sessionSuccessResponseData: ADJSessionSuccess?) {
13
if let data = Adjust.attribution()?.dictionary() {
14
Apphud.addAttribution(data: data, from: .adjust) { (result) in }
15
} else if let adid = Adjust.adid() {
16
Apphud.addAttribution(data: ["adid" : adid], from: .adjust) { (result) in }
17
}
18
}
Copied!
1
// set delegate to ADJConfig
2
config.delegate = self;
3
...
4
5
- (void)adjustAttributionChanged:(ADJAttribution *)attribution {
6
[self sendAdjustAttribution:attribution];
7
}
8
9
- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData {
10
[self sendAdjustAttribution:Adjust.attribution];
11
}
12
13
- (void)sendAdjustAttribution:(ADJAttribution*)attribution {
14
if (attribution != nil && attribution.adid != nil) {
15
[Apphud addAttributionWithData:attribution.dictionary from:ApphudAttributionProviderAdjust identifer:nil callback:^(BOOL result) {
16
}];
17
} else if (Adjust.adid != nil) {
18
[Apphud addAttributionWithData:@{@"adid" : Adjust.adid} from:ApphudAttributionProviderAdjust identifer:nil callback:^(BOOL result) {
19
}];
20
}
21
}
Copied!
1
fun setupAdjust() {
2
val listener = object : OnAttributionChangedListener {
3
override fun onAttributionChanged(attribution: AdjustAttribution) {
4
Apphud.addAttribution(ApphudAttributionProvider.adjust, attribution.convertToMap(), attribution.adid)
5
}
6
}
7
val sessionListener = object : OnSessionTrackingSucceededListener {
8
override fun onFinishedSessionTrackingSucceeded(sessionSuccessResponseData: AdjustSessionSuccess) {
9
Apphud.addAttribution(ApphudAttributionProvider.adjust, null, sessionSuccessResponseData.adid)
10
}
11
}
12
val env = AdjustConfig.ENVIRONMENT_PRODUCTION
13
val config = AdjustConfig(this, "YOUR_ADJUST_TOKEN", env)
14
config.setOnAttributionChangedListener(listener)
15
config.setOnSessionTrackingSucceededListener(sessionListener)
16
Adjust.onCreate(config)
17
}
18
19
fun AdjustAttribution.convertToMap() = mapOf<String, Any>(
20
"trackerToken" to trackerToken,
21
"trackerName" to trackerName,
22
"network" to network,
23
"campaign" to campaign,
24
"adgroup" to adgroup,
25
"creative" to creative,
26
"clickLabel" to clickLabel,
27
"adid" to adid
28
)
Copied!
While configuring integration you can also choose between sending revenue as sales or proceeds (without Apple/Google 15%-30% commission).
You can read more how Apple calculates commission here.
In order to receive Adjust attribution data from Facebook, you should accept Facebook’s "Advanced Mobile Measurement Agreement" using this link.

Request IDFA Consent (required)

Starting iOS 14.5 access to IDFA requires user consent. You should request IDFA manually using AppTrackingTransparency framework and pass it to Apphud. Read more here.

Testing Adjust Integration (iOS)

To test Adjust integration from scratch you should do the following:
    Reset IDFA (Settings > Privacy > Advertising > Reset Advertising Identifier).
    Uninstall the app.
    Make sure you initialized Adjust SDK with ADJEnvironmentSandbox environment. Don't forget to change back to ADJEnvironmentProduction before release!
    Make sure adjustAttributionChanged(_ attribution: ADJAttribution?) delegate method is called.
    If Adjust Attribution Data block exists in your user's page in Apphud, then integration is successful.
    When viewing events in Adjust Dashboard, make sure you enabled Sandbox Mode in filter pane.

Events Cheat Sheet

This is a list of all possible events and their parameters that can be sent to AppsFlyer.
You can read more about subscription events here and parameters here.
Trial
Cancellations
Introductory Offer
Regular
Promo Offer
Other Events

Trial period started parameters

    partner_params.product_id: String

Successful conversion from trial period to regular subscription parameters

    partner_params.product_id: String
    revenue: Float
    currency: String

Failed conversion from trial period to regular subscription parameters

    partner_params.product_id: String
    partner_params.reason: String

Trial Canceled parameters

    partner_params.product_id: String

Subscription Canceled parameters

    partner_params.product_id: String

Autorenew disabled parameters (Deprecated)

    partner_params.product_id: String

Autorenew enabled parameters

    partner_params.product_id: String

Introductory offer started parameters

    partner_params.product_id: String
    partner_params.offer_type: String
    revenue: Float
    currency: String

Introductory offer renewed parameters

    partner_params.product_id: String
    partner_params.offer_type: String
    revenue: Float
    currency: String

Successful conversion from introductory offer to regular subscription parameters

    partner_params.product_id: String
    partner_params.offer_type: String
    revenue: Float
    currency: String

Failed conversion from introductory offer to regular subscription or failed renew parameters

    partner_params.product_id: String
    partner_params.reason: String
    partner_params.offer_type: String

Refund during introductory offer parameters

    partner_params.product_id: String
    partner_params.offer_type: String
    partner_params.reason: String

Subscription started parameters

    partner_params.product_id: String
    revenue: Float
    currency: String

Subscription renewed parameters

    partner_params.product_id: String
    revenue: Float
    currency: String

Subscription expired parameters

    partner_params.product_id: String
    partner_params.reason: String

Subscription refunded parameters

    partner_params.product_id: String
    partner_params.reason: String

Promotional offer started parameters

    partner_params.product_id: String
    partner_params.offer_id: String
    partner_params.offer_type: String
    revenue: Float
    currency: String

Promotional offer renewed parameters

    partner_params.product_id: String
    partner_params.offer_id: String
    partner_params.offer_type: String
    revenue: Float
    currency: String

Successful conversion from promotional offer to regular subscription parameters

    partner_params.product_id: String
    partner_params.offer_id: String
    partner_params.offer_type: String
    revenue: Float
    currency: String

Failed conversion from promotional offer to regular subscription or failed renew parameters

    partner_params.product_id: String
    partner_params.offer_id: String
    partner_params.offer_type: String
    partner_params.reason: String

Refund during promotional offer parameters

    partner_params.product_id: String
    partner_params.offer_id: String
    partner_params.offer_type: String
    partner_params.reason: String

Non renewing purchase parameters

    partner_params.product_id: String
    revenue: Float
    currency: String

Non renewing purchase refunded parameters

    partner_params.product_id: String
    partner_params.reason: String

Billing issue parameters

    partner_params.product_id: String

Billing issue resolved parameters

    partner_params.product_id: String
Please note: we don't send revenue properties with refund events. That's because Adjust API currently doesn't support sending revenue with a negative value.
For each event Apphud includes environmentparameter depending on environment of the subscription.
Last modified 7mo ago