広告主向けのコンバージョンレポート
Roktの広告主の場合、Android SDKを使用して、アプリ内で発生するコンバージョンイベントを記録し、キャンペーンの成果を確認することができます。
開始する前に
Rokt Android SDKが既にアプリに統合されていることを確認してください。統合手順については、こちらを参照してください。
Rokt Android SDKの実行
適切なカスタマーアトリビュートとプレースメントマッピングを追加して、任意のアクティビティ/フラグメントでSDKを実行します。以下の例コードでは、onCreate
メソッドを使用してコンバージョンをレポートしています。
Roktと共有するカスタマーアトリビュートを指定することができます。使用可能なデータフィールドの詳細については、attributesページを参照してください。さらに属性を共有したい場合は、新しい属性ごとにコードの追加行を追加することができます。
注記
Rokt Android SDKは、Roktの配置をパートナーアプリケーションに統合するためにも使用されます。Roktの配置を表示する際には、SDKにオプションのコールバックが利用できます。ただし、このガイドは特にコンバージョンイベントの記録について言及しているため、コールバックは無視してください。
- Java
- Kotlin
import com.rokt.roktsdk.Rokt
class ConfirmationActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
// 適切な消費者属性を含める
val attributes = hashMapOf(
Pair("email", "j.smith@example.com"),
Pair("firstname", "Jenny"),
Pair("lastname", "Smith"),
Pair("mobile", "(323) 867-5309"),
Pair("postcode", "90210"),
Pair("country", "US"))
Rokt.execute("RoktExperience",
attributes,
object : Rokt.RoktCallback {
override fun onUnload(reason: Rokt.UnloadReasons) {
}
override fun onLoad() {
}
override fun onShouldHideLoadingIndicator() {
}
override fun onShouldShowLoadingIndicator() {
}
}
)
...
}
}
import com.rokt.roktsdk.Rokt;
class ConfirmationActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
...
Map<String,String> attributes = new HashMap<String, String>();
attributes.put("email", "j.smith@example.com");
attributes.put("firstname", "Jenny");
attributes.put("lastname", "Smith");
attributes.put("mobile", "(323) 867-5309");
attributes.put("postcode", "90210");
attributes.put("country", "US");
Rokt.INSTANCE.execute("RoktExperience",
attributes,
new Rokt.RoktCallback() {
@Override
public void onLoad() {
}
@Override
public void onUnload(Rokt.UnloadReasons unloadReasons) {
}
@Override
public void onShouldHideLoadingIndicator() {
}
@Override
public void onShouldShowLoadingIndicator() {
}
}
)
...
}
}