|
| 1 | +## Trademobプラグイン |
| 2 | + |
| 3 | +Add the dependency of the adjust sdk with the Trademob plugin: |
| 4 | + |
| 5 | +``` |
| 6 | +compile 'com.adjust.sdk:adjust-android-trademob:4.11.3' |
| 7 | +``` |
| 8 | + |
| 9 | +Or integrate adjust with Trademob events by following these steps: |
| 10 | + |
| 11 | +1. Locate the `plugin/Trademob` folder inside the downloaded archive from our |
| 12 | + [releases page](https://github.com/adjust/android_sdk/releases). |
| 13 | + |
| 14 | +2. Open the `adjust` module in Android Studio and locate the |
| 15 | + `plugin` package folder in `adjust/java/com/adjust/sdk`. |
| 16 | + |
| 17 | +3. Drag the `AdjustTrademob.java` and `TrademobItem.java` files from the |
| 18 | + downloaded `plugin/Trademob/com/adjust/sdk/plugin` folder into the `plugin` folder in the `adjust` project. |
| 19 | + |
| 20 | +For questions regarding this plugin, please reach out to `[email protected]` |
| 21 | + |
| 22 | +You can now use Trademob event in the following ways: |
| 23 | + |
| 24 | +### View Listing |
| 25 | + |
| 26 | +```java |
| 27 | +import com.adjust.sdk.plugin.AdjustTrademob; |
| 28 | + |
| 29 | +AdjustEvent event = new AdjustEvent("{viewListingEventToken}"); |
| 30 | + |
| 31 | +List<String> items = Arrays.asList("itemId1", "itemId2", "itemId3"); |
| 32 | + |
| 33 | +Map<String, String> metadata = new HashMap<>(); |
| 34 | +metadata.put("info1", "value1"); |
| 35 | +metadata.put("info2", "value2"); |
| 36 | + |
| 37 | +AdjustTrademob.injectViewListingIntoEvent(event, items, metadata); |
| 38 | + |
| 39 | +Adjust.trackEvent(event); |
| 40 | +``` |
| 41 | + |
| 42 | +### View Item |
| 43 | + |
| 44 | +```java |
| 45 | +import com.adjust.sdk.plugin.AdjustTrademob; |
| 46 | + |
| 47 | +AdjustEvent event = new AdjustEvent("{viewItemEventToken}"); |
| 48 | + |
| 49 | +Map<String, String> metadata = new HashMap<>(); |
| 50 | +metadata.put("info1", "value1"); |
| 51 | +metadata.put("info2", "value2"); |
| 52 | + |
| 53 | +AdjustTrademob.injectViewItemIntoEvent(event, "itemId1", metadata); |
| 54 | + |
| 55 | +Adjust.trackEvent(event); |
| 56 | +``` |
| 57 | + |
| 58 | +### Add to Basket |
| 59 | + |
| 60 | +```java |
| 61 | +import com.adjust.sdk.plugin.AdjustTrademob; |
| 62 | +import com.adjust.sdk.plugin.TrademobItem; |
| 63 | + |
| 64 | +AdjustEvent event = new AdjustEvent("{basketEventToken}"); |
| 65 | + |
| 66 | +TrademobItem itemId1 = new TrademobItem("itemId1", 2, 54f); |
| 67 | +TrademobItem itemId2 = new TrademobItem("itemId2", 1, 3f); |
| 68 | +TrademobItem itemId3 = new TrademobItem("itemId3", 4, 25f); |
| 69 | + |
| 70 | +List<TrademobItem> items = Arrays.asList(itemId1, itemId2, itemId3); |
| 71 | + |
| 72 | +AdjustTrademob.injectAddToBasketIntoEvent(event, items, null); |
| 73 | + |
| 74 | +Adjust.trackEvent(event); |
| 75 | +``` |
| 76 | + |
| 77 | +### Checkout |
| 78 | + |
| 79 | +```java |
| 80 | +import com.adjust.sdk.plugin.AdjustTrademob; |
| 81 | +import com.adjust.sdk.plugin.TrademobItem; |
| 82 | + |
| 83 | +AdjustEvent event = new AdjustEvent("{checkoutEventToken}"); |
| 84 | + |
| 85 | +TrademobItem itemId1 = new TrademobItem("itemId1", 2, 54f); |
| 86 | +TrademobItem itemId2 = new TrademobItem("itemId2", 1, 3f); |
| 87 | +TrademobItem itemId3 = new TrademobItem("itemId3", 4, 25f); |
| 88 | + |
| 89 | +List<TrademobItem> items = Arrays.asList(itemId1, itemId2, itemId3); |
| 90 | + |
| 91 | +Map<String, String> metadata = new HashMap<>(); |
| 92 | +metadata.put("info1", "value1"); |
| 93 | +metadata.put("info2", "value2"); |
| 94 | + |
| 95 | +AdjustTrademob.injectCheckoutIntoEvent(event, items, metadata); |
| 96 | + |
| 97 | +Adjust.trackEvent(event); |
| 98 | +``` |
0 commit comments