Adjust SDKとBatch.comイベントを連携させるには、以下のいずれかのメソッドを実行します。
事前準備
この機能を利用するには、まずAdjust Android SDKをダウンロードして設定してください。
AdjustとBatch.com SDKを連携するには、Batch.com SDKにアトリビューションを送信する必要があります。Adjustサーバーからレスポンスを受け取った後に情報を送信してください。これを実行するには、アトリビューションコールバック設定ガイドの手順に従ってください。
例
次のようなコールバックメソッドを設定できます。
AdjustConfig config = new AdjustConfig(this, appToken, environment);
config.setOnAttributionChangedListener(new OnAttributionChangedListener() { @Override public void onAttributionChanged(AdjustAttribution attribution) { // Initiate Batch user editor to set new attributes. BatchUserDataEditor editor = Batch.User.editor();
if (attribution.network != null) { editor.setAttribute("adjust_network", attribution.network); } if (attribution.campaign != null) { editor.setAttribute("adjust_campaign", attribution.campaign); } if (attribution.adgroup != null) { editor.setAttribute("adjust_adgroup", attribution.adgroup); } if (attribution.creative != null) { editor.setAttribute("adjust_creative", attribution.creative); }
// Send new attributes to Batch servers. editor.save(); }});
Adjust.initSdk(config);