Adjust SDKとイベントを連携することができます。
環境を設定する
Maven
Mavenを使用している場合は、build.gradle
ファイルに下記のdependencyを追加します。
implementation 'com.adjust.sdk:adjust-android:4.38.5'
implementation 'com.adjust.sdk:adjust-android-criteo:4.38.5'
JAR
プラグインは、リリースページからJARファイルとして追加することもできます。
Sociomanticイベント
Sociomanticプラグインをインストールすると、Sociomanticイベントメソッドや、以下の定数にアクセスできるようになります。これらは、辞書のプロパティ名として使用する必要があります。
final static String SCMCategory;
final static String SCMProductName;
final static String SCMSalePrice;
final static String SCMAmount;
final static String SCMCurrency;
final static String SCMProductURL;
final static String SCMProductImageURL;
final static String SCMBrand;
final static String SCMDescription;
final static String SCMTimestamp;
final static String SCMValidityTimestamp;
final static String SCMQuantity;
final static String SCMScore;
final static String SCMProductID;
final static String SCMActionConfirmed;
final static String SCMCustomerAgeGroup;
final static String SCMCustomerEducation;
final static String SCMCustomerGender;
final static String SCMCustomerID;
final static String SCMCustomerMHash;
final static String SCMCustomerSegment;
final static String SCMCustomerTargeting;
final static String SCMTransaction;
Sociomanticイベントを送信する前に、以下のようにパートナーIDを設定する必要があります。
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustSociomantic.injectPartnerIdInSociomanticEvents("{sociomanticPartnerId}");
パートナーIDを設定すると、さまざまなSociomanticイベントを連携できるようになります。
例
カスタマーイベント
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(HOMEPAGE_TOKEN);
Map<String, String> customerData = new HashMap<>();
customerData.put(AdjustSociomantic.SCMCustomerAgeGroup, "0");
AdjustSociomantic.injectCustomerDataIntoEvent(event, customerData);
Adjust.trackEvent(event);
ホームページの閲覧
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(HOMEPAGE_TOKEN);
Adjust.trackEvent(event);
リストの閲覧
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(LISTING_TOKEN);
List<string> categories = Arrays.asList("cat1", "cat2", "cat3");
String date = "1427792434"
AdjustSociomantic.injectViewListingIntoEvent(event, categories);
Adjust.trackEvent(event);
// You also can provide a date like this.
AdjustSociomantic.injectViewListingIntoEvent(event, categories, date);
Adjust.trackEvent(event);
商品の閲覧
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(PRODUCT_VIEW_TOKEN);
Map<String, Object> product = new HashMap<>();
List<string> categories = Arrays.asList("cat1", "cat2", "cat3");
product.put(AdjustSociomantic.SCMCategory, categories);
AdjustSociomantic.injectProductIntoEvent(event, "123456");
Adjust.trackEvent(event);
// You can also provide product information.
AdjustSociomantic.injectProductIntoEvent(event, "123456", product);
Adjust.trackEvent(event);
使用可能な商品パラメーター
パラメーター名 | 要件 | 説明 | 注意事項 |
---|
SCMCategory | 必須 | 商品のカテゴリー(カテゴリーパス全体) | カテゴリーページやリストページのトラッキングコードで提供されるカテゴリー情報は、商品ページのトラッキングコード、またはフィードで提供されるカテゴリー情報と一致していることが必要です。 |
SCMProductName | 必須 | 商品名 | 特殊文字はエンコードせず、正しいUTF-8を使用してください。HTMLマークアップは一切使用しないでください。 |
SCMSalePrice | 必須 | 販売価格(10進値)(例:2.99) | 小数点の記号にはドットを使用し、3桁ごとの区切り文字は使用しないでください。 |
SCMAmount | 必須 | 通常価格(10進値)(例:3.99) | 小数点の記号にはドットを使用し、3桁ごとの区切り文字は使用しないでください。 |
SCMCurrency | 必須 | ISO 4217形式の通貨コード(例:EUR) | 固定の通貨コード。トラッキングコードのサンプルですでに提供されています。 |
SCMProductURL | 必須 | 商品のURL(ディープリンク) | 可能であれば、Google Analytics、 HURRA、Eulerianなどのクリックトラッキングパラメーターが含まれていない、動作するディープリンクを提供してください。ディープリンクは次からはじめてください:http:// |
SCMProductImageURL | 必須 | 商品画像のURL | 適度なサイズの画像をご用意ください。広告表示を最適化するには、画像は200x200ピクセル以上、同じアスペクト比である必要があります。 |
SCMBrand | 必須 | 商品ブランド | 特殊文字はエンコードせず、正しいUTF-8を使用してください(上記のSCMProductNameと同様)。HTMLマークアップは一切使用しないでください。 |
SCMDescription | オプション | 商品の簡単な説明 | 特殊文字はエンコードせず、正しいUTF-8を使用してください(上記のSCMProductNameと同様)。HTMLマークアップは一切使用しないでください。 |
SCMTimestamp | オプション | 商品の在庫期限のタイムスタンプ(GMTで指定)。 | ユーザーが検索した日付を指定してください。NSTimeIntervalをNSNumberにラップしたものである必要があります(サンプルを参照)。 |
SCMValidityTimestamp | オプション | 商品の在庫期限のタイムスタンプ(GMTで指定)。 | 商品の在庫期限のUNIXタイムスタンプを指定してください。常に在庫のある商品の場合、0としてください。NSTimeIntervalをNSNumberにラップしたものである必要があります(上記のSCMTimestampと同様)。 |
SCMQuantity | オプション | 商品の在庫数 | このフィールドを連携する場合は、必ずSociomantic担当者と相談してから行ってください。 |
SCMScore | オプション | 商品の優先度スコア(値の範囲は0~10.0) | このフィールドを連携する場合は、必ずSociomantic担当者と相談してから行ってください。 |
カート
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(BASKET_TOKEN);
Map<String, Object> product1 = new HashMap<>();
product1.put(AdjustSociomantic.SCMProductID, "1");
product1.put(AdjustSociomantic.SCMAmount, 42);
product1.put(AdjustSociomantic.SCMCurrency, "EUR");
product1.put(AdjustSociomantic.SCMQuantity, 1);
Map<String, Object> product2 = new HashMap<>();
product2.put(AdjustSociomantic.SCMProductID, "2");
List<object> products = Arrays.asList(product1, product2, product3);
AdjustSociomantic.injectCartIntoEvent(event, products);
Adjust.trackEvent(event);
使用可能なカートパラメーター
パラメーター名 | 要件 | 説明 | 注意事項 |
---|
SCMProductID | 必須 | 製品ID | 色やサイズのバリエーションについては、サブIDを付けずに商品IDを指定してください。 |
SCMAmount | オプション | 製品価格(10進値)(例:2.99) | 小数点の記号にはドットを使用し、3桁ごとの区切り文字は使用しないでください。数量が1以上の場合でも、製品単価のみを指定してください。 |
SCMCurrency | オプション | ISO 4217形式の通貨コード(例:EUR) | 固定の通貨コード。トラッキングコードのサンプルですでに提供されています。 |
SCMQuantity | オプション | 選択された商品の数量 | 整数値で指定してください。 |
未確定のトランザクション
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(SALE_TOKEN);
Map<String, Object> product1 = new HashMap<>();
product1.put(AdjustSociomantic.SCMProductID, "1");
product1.put(AdjustSociomantic.SCMAmount, 42);
product1.put(AdjustSociomantic.SCMQuantity, 1);
Map<String, Object> product2 = new HashMap<>();
product2.put(AdjustSociomantic.SCMProductID, "2");
List<object> products = Arrays.asList(product1, product2, product3);
AdjustSociomantic.injectTransactionIntoEvent(event, "123456", products);
Adjust.trackEvent(event);
またはパラメーターを含む場合
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(SALE_TOKEN);
Map<String, Object> product1 = new HashMap<>();
product1.put(AdjustSociomantic.SCMProductID, "1");
product1.put(AdjustSociomantic.SCMAmount, 42);
product1.put(AdjustSociomantic.SCMQuantity, 1);
Map<String, Object> product2 = new HashMap<>();
product2.put(AdjustSociomantic.SCMProductID, "2");
List<object> products = Arrays.asList(product1, product2, product3);
Map<String, Object> parameters = new HashMap<>();
parameters.put(AdjustSociomantic.SCMCurrency, "EUR");
parameters.put(AdjustSociomantic.SCMAmount, 42);
AdjustSociomantic.injectTransactionIntoEvent(event, "123456", products, parameters);
Adjust.trackEvent(event);
確定したトランザクション
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(SALE_TOKEN);
Map<String, Object> product1 = new HashMap<>();
product1.put(AdjustSociomantic.SCMProductID, "1");
product1.put(AdjustSociomantic.SCMAmount, 42);
product1.put(AdjustSociomantic.SCMQuantity, 1);
Map<String, Object> product2 = new HashMap<>();
product2.put(AdjustSociomantic.SCMProductID, "2");
List<object> products = Arrays.asList(product1, product2, product3);
AdjustSociomantic.injectConfirmedTransactionIntoEvent(event, "123456", products);
Adjust.trackEvent(event);
またはパラメーターを含む場合
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(SALE_TOKEN);
Map<String, Object> product1 = new HashMap<>();
product1.put(AdjustSociomantic.SCMProductID, "1");
product1.put(AdjustSociomantic.SCMAmount, 42);
product1.put(AdjustSociomantic.SCMQuantity, 1);
Map<String, Object> product2 = new HashMap<>();
product2.put(AdjustSociomantic.SCMProductID, "2");
List<object> products = Arrays.asList(product1, product2, product3);
Map<String, Object> parameters = new HashMap<>();
parameters.put(AdjustSociomantic.SCMCurrency, "EUR");
parameters.put(AdjustSociomantic.SCMAmount, 42);
AdjustSociomantic.injectConfirmedTransactionIntoEvent(event, "123456", products, parameters);
Adjust.trackEvent(event);
使用可能なカートパラメーター
パラメーター名 | 要件 | 説明 | 注意事項 |
---|
SCMAmount | オプション | 製品価格(10進値)(例:2.99) | 小数点の記号にはドットを使用し、3桁ごとの区切り文字は使用しないでください。数量が1以上の場合でも、製品単価のみを指定してください。 |
SCMCurrency | オプション | ISO 4217形式の通貨コード(例:EUR) | 固定の通貨コード。トラッキングコードのサンプルですでに提供されています。 |
SCMQuantity | オプション | 選択された商品の数量 | 整数値で指定してください。 |
リードイベント
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(LEAD_TOKEN);
AdjustSociomantic.injectLeadIntoEvent(event, "123456");
Adjust.trackEvent(event);
または確定したリード
import com.adjust.sdk.plugin.AdjustSociomantic;
AdjustEvent event = new AdjustEvent(LEAD_TOKEN);
AdjustSociomantic.injectLeadIntoEvent(event, "123456", Boolean.TRUE);
Adjust.trackEvent(event);