Skip to content

Commit cbc72eb

Browse files
author
Chris Marshall
authored
Merge pull request #290 from adjust/batch-file
Batch file created
2 parents e1d4b36 + 58ea81c commit cbc72eb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

doc/english/batch.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Integrate Adjust with the Batch.com SDK
2+
3+
To integrate Adjust with the Batch.com SDK, you must send your Adjust attribution data to the Batch SDK after receiving the attribution response from the Adjust backend. Follow the steps in the [attribution callback][attribution-callback] chapter of our Android SDK guide to implement this. To use the Batch.com SDK API, the callback method can be set as the following:
4+
5+
```java
6+
AdjustConfig config = new AdjustConfig(this, appToken, environment);
7+
8+
config.setOnAttributionChangedListener(new OnAttributionChangedListener() {
9+
@Override
10+
public void onAttributionChanged(AdjustAttribution attribution) {
11+
// initiate Batch user editor to set new attributes
12+
BatchUserDataEditor editor = Batch.User.editor();
13+
14+
if (attribution.network != null)
15+
editor.setAttribute("adjust_network", attribution.network);
16+
if (attribution.campaign != null)
17+
editor.setAttribute("adjust_campaign", attribution.campaign);
18+
if (attribution.adgroup != null)
19+
editor.setAttribute("adjust_adgroup", attribution.adgroup);
20+
if (attribution.creative != null)
21+
editor.setAttribute("adjust_creative", attribution.creative);
22+
23+
// send new attributes to Batch servers
24+
editor.save();
25+
}
26+
});
27+
28+
Adjust.onCreate(config);
29+
```
30+
31+
Before you implement this interface, please consider the [possible conditions for usage of some of your data][attribution-data].
32+
33+
[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md
34+
[attribution-callback]: https://github.com/adjust/android_sdk#attribution-callback

0 commit comments

Comments
 (0)