Trademob 要使用该功能,请先为您的平台下载并设置对应的 Adjust SDK。 设置环境 Maven 如果您使用的是 Maven,请将以下依赖添加至您的 build.gradle 文件: build.gradledependencies { implementation 'com.adjust.sdk:adjust-android:4.38.5' implementation 'com.adjust.sdk:adjust-android-trademob:4.38.5'} 作为 JAR 添加 您也可以访问我们的发布页面,将插件作为 JAR 文件添加。 Trademob 事件 查看产品页面 import com.adjust.sdk.plugin.AdjustTrademob; AdjustEvent event = new AdjustEvent("{viewListingEventToken}");List<string> items = Arrays.asList("itemId1", "itemId2", "itemId3");Map<String, String> metadata = new HashMap<>();metadata.put("info1", "value1");metadata.put("info2", "value2"); AdjustTrademob.injectViewListingIntoEvent(event, items, metadata);Adjust.trackEvent(event); View Item (查看物品) import com.adjust.sdk.plugin.AdjustTrademob; AdjustEvent event = new AdjustEvent("{viewItemEventToken}");Map<String, String> metadata = new HashMap<>();metadata.put("info1", "value1");metadata.put("info2", "value2"); AdjustTrademob.injectViewItemIntoEvent(event, "itemId1", metadata);Adjust.trackEvent(event); Add to basket (加入购物车) import com.adjust.sdk.plugin.AdjustTrademob;import com.adjust.sdk.plugin.TrademobItem; AdjustEvent event = new AdjustEvent("{basketEventToken}");TrademobItem itemId1 = new TrademobItem("itemId1", 2, 54f);TrademobItem itemId2 = new TrademobItem("itemId2", 1, 3f);TrademobItem itemId3 = new TrademobItem("itemId3", 4, 25f);List<trademobitem> items = Arrays.asList(itemId1, itemId2, itemId3); AdjustTrademob.injectAddToBasketIntoEvent(event, items, null);Adjust.trackEvent(event); Checkout (结算) import com.adjust.sdk.plugin.AdjustTrademob;import com.adjust.sdk.plugin.TrademobItem; AdjustEvent event = new AdjustEvent("{checkoutEventToken}");TrademobItem itemId1 = new TrademobItem("itemId1", 2, 54f);TrademobItem itemId2 = new TrademobItem("itemId2", 1, 3f);TrademobItem itemId3 = new TrademobItem("itemId3", 4, 25f);List<trademobitem> items = Arrays.asList(itemId1, itemId2, itemId3); Map<String, String> metadata = new HashMap<>();metadata.put("info1", "value1");metadata.put("info2", "value2"); AdjustTrademob.injectCheckoutIntoEvent(event, items, metadata);Adjust.trackEvent(event);