Skip to content

Commit 699ca2c

Browse files
committed
Merge remote-tracking branch 'origin/ADP-5029' into develop
# Conflicts: # versioned_docs/version-3.0/attribution-integration.md # versioned_docs/version-3.0/ios-present-onboardings.md
2 parents 42fbd95 + 2e9c42c commit 699ca2c

27 files changed

Lines changed: 1442 additions & 1032 deletions

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"search.exclude": {
3+
"**/version-2.0/*": true
4+
}
5+
}

versioned_docs/version-3.0/adjust.md

Lines changed: 143 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ metadataTitle: "Adjust Integration for Subscription Analytics | Adapty Docs"
88
import Zoom from 'react-medium-image-zoom';
99
import 'react-medium-image-zoom/dist/styles.css';
1010
import Tabs from '@theme/Tabs';
11-
import TabItem from '@theme/TabItem';
11+
import TabItem from '@theme/TabItem';
1212

13-
[Adjust](https://www.adjust.com/) is one of the leading Mobile Measurement Partner (MMP) platforms that collects and presents data from marketing campaigns. This helps companies track their campaign performance.
13+
[Adjust](https://www.adjust.com/) is one of the leading Mobile Measurement Partner (MMP) platforms that collects and presents data from marketing campaigns. This helps companies track their campaign performance.
1414

1515
Adapty provides a complete set of data that lets you track [subscription events](events) from stores in one place. With Adapty, you can easily see how your subscribers are behaving, learn what they like, and use that information to communicate with them in a way that's targeted and effective. Therefore, this integration allows you to track subscription events in Adjust and analyze precisely how much revenue your campaigns generate.
1616

@@ -19,60 +19,58 @@ The integration between Adapty and Adjust works in two main ways.
1919
1. **Adapty receives attribution data from Adjust**
2020
Once you've set up the Adjust integration, Adapty will start receiving attribution data from Adjust. You can easily access and view this data on the user's profile page.
2121

22-
<Zoom>
23-
<img src={require('./img/98769d9-CleanShot_2023-08-11_at_14.39.182x.webp').default}
24-
style={{
25-
border: '1px solid #727272', /* border width and color */
26-
width: '700px', /* image width */
27-
display: 'block', /* for alignment */
28-
margin: '0 auto' /* center alignment */
29-
}}
30-
/>
31-
</Zoom>
32-
22+
<Zoom>
23+
<img src={require('./img/98769d9-CleanShot_2023-08-11_at_14.39.182x.webp').default}
24+
style={{
25+
border: '1px solid #727272', /* border width and color */
26+
width: '700px', /* image width */
27+
display: 'block', /* for alignment */
28+
margin: '0 auto' /* center alignment */
29+
}}
30+
/>
31+
</Zoom>
3332

3433
2. **Adapty sends subscription events to Adjust**
3534
Adapty can send all subscription events which are configured in your integration to Adjust. As a result, you'll be able to track these events within the Adjust dashboard. This integration is beneficial for evaluating the effectiveness of your advertising campaigns.
3635

37-
## How to set up Adjust integration
38-
39-
To set up the integration with Adjust go to [Integrations > Adjust](https://app.adapty.io/integrations/adjust) in the Adapty Dashboard, turn on a toggle from off to on, and fill out fields.
36+
## Initial Setup
4037

41-
The next step of the integration is to set credentials.
42-
43-
<Zoom>
44-
<img src={require('./img/5064125-CleanShot_2023-08-11_at_14.43.382x.webp').default}
45-
style={{
46-
border: '1px solid #727272', /* border width and color */
47-
width: '700px', /* image width */
48-
display: 'block', /* for alignment */
49-
margin: '0 auto' /* center alignment */
50-
}}
51-
/>
52-
</Zoom>
38+
1. Open the Adapty Dashboard, and navigate to [Integrations > Adjust](https://app.adapty.io/integrations/adjust).
5339

40+
2. Set the toggle on top of the page to "on".
5441

42+
3. Fill out the fields, and set your access credentials.
5543

56-
1. If you have enabled OAuth authorization on the Adjust platform, it is mandatory to provide an **OAuth Token** during the integration process for your iOS and Android apps.
57-
2. Next, you need to provide the **app tokens** for your iOS and Android apps. Open your Adjust dashboard and you'll see your apps.
44+
<Zoom>
45+
<img src={require('./img/5064125-CleanShot_2023-08-11_at_14.43.382x.webp').default}
46+
style={{
47+
border: '1px solid #727272', /* border width and color */
48+
width: '700px', /* image width */
49+
display: 'block', /* for alignment */
50+
margin: '0 auto' /* center alignment */
51+
}}
52+
/>
53+
</Zoom>
5854

59-
<Zoom>
60-
<img src={require('./img/adjust-apps.webp').default}
61-
style={{
62-
border: '1px solid #727272', /* border width and color */
63-
width: '700px', /* image width */
64-
display: 'block', /* for alignment */
65-
margin: '0 auto' /* center alignment */
66-
}}
67-
/>
68-
</Zoom>
55+
3. If you enabled OAuth authorization on the Adjust platform, it is mandatory to provide an **OAuth Token** during the integration process for your iOS and Android apps.
56+
4. Next, provide the **app tokens** for your iOS and Android apps. Open your Adjust dashboard and you'll see your apps.
6957

58+
<Zoom>
59+
<img src={require('./img/adjust-apps.webp').default}
60+
style={{
61+
border: '1px solid #727272', /* border width and color */
62+
width: '700px', /* image width */
63+
display: 'block', /* for alignment */
64+
margin: '0 auto' /* center alignment */
65+
}}
66+
/>
67+
</Zoom>
7068

71-
:::note
72-
You may have different Adjust applications for iOS and Android, so in Adapty you have two independent sections for that. If you have only one Adjust app, just fill in the same information.
73-
:::
69+
:::note
70+
You may have different Adjust applications for iOS and Android, so in Adapty you have two independent sections for that. If you have only one Adjust app, just fill in the same information.
71+
:::
7472

75-
3. Select your app from the list and copy **App Token**. Then, paste it to Adapty.
73+
5. Select your app from the list and copy the **App Token**. Paste the token into the corresponding field on the Adapty dashboard.
7674

7775
<Zoom>
7876
<img src={require('./img/adjust-token.webp').default}
@@ -104,7 +102,7 @@ So the first step here is to find event tokens for all events that you want Adap
104102
/>
105103
</Zoom>
106104

107-
2. Copy the event token and paste it to Adapty. Below the credentials, there are three groups of events you can send to Adjust from Adapty. Check the full list of the events offered by Adapty [here](events).
105+
1. Copy the event token and paste it to Adapty. Below the credentials, there are three groups of events you can send to Adjust from Adapty. Check the full list of the events offered by Adapty [here](events).
108106

109107
<Zoom>
110108
<img src={require('./img/adjust-event-token.webp').default}
@@ -117,21 +115,22 @@ So the first step here is to find event tokens for all events that you want Adap
117115
/>
118116
</Zoom>
119117

120-
121118
Adapty will send subscription events to Adjust using a server-to-server integration, allowing you to view all subscription events in your Adjust dashboard and link them to your acquisition campaigns.
122119

123120
:::important
124121
Consider the following:
122+
125123
- Adjust doesn't support events older than 58 days. So, if you have an event that is more than 58 days old, Adapty will send it to Adjust, but the event datetime will be replaced by the current timestamp.
126124
- Adjust doesn’t support IPv6. If you disable IP collection in the SDK in **App settings** or on the SDK activation, only a backend IPv6 may be sent, and tracking can fail — keep SDK IP collection enabled to ensure IPv4 is used.
125+
127126
:::
128127

129-
## SDK configuration
128+
## Attribution Integration
130129

131-
To set up the Adjust integration, you need to implement two parts:
130+
After you complete the steps described above, add the following two methods to your app. They will establish communication between your app and Adjust:
132131

133-
1. **To send subscription data to Adjust**: Pass the Adjust device ID using the `setIntegrationIdentifier()` SDK method
134-
2. **To receive attribution data from Adjust**: Update attribution data using the `updateAttribution()` SDK method
132+
1. **To send subscription data to Adjust**: Pass the Adjust device ID to the `setIntegrationIdentifier()` SDK method
133+
2. **To receive attribution data from Adjust**: Update attribution data with the `updateAttribution()` SDK method
135134

136135
For Adjust version 5.0 or later, use the following example:
137136

@@ -204,6 +203,31 @@ Adjust.getAttribution(attribution -> {
204203
});
205204
```
206205

206+
</TabItem>
207+
<TabItem value="rn" label="React Native (TS)" default>
208+
209+
```typescript showLineNumbers
210+
import { Adjust, AdjustConfig } from "react-native-adjust";
211+
import { adapty } from "react-native-adapty";
212+
213+
var adjustConfig = new AdjustConfig(appToken, environment);
214+
215+
// Before submiting Adjust config...
216+
adjustConfig.setAttributionCallbackListener(attribution => {
217+
// Make sure Adapty SDK is activated at this point
218+
// You may want to lock this thread awaiting of `activate`
219+
adapty.updateAttribution(attribution, "adjust");
220+
});
221+
222+
// ...
223+
Adjust.create(adjustConfig);
224+
225+
Adjust.getAdid((adid) => {
226+
if (adid)
227+
adapty.setIntegrationIdentifier("adjust_device_id", adid);
228+
});
229+
```
230+
207231
</TabItem>
208232

209233
<TabItem value="flutter" label="Flutter" default>
@@ -248,32 +272,78 @@ try {
248272
```
249273

250274
</TabItem>
251-
<TabItem value="rn" label="React Native (TS)" default>
252-
253-
```typescript showLineNumbers
254-
import { Adjust, AdjustConfig } from "react-native-adjust";
255-
import { adapty } from "react-native-adapty";
256-
257-
var adjustConfig = new AdjustConfig(appToken, environment);
258-
259-
// Before submiting Adjust config...
260-
adjustConfig.setAttributionCallbackListener(attribution => {
261-
// Make sure Adapty SDK is activated at this point
262-
// You may want to lock this thread awaiting of `activate`
263-
adapty.updateAttribution(attribution, "adjust");
264-
});
265-
266-
// ...
267-
Adjust.create(adjustConfig);
275+
</Tabs>
268276

269-
Adjust.getAdid((adid) => {
270-
if (adid)
271-
adapty.setIntegrationIdentifier("adjust_device_id", adid);
272-
});
277+
## Event structure
278+
279+
Adapty sends selected events to Adjust as configured in the **Events names** section on the [**Adjust Integration page**](https://app.adapty.io/integrations/adjust). Each event is structured like this:
280+
281+
```json
282+
{
283+
"event_token": "EVENT_TOKEN_FROM_CONFIG",
284+
"app_token": "APP_TOKEN_FROM_CONFIG",
285+
"s2s": 1,
286+
"environment": "production",
287+
"created_at_unix": 1709294400,
288+
"currency": "USD",
289+
"revenue": 9.99,
290+
"customer_user_id": "user_12345",
291+
"external_device_id": "user_12345",
292+
"ip_address": "192.168.100.1",
293+
"user_agent": "Mozilla/5.0 (Linux; Android 14; SM-S901B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36",
294+
"android_id": "875646c2-4a56-4211-8931-168532479006",
295+
"gps_adid": "875646c2-4a56-4211-8931-168532479006",
296+
"callback_params": "{\"integration_event_id\":\"550e8400-e29b-41d4-a716-446655440000\",\"customer_user_id\":\"user_12345\",\"vendor_product_id\":\"com.example.app.yearly.premium\",\"transaction_id\":\"GPA.3312-4512-1100-55923\",\"original_transaction_id\":\"GPA.3312-4512-1100-55923\",\"store\":\"play_store\",\"store_country\":\"US\",\"price_usd\":9.99,\"proceeds_usd\":8.49,\"price_local\":9.99,\"proceeds_local\":8.49,\"net_revenue_usd\":8.49,\"tax_amount_usd\":0.0,\"is_active\":true,\"will_renew\":true,\"is_refund\":false}",
297+
"partner_params": "{\"integration_event_id\":\"550e8400-e29b-41d4-a716-446655440000\",\"customer_user_id\":\"user_12345\",\"vendor_product_id\":\"com.example.app.yearly.premium\",\"transaction_id\":\"GPA.3312-4512-1100-55923\",\"original_transaction_id\":\"GPA.3312-4512-1100-55923\",\"store\":\"play_store\",\"store_country\":\"US\",\"price_usd\":9.99,\"proceeds_usd\":8.49,\"price_local\":9.99,\"proceeds_local\":8.49,\"net_revenue_usd\":8.49,\"tax_amount_usd\":0.0,\"is_active\":true,\"will_renew\":true,\"is_refund\":false}"
298+
}
273299
```
274300

275-
</TabItem>
276-
</Tabs>
301+
Where
302+
303+
| Parameter | Type | Description |
304+
|:---------------------|:--------|:------------------------------------------------------------|
305+
| `app_token` | String | The Adjust App Token from your integration settings. |
306+
| `event_token` | String | The Adjust Event Token mapped to the specific Adapty event. |
307+
| `s2s` | Integer | Server-to-Server event flag. |
308+
| `environment` | String | `sandbox` or `production`. |
309+
| `created_at_unix` | Integer | Timestamp of the event in seconds. |
310+
| `currency` | String | Currency code (e.g., "USD"). |
311+
| `revenue` | Float | Revenue amount. Only sent if > 0.001. |
312+
| `customer_user_id` | String | The user's Customer User ID. |
313+
| `external_device_id` | String | Same as `customer_user_id`. |
314+
| `ip_address` | String | User's IP address. |
315+
| `user_agent` | String | Device User Agent string. |
316+
| `adid` | String | Adjust Device ID (if known). |
317+
| `android_id` | String | **Android only**. Google Advertising ID. |
318+
| `gps_adid` | String | **Android only**. Google Advertising ID. |
319+
| `idfa` | String | **iOS only**. ID for Advertisers. |
320+
| `idfv` | String | **iOS only**. ID for Vendors. |
321+
| `callback_params` | String | JSON string containing detailed event data (see below). |
322+
| `partner_params` | String | Same as `callback_params`. |
323+
324+
The parameters below are encoded together into a JSON string and sent in the `callback_params` and `partner_params` fields:
325+
326+
| Parameter | Type | Description |
327+
|:--------------------------|:--------|:---------------------------------------------------------|
328+
| `integration_event_id` | String | Unique ID for the event in Adapty. |
329+
| `customer_user_id` | String | The user's Customer User ID. |
330+
| `vendor_product_id` | String | Product ID in the store. |
331+
| `transaction_id` | String | Store Transaction ID. |
332+
| `original_transaction_id` | String | Original Store Transaction ID. |
333+
| `store` | String | `app_store` or `play_store`. |
334+
| `store_country` | String | Country code of the store user. |
335+
| `price_usd` | Float | Revenue in USD. |
336+
| `proceeds_usd` | Float | Proceeds (revenue - commission) in USD. |
337+
| `price_local` | Float | Revenue in local currency. |
338+
| `proceeds_local` | Float | Proceeds in local currency. |
339+
| `net_revenue_usd` | Float | Net revenue (after taxes/fees) in USD. |
340+
| `tax_amount_usd` | Float | Tax amount in USD. |
341+
| `is_active` | Boolean | `true` if subscription is active. |
342+
| `will_renew` | Boolean | `true` if subscription is set to renew. |
343+
| `is_refund` | Boolean | `true` if the event is a refund. |
344+
| `is_lifetime` | Boolean | `true` if the product is lifetime. |
345+
| `cancellation_reason` | String | Reason for cancellation (e.g., `voluntarily_cancelled`). |
346+
| `subscription_expires_at` | String | ISO 8601 date string of expiration. |
277347

278348
## Troubleshooting
279349

0 commit comments

Comments
 (0)