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 事件 查看产品页面 Java 1import com.adjust.sdk.plugin.AdjustTrademob;2 3AdjustEvent event = new AdjustEvent("{viewListingEventToken}");4List<string> items = Arrays.asList("itemId1", "itemId2", "itemId3");5Map<String, String> metadata = new HashMap<>();6metadata.put("info1", "value1");7metadata.put("info2", "value2");8 9AdjustTrademob.injectViewListingIntoEvent(event, items, metadata);10Adjust.trackEvent(event); View Item (查看物品) Java 1import com.adjust.sdk.plugin.AdjustTrademob;2 3AdjustEvent event = new AdjustEvent("{viewItemEventToken}");4Map<String, String> metadata = new HashMap<>();5metadata.put("info1", "value1");6metadata.put("info2", "value2");7 8AdjustTrademob.injectViewItemIntoEvent(event, "itemId1", metadata);9Adjust.trackEvent(event); Add to basket (加入购物车) Java 1import com.adjust.sdk.plugin.AdjustTrademob;2import com.adjust.sdk.plugin.TrademobItem;3 4AdjustEvent event = new AdjustEvent("{basketEventToken}");5TrademobItem itemId1 = new TrademobItem("itemId1", 2, 54f);6TrademobItem itemId2 = new TrademobItem("itemId2", 1, 3f);7TrademobItem itemId3 = new TrademobItem("itemId3", 4, 25f);8List<trademobitem> items = Arrays.asList(itemId1, itemId2, itemId3);9 10AdjustTrademob.injectAddToBasketIntoEvent(event, items, null);11Adjust.trackEvent(event); Checkout (结算) Java 1import com.adjust.sdk.plugin.AdjustTrademob;2import com.adjust.sdk.plugin.TrademobItem;3 4AdjustEvent event = new AdjustEvent("{checkoutEventToken}");5TrademobItem itemId1 = new TrademobItem("itemId1", 2, 54f);6TrademobItem itemId2 = new TrademobItem("itemId2", 1, 3f);7TrademobItem itemId3 = new TrademobItem("itemId3", 4, 25f);8List<trademobitem> items = Arrays.asList(itemId1, itemId2, itemId3);9 10Map<String, String> metadata = new HashMap<>();11metadata.put("info1", "value1");12metadata.put("info2", "value2");13 14AdjustTrademob.injectCheckoutIntoEvent(event, items, metadata);15Adjust.trackEvent(event);