広告主のためのコンバージョン記録 (レガシー)
Rokt SDK for React Nativeは、アプリ内で発生するコンバージョンイベントを記録するために実行できます。
始める前に
Rokt Android SDKがアプリケーションに統合されていることを確認してください。
Rokt SDKのインポート
JavaScript/TypeScriptファイルにRokt SDKをインポートします:
import { Rokt, RoktEmbeddedView } from "@rokt/react-native-sdk";
Rokt React Native SDKの実行
適切な消費者属性を渡して、望ましいポイントでSDKを実行します。この時点で、コンバージョンイベントが記録されます。
Rokt統合に含める顧客属性を選択できます。利用可能なデータフィールドの詳細は、attributesページで確認できます。追加の属性を追加したい場合は、以下のサンプルに新しい属性ごとにコード行を追加できます。
コンバージョンイベントを記録する際には、conversiontype属性をRoktに送信し、記録されるコンバージョンに適した値 を設定することをお勧めします。
Rokt React Native SDKは、パートナーアプリケーションにRoktプレースメントを統合するためにも使用されます。Roktプレースメントを表示する際に利用可能なオプションのコールバックがSDKにありますが、このガイドは特にコンバージョンイベントの記録に関するものであるため、これらのコールバックを考慮する必要はありません。
メジャーバージョン 3
- JavaScript
- TypeScript
const attributes = {
email: "j.smith@example.com",
conversiontype: "appinstall",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};
Rokt.execute("RoktConversion", attributes, null, () =>
console.log("Placement Loaded")
);
const attributes: Record<string, string> = {
email: "j.smith@example.com",
conversiontype: "appinstall",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};
Rokt.execute("RoktConversion", attributes, null, () =>
console.log("Placement Loaded")
);
メジャーバージョン 4
- JavaScript
- TypeScript
const attributes = {
email: "j.smith@example.com",
conversiontype: "appinstall",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};
Rokt.execute("RoktConversion", attributes, null);
const attributes: Record<string, string> = {
email: "j.smith@example.com",
conversiontype: "appinstall",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};
Rokt.execute("RoktConversion", attributes, null);
注記
ViewName(「RoktConversion」)は、SDKを複数の場所で実行する際に、アプリ内でSDKが実行され るコンテキストに応じて異なるエクスペリエンスを表示するために変更することができます。ViewNameを変更する場合は、Roktシステム内で対応する調整が行われるよう、Roktチームと連携してください。