From f76cebf60047d63d2a33dbe7c0c2bd8d0a6afabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Fri, 29 Jul 2022 10:52:50 +0200 Subject: [PATCH] Remove markdown docs --- README.md | 2443 +---------------- doc/chinese/README.md | 2298 ---------------- doc/chinese/misc/fb-pixel.md | 115 - doc/chinese/misc/multiple-receivers.md | 31 - doc/chinese/misc/pre-install-tracker-tool.md | 156 -- doc/chinese/plugins/imei.md | 62 - doc/chinese/plugins/oaid.md | 59 - doc/chinese/sdk-to-sdk/admob.md | 30 - doc/chinese/sdk-to-sdk/applovin-max.md | 30 - doc/chinese/sdk-to-sdk/ironsource.md | 27 - doc/chinese/sdk-to-sdk/mopub.md | 24 - doc/english/migration/migrate.md | 203 -- doc/english/misc/eclipse.md | 44 - doc/english/misc/fb-pixel.md | 115 - doc/english/misc/multi-process-app.md | 59 - doc/english/misc/multiple-receivers.md | 30 - doc/english/misc/pre-install-tracker-tool.md | 155 -- doc/english/plugins/criteo.md | 191 -- doc/english/plugins/imei.md | 61 - doc/english/plugins/oaid.md | 67 - doc/english/plugins/sociomantic.md | 438 --- doc/english/plugins/trademob.md | 82 - doc/english/sdk-to-sdk/admob.md | 32 - doc/english/sdk-to-sdk/adobe.md | 53 - doc/english/sdk-to-sdk/applovin-max.md | 29 - doc/english/sdk-to-sdk/batch.md | 38 - doc/english/sdk-to-sdk/helium-chartboost.md | 40 - doc/english/sdk-to-sdk/ironsource.md | 28 - doc/english/sdk-to-sdk/mixpanel.md | 48 - doc/english/sdk-to-sdk/mopub.md | 24 - doc/english/sdk-to-sdk/unity.md | 41 - doc/japanese/README.md | 2291 ---------------- doc/japanese/migration/migrate.md | 239 -- doc/japanese/misc/eclipse.md | 66 - doc/japanese/misc/fb-pixel.md | 128 - doc/japanese/misc/multi-process-app.md | 61 - doc/japanese/misc/multiple-receivers.md | 30 - doc/japanese/misc/pre-install-tracker-tool.md | 155 -- doc/japanese/plugins/criteo.md | 197 -- doc/japanese/plugins/oaid.md | 59 - doc/japanese/plugins/sociomantic.md | 463 ---- doc/japanese/plugins/trademob.md | 96 - doc/japanese/sdk-to-sdk/admob.md | 30 - doc/japanese/sdk-to-sdk/applovin-max.md | 29 - doc/japanese/sdk-to-sdk/ironsource.md | 28 - doc/japanese/sdk-to-sdk/mixpanel.md | 59 - doc/japanese/sdk-to-sdk/mopub.md | 24 - doc/korean/README.md | 2297 ---------------- doc/korean/misc/fb-pixel.md | 115 - doc/korean/misc/multiple-receivers.md | 31 - doc/korean/misc/pre-install-tracker-tool.md | 155 -- doc/korean/plugins/criteo.md | 191 -- doc/korean/plugins/oaid.md | 61 - doc/korean/sdk-to-sdk/admob.md | 29 - doc/korean/sdk-to-sdk/applovin-max.md | 30 - doc/korean/sdk-to-sdk/ironsource.md | 28 - doc/korean/sdk-to-sdk/mopub.md | 24 - 57 files changed, 4 insertions(+), 13965 deletions(-) delete mode 100644 doc/chinese/README.md delete mode 100644 doc/chinese/misc/fb-pixel.md delete mode 100644 doc/chinese/misc/multiple-receivers.md delete mode 100644 doc/chinese/misc/pre-install-tracker-tool.md delete mode 100644 doc/chinese/plugins/imei.md delete mode 100644 doc/chinese/plugins/oaid.md delete mode 100644 doc/chinese/sdk-to-sdk/admob.md delete mode 100644 doc/chinese/sdk-to-sdk/applovin-max.md delete mode 100644 doc/chinese/sdk-to-sdk/ironsource.md delete mode 100644 doc/chinese/sdk-to-sdk/mopub.md delete mode 100644 doc/english/migration/migrate.md delete mode 100644 doc/english/misc/eclipse.md delete mode 100644 doc/english/misc/fb-pixel.md delete mode 100644 doc/english/misc/multi-process-app.md delete mode 100644 doc/english/misc/multiple-receivers.md delete mode 100644 doc/english/misc/pre-install-tracker-tool.md delete mode 100644 doc/english/plugins/criteo.md delete mode 100644 doc/english/plugins/imei.md delete mode 100644 doc/english/plugins/oaid.md delete mode 100644 doc/english/plugins/sociomantic.md delete mode 100644 doc/english/plugins/trademob.md delete mode 100644 doc/english/sdk-to-sdk/admob.md delete mode 100644 doc/english/sdk-to-sdk/adobe.md delete mode 100644 doc/english/sdk-to-sdk/applovin-max.md delete mode 100644 doc/english/sdk-to-sdk/batch.md delete mode 100644 doc/english/sdk-to-sdk/helium-chartboost.md delete mode 100644 doc/english/sdk-to-sdk/ironsource.md delete mode 100644 doc/english/sdk-to-sdk/mixpanel.md delete mode 100644 doc/english/sdk-to-sdk/mopub.md delete mode 100644 doc/english/sdk-to-sdk/unity.md delete mode 100644 doc/japanese/README.md delete mode 100644 doc/japanese/migration/migrate.md delete mode 100644 doc/japanese/misc/eclipse.md delete mode 100644 doc/japanese/misc/fb-pixel.md delete mode 100644 doc/japanese/misc/multi-process-app.md delete mode 100644 doc/japanese/misc/multiple-receivers.md delete mode 100644 doc/japanese/misc/pre-install-tracker-tool.md delete mode 100644 doc/japanese/plugins/criteo.md delete mode 100644 doc/japanese/plugins/oaid.md delete mode 100644 doc/japanese/plugins/sociomantic.md delete mode 100644 doc/japanese/plugins/trademob.md delete mode 100644 doc/japanese/sdk-to-sdk/admob.md delete mode 100644 doc/japanese/sdk-to-sdk/applovin-max.md delete mode 100644 doc/japanese/sdk-to-sdk/ironsource.md delete mode 100644 doc/japanese/sdk-to-sdk/mixpanel.md delete mode 100644 doc/japanese/sdk-to-sdk/mopub.md delete mode 100644 doc/korean/README.md delete mode 100644 doc/korean/misc/fb-pixel.md delete mode 100644 doc/korean/misc/multiple-receivers.md delete mode 100644 doc/korean/misc/pre-install-tracker-tool.md delete mode 100644 doc/korean/plugins/criteo.md delete mode 100644 doc/korean/plugins/oaid.md delete mode 100644 doc/korean/sdk-to-sdk/admob.md delete mode 100644 doc/korean/sdk-to-sdk/applovin-max.md delete mode 100644 doc/korean/sdk-to-sdk/ironsource.md delete mode 100644 doc/korean/sdk-to-sdk/mopub.md diff --git a/README.md b/README.md index 28b4d820b..4c66bfdae 100644 --- a/README.md +++ b/README.md @@ -1,2452 +1,17 @@ -**This guide is being retired.** +# Adjust SDK for Android -This README file will be retired shortly. The SDK documentation can now be found on our help center: +This is the [Adjust](https://adjust.com)™ SDK for Android. Documentation is available on our help center in the following languages: * [English][en-helpcenter] * [中文][zh-helpcenter] * [日本語][ja-helpcenter] * [한국어][ko-helpcenter] -## Summary +## License -This is the Android SDK of Adjust™. You can read more about Adjust™ at [adjust.com]. - -Read this in other languages: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## Table of contents - -### Quick start - - * [Example apps](#qs-example-apps) - * [Getting started](#qs-getting-started) - * [Add the SDK to your project](#qs-add-sdk) - * [Add Google Play Services](#qs-gps) - * [Add permissions](#qs-permissions) - * [Proguard settings](#qs-proguard) - * [Install referrer](#qs-install-referrer) - * [Google Play Referrer API](#qs-gpr-api) - * [Google Play Store intent](#qs-gps-intent) - * [Huawei Referrer API](#qs-huawei-referrer-api) - * [Integrate the SDK into your app](#qs-integrate-sdk) - * [Basic setup](#qs-basic-setup) - * [Native App SDK](#qs-basic-setup-native) - * [Web Views SDK](#qs-basic-setup-web) - * [Session tracking](#qs-session-tracking) - * [API level 14 and higher](#qs-session-tracking-api-14) - * [API level between 9 and 13](#qs-session-tracking-api-9) - * [SDK signature](#qs-sdk-signature) - * [Adjust logging](#qs-adjust-logging) - * [Build your app](#qs-build-the-app) - -### Deep linking - - * [Deep linking overview](#dl) - * [Standard deep linking scenario](#dl-standard) - * [Deferred deep linking scenario](#dl-deferred) - * [Reattribution via deep links](#dl-reattribution) - * [Link resolution](#link-resolution) - -### Event tracking - - * [Track event](#et-tracking) - * [Track revenue](#et-revenue) - * [Revenue deduplication](#et-revenue-deduplication) - -### Custom parameters - - * [Custom parameters overview](#cp) - * [Event parameters](#cp-event-parameters) - * [Event callback parameters](#cp-event-callback-parameters) - * [Event partner parameters](#cp-event-partner-parameters) - * [Event callback identifier](#cp-event-callback-id) - * [Session parameters](#cp-session-parameters) - * [Session callback parameters](#cp-session-callback-parameters) - * [Session partner parameters](#cp-session-partner-parameters) - * [Delay start](#cp-delay-start) - -### Additional features - - * [Push token (uninstall tracking)](#af-push-token) - * [Attribution callback](#af-attribution-callback) - * [Ad revenue tracking](#af-ad-revenue) - * [Subscription tracking](#af-subscriptions) - * [Session and event callbacks](#af-session-event-callbacks) - * [User attribution](#af-user-attribution) - * [Device IDs](#af-device-ids) - * [Google Play Services advertising identifier](#af-gps-adid) - * [Amazon advertising identifier](#af-amazon-adid) - * [Adjust device identifier](#af-adid) - * [Preinstalled apps](#af-preinstalled-apps) - * [Offline mode](#af-offline-mode) - * [Disable tracking](#af-disable-tracking) - * [Event buffering](#af-event-buffering) - * [Background tracking](#af-background-tracking) - * [GDPR right to be forgotten](#af-gdpr-forget-me) - * [Third-party sharing](#af-third-party-sharing) - * [Disable third-party sharing](#af-disable-third-party-sharing) - * [Enable third-party sharing](#af-enable-third-party-sharing) - * [Consent measurement](#af-measurement-consent) - * [Data residency](#af-data-residency) - * [COPPA compliance](#af-coppa-compliance) - * [Play Store Kids Apps](#af-play-store-kids-apps) - -### Testing and troubleshooting - - * [I'm seeing the "session failed (Ignoring too frequent session...)" error](#tt-session-failed) - * [Is my broadcast receiver capturing the install referrer?](#tt-broadcast-receiver) - * [Can I trigger an event at application launch?](#tt-event-at-launch) - -### License - - -## Quick start - -### Example apps - -There are Android example apps inside the [`example-app-java`][example-java], [`example-app-kotlin`][example-kotlin] and [`example-app-keyboard`][example-keyboard] directories, as well as example app that uses web views inside the [`example-webbridge` directory][example-webbridge] and Android TV example app inside the [`example-app-tv`][example-tv] directory. You can open the Android project to see these examples on how the Adjust SDK can be integrated. - -### Getting started - -These are the minimum required steps to integrate the Adjust SDK in your Android app. We assume that you are using Android Studio for your Android development. The minimum supported Android API level for the Adjust SDK integration is **9 (Gingerbread)**. - -### Add the SDK to your project - -If you are using Maven, add the following to your `build.gradle` file: - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -If you would prefer to use the Adjust SDK inside web views in your app, please include this additional dependency as well: - -```gradle -implementation 'com.adjust.sdk:adjust-android-webbridge:4.31.0' -``` - -**Note**: The minimum supported Android API level for the web view extension is 17 (Jelly Bean). - -You can also add the Adjust SDK and web view extension as JAR files, which can be downloaded from our [releases page][releases]. - -### Add Google Play Services - -Since the 1st of August of 2014, apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify devices. To enable the Google Advertising ID for our SDK, you must integrate [Google Play Services][google-play-services]. If you haven't done this yet, please add dependency to the Google Play Services library by adding the following dependecy to your `dependencies` block of app's `build.gradle` file: - -```gradle -implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' -``` - -**Note**: The Adjust SDK is not tied to any specific version of the `play-services-ads-identifier` part of the Google Play Services library. You can use the latest version of the library, or any other version you need. - -### Add permissions - -The Adjust SDK requires the following permissions. Please add them to your `AndroidManifest.xml` file if they are not already present: - -```xml - - -``` - -#### Add permission to gather Google advertising ID - -You will need to add the `com.google.android.gms.AD_ID` permission to read the device's advertising ID, when your apps are able to target Android 13 (API level 33) and above. Add the following line to your `AndroidManifest.xml` to enable the permission. - -```xml - -``` - -For more information, see [Google's `AdvertisingIdClient.Info` documentation](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid). - -### Proguard settings - -If you are using Proguard, add these lines to your Proguard file: - -``` --keep class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } -``` - -If you are **not publishing your app in the Google Play Store**, use the following `com.adjust.sdk` package rules: - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### Install referrer - -In order to correctly attribute an app install to its source, Adjust needs information about the **install referrer**. We can achieve this in two different ways: either by using the **Google Play Referrer API** or by collecting the **Google Play Store intent** with a broadcast receiver. - -**Important**: Google introduced the Google Play Referrer API to provide a more reliable and secure way to obtain install referrer information and to aid attribution providers in the fight against click injection. We **strongly advise** you to support this in your application. The Google Play Store intent is a less secure way of obtaining install referrer information. For now it exists in parallel with the new Google Play Referrer API, but will be deprecated in the future. - -#### Google Play Referrer API - -In order to support the Google Play Referrer API in your app, please make sure that you have followed our chapter on [adding the SDK to your project](#qs-add-sdk) correctly and that you have following line added to your `build.gradle` file: - -``` -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -Please follow the directions for your [Proguard settings](#qs-proguard) carefully. Confirm that you have added all the rules mentioned in it, especially the one needed for this feature: - -``` --keep public class com.android.installreferrer.** { *; } -``` - -This feature is supported if you are using **Adjust SDK v4.12.0 or above**. - -#### Google Play Store intent - -**Note**: Google has [announced](https://android-developers.googleblog.com/2019/11/still-using-installbroadcast-switch-to.html) deprecation of `INSTALL_REFERRER` intent usage to deliver referrer information as of March 1st 2020. If you are using this way of accessing referrer information, please migrate to [Google Play Referrer API](#qs-gpr-api) approach. - -You should capture the Google Play Store `INSTALL_REFERRER` intent with a broadcast receiver. If you are **not using your own broadcast receiver** to receive the `INSTALL_REFERRER` intent, add the following `receiver` tag inside the `application` tag in your `AndroidManifest.xml`. - -```xml - - - - - -``` - -We use this broadcast receiver to retrieve the install referrer and pass it to our backend. - -If you are using a different broadcast receiver for the `INSTALL_REFERRER` intent, follow [these instructions][referrer] to properly ping the Adjust broadcast receiver. - -#### Huawei Referrer API - -As of v4.21.1, the Adjust SDK supports install tracking on Huawei devices with Huawei App Gallery version 10.4 and higher. No additional integration steps are needed to start using the Huawei Referrer API. - -### Integrate the SDK into your app - -First, we'll set up basic session tracking. - -### Basic setup - -If you are integrating the SDK into a native app, follow the directions for a [Native App SDK](#qs-basic-setup-native). If you are integrating the SDK for usage inside web views, please follow the directions for a [Web Views SDK](#qs-basic-setup-web) below. - -#### Native App SDK - -We recommend using a global Android [Application][android-application] class to initialize the SDK. If you don't have one in your app, follow these steps: - -- Create a class that extends the `Application`. -- Open the `AndroidManifest.xml` file of your app and locate the `` element. -- Add the attribute `android:name` and set it to the name of your new application class. - - In our example app, we use an `Application` class named `GlobalApplication`. Therefore, we configure the manifest file as: - ```xml - - - ``` - -- In your `Application` class, find or create the `onCreate` method. Add the following code to initialize the Adjust SDK: - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - } - } - ``` - -Replace `{YourAppToken}` with your app token. You can find this in your [dashboard]. - -Next, you must set the `environment` to either sandbox or production mode: - -```java -String environment = AdjustConfig.ENVIRONMENT_SANDBOX; -String environment = AdjustConfig.ENVIRONMENT_PRODUCTION; -``` - -**Important:** Set the value to `AdjustConfig.ENVIRONMENT_SANDBOX` if (and only if) you or someone else is testing your app. Make sure to set the environment to `AdjustConfig.ENVIRONMENT_PRODUCTION` before you publish the app. Set it back to `AdjustConfig.ENVIRONMENT_SANDBOX` if you start developing and testing it again. - -We use this environment to distinguish between real traffic and test traffic from test devices. Keeping the environment updated according to your current status is very important! - -#### Web Views SDK - -After you have obtained the reference to your `WebView` object: - -- Call `webView.getSettings().setJavaScriptEnabled(true)`, to enable Javascript in the web view -- Start the default instance of `AdjustBridgeInstance` by calling `AdjustBridge.registerAndGetInstance(getApplication(), webview)` -- This will also register the Adjust bridge as a Javascript Interface to the web view -- Call `AdjustBridge.setWebView()` to set new `WebView` if needed. -- Call `AdjustBridge.unregister()` to uregister the `AdjustBridgeInstance` and `WebView`. - -After these steps, your activity should look like this: - -```java -public class MainActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - WebView webView = (WebView) findViewById(R.id.webView); - webView.getSettings().setJavaScriptEnabled(true); - webView.setWebChromeClient(new WebChromeClient()); - webView.setWebViewClient(new WebViewClient()); - - AdjustBridge.registerAndGetInstance(getApplication(), webview); - try { - webView.loadUrl("file:///android_asset/AdjustExample-WebView.html"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void onDestroy() { - AdjustBridge.unregister(); - - super.onDestroy(); - } -} -``` - -After you complete this step, you will have successfully added the Adjust bridge to your app. The Javascript bridge is now enabled to communicate between Adjust's native Android SDK and your page, which will be loaded in the web view. - -In your HTML file, import the Adjust Javascript files which are located in the root of the assets folder. If your HTML file is there as well, import them like this: - -```html - - - - -``` - -Once you add your references to the Javascript files, use them in your HTML file to initialise the Adjust SDK: - -```js -let yourAppToken = '{YourAppToken}'; -let environment = AdjustConfig.EnvironmentSandbox; -let adjustConfig = new AdjustConfig(yourAppToken, environment); - -Adjust.onCreate(adjustConfig); -``` - -Replace `{YourAppToken}` with your app token. You can find this in your [dashboard]. - -Next, set your `environment` to the corresponding value, depending on whether you are still testing or are in production mode: - -```js -let environment = AdjustConfig.EnvironmentSandbox; -let environment = AdjustConfig.EnvironmentProduction; -``` - -**Important:** Set your value to `AdjustConfig.EnvironmentSandbox` if (and only if) you or someone else is testing your app. Make sure you set the environment to `AdjustConfig.EnvironmentProduction` just before you publish the app. Set it back to `AdjustConfig.EnvironmentSandbox` if you start developing and testing again. - -We use this environment to distinguish between real traffic and test traffic from test devices. Keeping it updated according to your current status is very important! - -### Session tracking - -**Note**: This step is **very important**. Please **make sure that you implement it properly in your app**. Completing this step correctly ensures that the Adjust SDK can properly track sessions in your app. - -#### API level 14 and higher - -- Add a private class that implements the `ActivityLifecycleCallbacks` interface. If you don't have access to this interface, your app is targeting an Android API level lower than 14. You will have to manually update each activity by following these [instructions](#qs-session-tracking-api-9). If you have `Adjust.onResume` and `Adjust.onPause` calls on each of your app's activities, you should remove them. -- Edit the `onActivityResumed(Activity activity)` method and add a call to `Adjust.onResume()`. Edit the -`onActivityPaused(Activity activity)` method and add a call to `Adjust.onPause()`. -- Add the `onCreate()` method with the Adjust SDK is configured and call `registerActivityLifecycleCallbacks` with an instance of the created `ActivityLifecycleCallbacks` class. - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - - registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); - } - - private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks { - @Override - public void onActivityResumed(Activity activity) { - Adjust.onResume(); - } - - @Override - public void onActivityPaused(Activity activity) { - Adjust.onPause(); - } - - //... - } - } - ``` - -#### API level between 9 and 13 - -If your app `minSdkVersion` in gradle is between `9` and `13`, consider updating it to at least `14` to simplify the integration process. Consult the official Android [dashboard][android-dashboard] to find out the latest market share of the major versions. - -To provide proper session tracking, certain Adjust SDK methods are called every time an activity resumes or pauses (otherwise the SDK might miss a session start or end). In order to do so, follow these steps **for each Activity** of your app: - -- In your Activity's `onResume` method, call `Adjust.onResume()`. Create the method if needed. -- In your Activity's `onPause` method, call `Adjust.onPause()`. Create the method if needed. - -After these steps, your activity should look like this: - -```java -import com.adjust.sdk.Adjust; - -public class YourActivity extends Activity { - protected void onResume() { - super.onResume(); - Adjust.onResume(); - } - protected void onPause() { - super.onPause(); - Adjust.onPause(); - } -} -``` - -Repeat these steps for **every Activity** in your app. Don't forget to repeat these steps whenever you create a new activity in the future. Depending on your coding style, you might want to implement this in a common superclass of all your activities. - -### SDK signature - -An account manager must activate the Adjust SDK Signature. Contact Adjust support (support@adjust.com) if you are interested in using this feature. - -If the SDK signature has already been enabled on your account and you have access to App Secrets in your Adjust Dashboard, please use the method below to integrate the SDK signature into your app. - -An App Secret is set by calling `setAppSecret` on your config instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); -config.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(adjustConfig); -``` -
- -### Adjust logging - -You can increase or decrease the amount of logs that you see during testing by calling `setLogLevel` on your config instance with one of the following parameters: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -config.setLogLevel(LogLevel.VERBOSE); // enable all logs -config.setLogLevel(LogLevel.DEBUG); // disable verbose logs -config.setLogLevel(LogLevel.INFO); // disable debug logs (default) -config.setLogLevel(LogLevel.WARN); // disable info logs -config.setLogLevel(LogLevel.ERROR); // disable warning logs -config.setLogLevel(LogLevel.ASSERT); // disable error logs -config.setLogLevel(LogLevel.SUPRESS); // disable all logs -``` -
-Web View SDK -
- -```js -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // enable all logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug); // disable verbose logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo); // disable debug logs (default) -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn); // disable info logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelError); // disable warning logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert); // disable error logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); // disable all logs -``` -
- -If you want to disable all of your log output, set the log level to suppress, and use the constructor for config object (which gets boolean parameters indicating whether or not suppress log level should be supported): - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment, true); -config.setLogLevel(LogLevel.SUPRESS); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment, true); -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); -Adjust.onCreate(adjustConfig); -``` -
- -### Build your app - -Build and run your Android app. In your `LogCat` viewer, set the filter `tag:Adjust` to hide all other logs. After your app has launched you should see the following Adjust log: `Install tracked`. - -## Deep linking - -### Deep linking Overview - -If you are using Adjust tracker URLs with deeplinking enabled, it is possible to receive information about the deeplink URL and its content. Users may interact with the URL regardless of whether they have your app installed on their device (standard deep linking scenario) or not (deferred deep linking scenario). In the standard deep linking scenario, the Android platform natively offers the possibility for you to receive deep link content information. The Android platform does not automatically support deferred deep linking scenario; in this case, the Adjust SDK offers the mechanism you need to get the information about the deep link content. - -### Standard deep linking scenario - -If a user has your app installed and you want it to launch after they engage with an Adjust tracker URL with the `deep_link` parameter in it, enable deeplinking in your app. This is done by choosing a desired **unique scheme name**. You'll assign it to the activity you want to launch once your app opens following a user selecting the tracker URL in the`AndroidManifest.xml` file. Add the `intent-filter` section to your desired activity definition in the manifest file and assign an `android:scheme` property value with the desired scheme name: - -```xml - - - - - - - - - - - - - - -``` - -If you want your app to launch once the tracker URL is selected, use the assigned scheme name in the Adjust tracker URL's `deep_link` parameter. A tracker URL without any information added to the deeplink could look something like this: - -``` -https://app.adjust.com/abc123?deep_link=adjustExample%3A%2F%2F -``` - -Don't forget: **you must url encode** the `deep_link` parameter value in the URL. - -With the app set as described above, your app will launch along with the `MainActivity` intent when a user selects the tracker URL. Inside the `MainActivity` class, you will automatically receive the information about the `deep_link` parameter content. Once you receive this content, it will **not** be encoded (even though it was encoded in the URL). - -The activity setting of your `android:launchMode` within the `AndroidManifest.xml` file will determine the delivery location of the `deep_link` parameter content within the activity file. For more information about the possible values of the `android:launchMode` property, check out Android's [official documentation][android-launch-modes]. - -Deeplink content information within your desired activity is delivered via the `Intent` object, via either the activity's `onCreate` or `onNewIntent` methods. Once you've launched your app and have triggered one of these methods, you will be able to receive the actual deeplink passed in the `deep_link` parameter in the click URL. You can then use this information to conduct some additional logic in your app. - -You can extract deeplink content from either two methods like so: - -```java -@Override -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - // data.toString() -> This is your deep_link parameter value. -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - // data.toString() -> This is your deep_link parameter value. -} -``` - -### Deferred deep linking scenario - -Deferred deeplinking scenario occurs when a user clicks on an Adjust tracker URL with a `deep_link` parameter contained in it, but does not have the app installed on the device at click time. When the user clicks the URL, they will be redirected to the Play Store to download and install your app. After opening it for the first time, `deep_link` parameter content will be delivered to your app. - -The Adjust SDK opens the deferred deep link by default. There is no extra configuration needed. - -#### Deferred deep linking callback - -If you wish to control if the Adjust SDK will open the deferred deep link, you can do it with a callback method in the config object. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Evaluate the deeplink to be launched. -config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - // ... - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; - } - } -}); - -Adjust.onCreate(config); -``` - -After the Adjust SDK receives the deep link information from our backend, the SDK will deliver you its content via the listener and expect the `boolean` return value from you. This return value represents your decision on whether or not the Adjust SDK should launch the activity to which you have assigned the scheme name from the deeplink (like in the standard deeplinking scenario). - -If you return `true`, we will launch it, triggering the scenario described in the [Standard deep linking scenario](#dl-standard) chapter. If you do not want the SDK to launch the activity, return `false` from the listener, and (based on the deep link content) decide on your own what to do next in your app. -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setDeferredDeeplinkCallback(function (deeplink) {}); - -Adjust.onCreate(adjustConfig); -``` - -In this deferred deep linking scenario, there is one additional setting you can set on the config object. Once the Adjust SDK gets the deferred deep link information, you have the possibility to choose whether our SDK opens the URL or not. Set this option by calling the `setOpenDeferredDeeplink` method on the config object: - -```js -// ... - -function deferredDeeplinkCallback(deeplink) {} - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setOpenDeferredDeeplink(true); -adjustConfig.setDeferredDeeplinkCallback(deferredDeeplinkCallback); - -Adjust.start(adjustConfig); - -``` - -Remember that if you do not set the callback, **the Adjust SDK will always attempt to launch the URL by default**. -
- -### Reattribution via deeplinks - -Adjust enables you to run re-engagement campaigns with deeplinks. For more information, please check our [official docs][reattribution-with-deeplinks]. - -If you are using this feature, you need to make one additional call to the Adjust SDK in your app for us to properly reattribute your users. - -Once you have received the deeplink content in your app, add a call to the `Adjust.appWillOpenUrl(Uri, Context)` method. By making this call, the Adjust SDK will send information to the Adjust backend to check if there is any new attribution information inside of the deeplink. If your user is reattributed due to a click on the Adjust tracker URL with deeplink content, you will see the [attribution callback](#af-attribution-callback) triggered in your app with new attribution info for this user. - -Here's how the call to `Adjust.appWillOpenUrl(Uri, Context)` should look: - -```java -@Override -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -**Note**: `Adjust.appWillOpenUrl(Uri)` method is marked as **deprecated** as of Android SDK v4.14.0. Please use `Adjust.appWillOpenUrl(Uri, Context)` method instead. - -**Note for web view**: This call can also be made from the web view with the function `Adjust.appWillOpenUrl` in Javascript like so: - -```js -Adjust.appWillOpenUrl(deeplinkUrl); -``` - -### Link resolution - -If you are serving deep links from an Email Service Provider (ESP) and need to track clicks through a custom tracking link, you can use the `resolveLink` method of the `AdjustLinkResolution` class to resolve the link. This ensures that you record the interaction with your email tracking campaigns when a deep link is opened in your application. - -The `resolveLink` method takes the following parameters: - -- `url` - the deep link that opened the application -- `resolveUrlSuffixArray` - the custom domains of the configured campaigns that need to be resolved -- `adjustLinkResolutionCallback` - the callback that will contain the final URL - -If the link received does not belong to any of the domains specified in the `resolveUrlSuffixArray`, the callback will forward the deep link URL as is. If the link does contain one of the domains specified, the SDK will attempt to resolve the link and return the resulting deep link to the `callback` parameter. The returned deep link can also be reattributed in the Adjust SDK using the `Adjust.appWillOpenUrl` method. - -> **Note**: The SDK will automatically follow up to ten redirects when attempting to resolve the URL. It will return the latest URL it has followed as the `callback` URL, meaning that if there are more than ten redirects to follow the **tenth redirect URL** will be returned. - -**Example** - -```java -AdjustLinkResolution.resolveLink(url, - new String[]{"example.com"}, - new AdjustLinkResolution.AdjustLinkResolutionCallback() { - @Override - public void resolvedLinkCallback(Uri resolvedLink) { - Adjust.appWillOpenUrl(resolvedLink, getApplicationContext()); - } -}); -``` - -## Event tracking - -### Track event - -You can use Adjust to track any event in your app. Suppose you want to track every tap on a button. To do so, you'll create a new event token in your [dashboard]. Let's say that the event token is `abc123`. In your button's `onClick` method, add the following lines to track the click: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` -
- -### Track revenue - -If your users can generate revenue by tapping on advertisements or making in-app purchases, you can track those revenues too with events. Let's say a tap is worth one Euro cent. You can track the revenue event like this: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01, 'EUR'); -Adjust.trackEvent(adjustEvent); -``` -
- -This can be combined with callback parameters. - -When you set a currency token, Adjust will automatically convert the incoming revenues into a reporting revenue of your choice. Read more about [currency conversion ][currency-conversion] here. - -If you want to track in-app purchases, please make sure to call `trackEvent` only if the purchase is finished and the item has been purchased. This is important in order avoid tracking revenue that was not actually generated. - -You can read more about revenue and event tracking at Adjust in the [event tracking guide][event-tracking]. - -### Revenue deduplication - -You can also add an optional order ID to avoid tracking duplicate revenues. By doing so, the last ten order IDs will be remembered and revenue events with duplicate order IDs are skipped. This is especially useful for tracking in-app purchases. You can see an example below. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -adjustEvent.setOrderId("{OrderId}"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01, 'EUR'); -adjustEvent.setOrderId('{OrderId}'); -Adjust.trackEvent(event); -``` -
- -## Custom parameters - -### Custom parameters overview - -In addition to the data points the Adjust SDK collects by default, you can use the Adjust SDK to track and add as many custom values as you need (user IDs, product IDs, etc.) to the event or session. Custom parameters are only available as raw data and will **not** appear in your Adjust dashboard. - -You should use **callback parameters** for the values you collect for your own internal use, and **partner parameters** for those you share with external partners. If a value (e.g. product ID) is tracked both for internal use and external partner use, we recommend you track it with both callback and partner parameters. - - -### Event parameters - -### Event callback parameters - -You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the event is tracked. You can add callback parameters to that event by calling `addCallbackParameter` to the event instance before tracking it. We will then append these parameters to your callback URL. - -For example, if you've registered the URL `http://www.example.com/callback`, then you would track an event like this: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addCallbackParameter("key", "value"); -adjustEvent.addCallbackParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addCallbackParameter('key', 'value'); -adjustEvent.addCallbackParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -In this case we would track the event and send a request to: - -``` -http://www.example.com/callback?key=value&foo=bar -``` - -Adjust supports a variety of placeholders, for example `{gps_adid}`, which can be used as parameter values. In the resulting callback, we would replace the placeholder (in this case) with the Google Play Services ID of the current device. Please note that we don't store any of your custom parameters. We **only** append them to your callbacks. If you haven't registered a callback for an event, we will not even read these parameters. - -You can read more about URL callbacks (including a full list of available values) in our [callbacks guide][callbacks-guide]. - -### Event partner parameters - -When your parameters are activated in the Adjust dashboard, you have the option to transmit them to your network partners. - -This works similarly to the callback parameters mentioned above; add them by calling the `addPartnerParameter` method to your event instance. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addPartnerParameter("key", "value"); -adjustEvent.addPartnerParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addPartnerParameter('key', 'value'); -adjustEvent.addPartnerParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -You can read more about special partners and these integrations in our [guide to special partners][special-partners]. - -### Event callback identifier - -You can add custom string identifiers to each event you want to track. This identifier will later be reported in your event success and/or event failure callbacks. This lets you keep track of which event was successfully tracked. Set this identifier by calling the `setCallbackId` method on your event instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setCallbackId("Your-Custom-Id"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setCallbackId('Your-Custom-Id'); -Adjust.trackEvent(adjustEvent); -``` -
- -### Session parameters - -Session parameters are saved locally and sent in every **event** and **session** of the Adjust SDK. When you add any of these parameters, we will save them so you don't need to add them every time. Adding the same parameter twice will have no effect. - -These session parameters can be called before the Adjust SDK is launched (to make sure they are sent on install). If you need to send them with an install, but can only obtain the needed values after launch, it's possible to [delay](#delay-start) the first launch of the Adjust SDK to allow for this behavior. - -### Session callback parameters - -You can save any callback parameters registered for [events](#event-callback-parameters) to be sent in every event or session of the Adjust SDK. - -The session callback parameters' interface is similar to the one for event callback parameters. Instead of adding the key and its value to an event, add them via a call to `Adjust.addSessionCallbackParameter(String key, String value)`: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.addSessionCallbackParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` -
- -Session callback parameters merge together with the callback parameters you add to an event. Callback parameters added to an event take precedence over session callback parameters, meaning that if you add a callback parameter to an event with the same key to one added from the session, the value that prevails is the callback parameter added to the event. - -It's possible to remove a specific session callback parameter by passing the desired key to the method: `Adjust.removeSessionCallbackParameter(String key)`. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.removeSessionCallbackParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionCallbackParameter('foo'); -``` -
- -If you wish to remove all keys and their corresponding values from the session callback parameters, you can reset with the method `Adjust.resetSessionCallbackParameters()`. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.resetSessionCallbackParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionCallbackParameters(); -``` -
- -### Session partner parameters - -In the same way that [session callback parameters](#session-callback-parameters) are sent in every event or session of the Adjust SDK, there are also session partner parameters. - -These are transmitted to network partners for all of the integrations activated in your Adjust [dashboard]. - -The session partner parameters interface is similar to the event partner parameters interface. Instead of adding the key and its value to an event, add it by calling `Adjust.addSessionPartnerParameter(String key, String value)`: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.addSessionPartnerParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionPartnerParameter('foo', 'bar'); -``` -
- -The session partner parameters will be merged with the partner parameters added to an event. The partner parameters added to an event take precedence over the session partner parameters. This means that when adding a partner parameter to an event with the same key to one added from the session, the value that prevails is the partner parameter added to the event. - -It's possible to remove a specific session partner parameter by passing the desiring key to the method `Adjust.removeSessionPartnerParameter(String key)`. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.removeSessionPartnerParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionPartnerParameter('foo'); -``` -
- -If you wish to remove all keys and their corresponding values from the session partner parameters, reset it with the method `Adjust.resetSessionPartnerParameters()`. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.resetSessionPartnerParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionPartnerParameters(); -``` -
- -### Delay start - -Delaying the start of the Adjust SDK allows your app some time to obtain session parameters (such as unique identifiers) to be sent on install. - -Set the initial delay time in seconds with the method `setDelayStart` in the config instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
-Web View SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
- -In this example, this will prevent the Adjust SDK from sending the initial install session and any event created for 5.5 seconds. After the time expireds (or if you call `Adjust.sendFirstPackages()` during that time) every session parameter will be added to the delayed install session and events; the Adjust SDK will resume as usual. - -**The maximum delay start time of the adjust SDK is 10 seconds**. - - -## Additional features - -Once you have integrated the Adjust SDK into your project, you can take advantage of the following features: - -### Push token (uninstall tracking) - -Push tokens are used for Audience Builder and client callbacks; they are also required for uninstall and reinstall tracking. - -To send us the push notification token, add the following call to Adjust once you have obtained your token (or whenever its value changes): - - - - - - - - - - - - - - -
-Native SDK -
- -```java -Adjust.setPushToken(pushNotificationsToken, context); -``` - -This updated signature with `context` added allows the SDK to cover more scenarios to make sure the push token is sent. It is advised that you use the signature method above. - -We do, however, still support the previous signature of the same method without the `context`. - -
-Web View SDK -
- -```js -Adjust.setPushToken(pushNotificationsToken); -``` -
- -### Attribution callback - -You can register a listener to be notified of tracker attribution changes. Due to the different sources we consider for attribution, we cannot provide this information synchronously. - -Please see our [attribution data policies][attribution-data] for more information. - -With the config instance, add the attribution callback before you start the SDK: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) {} -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function attributionCallback(attribution) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAttributionCallback(attributionCallback); -Adjust.onCreate(adjustConfig); -``` -
- -The listener function is called after the SDK receives the final attribution data. Within the listener function, you'll have access to the `attribution` parameter. Here is a quick summary of its properties: - -- `trackerToken` the tracker token string of the current attribution. -- `trackerName` the tracker name string of the current attribution. -- `network` the network grouping level string of the current attribution. -- `campaign` the campaign grouping level string of the current attribution. -- `adgroup` the ad group grouping level string of the current attribution. -- `creative` the creative grouping level string of the current attribution. -- `clickLabel` the click label string of the current attribution. -- `adid` the Adjust device identifier string. -- `costType` the cost type string. -- `costAmount` the cost amount. -- `costCurrency` the cost currency string. - -**Note**: The cost data - `costType`, `costAmount` & `costCurrency` are only available when configured in `AdjustConfig` by calling `setNeedsCost` method. If not configured or configured, but not being part of the attribution, these fields will have value `null`. This feature is available in SDK v4.25.0 and above. - -### Subscription tracking - -**Note**: This feature is only available in the native SDK v4.22.0 and above. - -You can track Play Store subscriptions and verify their validity with the Adjust SDK. After a subscription has been successfully purchased, make the following call to the Adjust SDK: - - - - - - - - -
-Native App SDK -
- -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` -
- -Subscription tracking parameters: - -- [price](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros) -- [currency](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode) -- [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku) -- [orderId](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid) -- [signature](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsignature) -- [purchaseToken](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetoken) -- [purchaseTime](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetime) - -Just like with event tracking, you can attach callback and partner parameters to the subscription object as well: - -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -// add callback parameters -subscription.addCallbackParameter("key", "value"); -subscription.addCallbackParameter("foo", "bar"); - -// add partner parameters -subscription.addPartnerParameter("key", "value"); -subscription.addPartnerParameter("foo", "bar"); - -Adjust.trackPlayStoreSubscription(subscription); -``` - -### Ad revenue tracking - -**Note**: This ad revenue tracking API is available only in the native SDK v4.28.0 and above. - -You can track ad revenue information with Adjust SDK by invoking the following method: - - - - - - - - -
-Native App SDK -
- -```java -Adjust.trackAdRevenue(adjustAdRevenue); -``` -
- -where `adjustAdRevenue` represents instance of `AdjustAdRevenue` class which is used to pass ad revenue source as well as other ad revenue related info. - -Currently we support the below `source` parameter values: - -- `AdjustConfig.AD_REVENUE_APPLOVIN_MAX` - representing AppLovin MAX platform. -- `AdjustConfig.AD_REVENUE_MOPUB` - representing MoPub platform. -- `AdjustConfig.AD_REVENUE_ADMOB` - representing AdMob platform. -- `AdjustConfig.AD_REVENUE_IRONSOURCE` - representing IronSource platform. -- `AdjustConfig.AD_REVENUE_ADMOST` - representing AdMost platform. -- `AdjustConfig.AD_REVENUE_UNITY` - representing Unity platform. -- `AdjustConfig.AD_REVENUE_HELIUM_CHARTBOOST` - representing Helium Chartboost platform. -- `AdjustConfig.AD_REVENUE_SOURCE_PUBLISHER` - representing Generic platform. - -**Note**: Additional documentation which explains detailed integration with every of the supported sources will be provided outside of this README. Also, in order to use this feature, additional setup is needed for your app in Adjust dashboard, so make sure to get in touch with our support team to make sure that everything is set up correctly before you start to use this feature. - -### Session and event callbacks - -You can register a listener to be notified when events or sessions are tracked. There are four listeners: one for tracking successful events, one for tracking failed events, one for tracking successful sessions, and one for tracking failed sessions. Add as many listeners as you need after creating the config object like so: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Set event success tracking delegate. -config.setOnEventTrackingSucceededListener(new OnEventTrackingSucceededListener() { - @Override - public void onFinishedEventTrackingSucceeded(AdjustEventSuccess eventSuccessResponseData) { - // ... - } -}); - -// Set event failure tracking delegate. -config.setOnEventTrackingFailedListener(new OnEventTrackingFailedListener() { - @Override - public void onFinishedEventTrackingFailed(AdjustEventFailure eventFailureResponseData) { - // ... - } -}); - -// Set session success tracking delegate. -config.setOnSessionTrackingSucceededListener(new OnSessionTrackingSucceededListener() { - @Override - public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess sessionSuccessResponseData) { - // ... - } -}); - -// Set session failure tracking delegate. -config.setOnSessionTrackingFailedListener(new OnSessionTrackingFailedListener() { - @Override - public void onFinishedSessionTrackingFailed(AdjustSessionFailure sessionFailureResponseData) { - // ... - } -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function eventSuccessCallback(eventSuccessResponseData) {} -function eventFailureCallback(eventFailureResponseData) {} -function sessionSuccessCallback(sessionSuccessResponseData) {} -function sessionFailureCallback(sessionFailureResponseData) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setEventSuccessCallback(eventSuccessCallback); -adjustConfig.setEventFailureCallback(eventFailureCallback); -adjustConfig.setSessionSuccessCallback(sessionSuccessCallback); -adjustConfig.setSessionFailureCallback(sessionFailureCallback); -Adjust.onCreate(adjustConfig); -``` -
- -The listener function is called after the SDK tries to send a package to the server. Within the listener function you have access to a response data object specifically for the listener. Here is a quick summary of the success session response data object fields: - -- `message` message string from the server (or the error logged by the SDK). -- `timestamp` timestamp string from the server. -- `adid` a unique string device identifier provided by Adjust. -- `jsonResponse` the JSON object with the reponse from the server. - -Both event response data objects contain: - -- `eventToken` the event token string, if the package tracked was an event. -- `callbackId` the custom defined [callback ID](#cp-event-callback-id) string set on the event object. - -And both event and session failed objects also contain: - -- `willRetry` boolean which indicates whether there will be a later attempt to resend the package. - -### User attribution - -Like we described in the [attribution callback section](#af-attribution-callback), this callback is triggered whenever the attribution information changes. Access your user's current attribution information whenever you need it by making a call to the following method of the `Adjust` instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustAttribution attribution = Adjust.getAttribution(); -``` -
-Web View SDK -
- -```js -let attribution = Adjust.getAttribution(); -``` -
- -**Note**: You can only make this call using the Adjust SDK v4.11.0 or **above**. - -**Note**: Current attribution information is only available after our backend tracks the app install and triggers the attribution callback. **It is not possible** to access a user's attribution value before the SDK has been initialized and the attribution callback has been triggered. - -### Device IDs - -The Adjust SDK offers you the possibility to obtain device identifiers. - -### Google Play Services Advertising Identifier - -The Google Play Services Advertising Identifier (Google advertising ID) is a unique identifier for a device. Users can opt out of sharing their Google advertising ID by toggling the "Opt out of Ads Personalization" setting on their device. When a user has enabled this setting, the Adjust SDK returns a string of zeros when trying to read the Google advertising ID. - -> **Important**: If you are targeting Android 12 and above (API level 31), you need to add the [`com.google.android.gms.AD_ID` permission](#gps-adid-permission) to your app. If you do not add this permission, you will not be able to read the Google advertising ID even if the user has not opted out of sharing their ID. - -Certain services (such as Google Analytics) require you to coordinate advertising IDs and client IDs in order to prevent duplicate reporting. - - - - - - - - - - - - - - -
-Native App SDK -
- -If you need to obtain the Google Advertising ID, there is a restriction; it can only be read in a background thread. If you call the function `getGoogleAdId` with the context and a `OnDeviceIdsRead` instance, it will work in any situation: - -```java -Adjust.getGoogleAdId(this, new OnDeviceIdsRead() { - @Override - public void onGoogleAdIdRead(String googleAdId) {} -}); -``` -
-Web View SDK -
- -To obtain the device's Google Advertising device identifier, it's necessary to pass a callback function to `Adjust.getGoogleAdId` which will receive the Google Advertising ID in its argument, like so: - -```js -Adjust.getGoogleAdId(function(googleAdId) { - // ... -}); -``` -
- -### Amazon advertising identifier - -If you need to obtain the Amazon Advertising ID, call the following method on `Adjust` instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -String amazonAdId = Adjust.getAmazonAdId(context); -``` -
-Web View SDK -
- -```js -let amazonAdId = Adjust.getAmazonAdId(); -``` -
- -### Adjust device identifier - -For each device with your app installed on it, our backend generates a unique **Adjust device identifier** (known as an **adid**). In order to obtain this identifier, call the following method on `Adjust` instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -String adid = Adjust.getAdid(); -``` -
-Web View SDK -
- -```js -let adid = Adjust.getAdid(); -``` -
- -**Note**: You can only make this call in the Adjust SDK in v4.11.0 and **above**. - -**Note**: Information about the **adid** is only available after our backend tracks the app instal. **It is not possible** to access the **adid** value before the SDK has been initialized and the installation of your app has been successfully tracked. - -### Preinstalled apps - -You can use the Adjust SDK to recognize users whose devices had your app preinstalled during manufacturing. Adjust offers two solutions: one which uses the system payload, and one which uses a default tracker. - -In general, we recommend using the system payload solution. However, there are certain use cases which may require the tracker. First check the available [implementation methods](https://help.adjust.com/en/article/pre-install-tracking#Implementation_methods) and your preinstall partner’s preferred method. If you are unsure which solution to implement, reach out to integration@adjust.com - -#### Use the system payload - -- The Content Provider, System Properties, or File System method is supported from SDK v4.23.0 and above. - -- The System Installer Receiver method is supported from SDK v4.27.0 and above. - -Enable the Adjust SDK to recognise preinstalled apps by calling `setPreinstallTrackingEnabled` with the parameter `true` after creating the config object: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
- -Depending upon your implmentation method, you may need to make a change to your AndroidManifest.xml file. Find the required code change using the table below. - - - - - - - - - - - - - - -
- Method - - AndroidManifest.xml change -
Content ProviderAdd permission:
- -``` - -``` -
System Installer ReceiverDeclare receiver:
- -```xml - - - - - -``` -
- -#### Use a default tracker - -- Create a new tracker in your [dashboard]. -- Open your app delegate and set the default tracker of your config: - - - - - - - - - - - - - - -
- Native App SDK -
- - ```java - adjustConfig.setDefaultTracker("{TrackerToken}"); - ``` -
- Web View SDK -
- - ```js - adjustConfig.setDefaultTracker('{TrackerToken}'); - ``` -
- -- Replace `{TrackerToken}` with the tracker token you created in step one. Please note that the dashboard displays a tracker URL (including `http://app.adjust.com/`). In your source code, you should specify only the six or seven-character token and not the entire URL. - -- Build and run your app. You should see a line like the following in your LogCat: - - ``` - Default tracker: 'abc123' - ``` - -### Offline mode - -You can put the Adjust SDK in offline mode to suspend transmission to our servers (while retaining tracked data to be sent later). While in offline mode, all information is saved in a file. Please be careful not to trigger too many events while in offline mode. - -Activate offline mode by calling `setOfflineMode` with the parameter `true`. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.setOfflineMode(true); -``` -
-Web View SDK -
- -```js -Adjust.setOfflineMode(true); -``` -
- -Conversely, you can deactivate offline mode by calling `setOfflineMode` with `false`. When the Adjust SDK is put back into online mode, all saved information is sent to our servers with the correct time information. - -Unlike disabling tracking, this setting is **not remembered** between sessions. This means the SDK is in online mode whenever it starts, even if the app was terminated in offline mode. - - -### Disable tracking - -You can disable the Adjust SDK from tracking any activities of the current device by calling `setEnabled` with parameter `false`. **This setting is remembered between sessions**. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.setEnabled(false); -``` -
-Web View SDK -
- -```js -Adjust.setEnabled(false); -``` -
- -You can check to see if the Adjust SDK is currently enabled by calling the function `isEnabled`. It is always possible to activatе the Adjust SDK by invoking `setEnabled` with the enabled parameter as `true`. - -### Event buffering - -If your app makes heavy use of event tracking, you might want to delay some network requests in order to send them in one batch every minute. You can enable event buffering with your config instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setEventBufferingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setEventBufferingEnabled(true); -``` -
- -### Background tracking - -The default behaviour of the Adjust SDK is to pause sending network requests while the app is in the background. You can change this in your config instance: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setSendInBackground(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setSendInBackground(true); -``` -
- -### GDPR right to be forgotten - -In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten. Calling the following method will instruct the Adjust SDK to communicate the user's choice to be forgotten to the Adjust backend: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.gdprForgetMe(context); -``` -
-Web View SDK -
- -```js -Adjust.gdprForgetMe(); -``` -
- -Upon receiving this information, Adjust will erase the user's data and the Adjust SDK will stop tracking the user. No requests from this device will be sent to Adjust in the future. - -Please note that even when testing, this decision is permanent. It **is not** reversible. - -## Third-party sharing for specific users - -You can notify Adjust when a user disables, enables, and re-enables data sharing with third-party partners. - -### Disable third-party sharing for specific users - -Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -Upon receiving this information, Adjust will block the sharing of that specific user's data to partners and the Adjust SDK will continue to work as usual. - -### Enable or re-enable third-party sharing for specific users - -Call the following method to instruct the Adjust SDK to communicate the user's choice to share data or change data sharing, to the Adjust backend: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected. - -Call the following method to instruct the Adjust SDK to send the granular options to the Adjust backend: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -### Consent measurement for specific users - -To enable or disable the Data Privacy settings in the Adjust Dashboard, including the consent expiry period and the user data retention period, you need to implement the below method. - -Call the following method to instruct the Adjust SDK to communicate the Data Privacy settings, to the Adjust backend: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.trackMeasurementConsent(true); -``` -
-Web View SDK -
- -```js -Adjust.trackMeasurementConsent(true); -``` -
- -Upon receiving this information, Adjust enables or disables consent measurement. The Adjust SDK will continue to work as expected. - -### Data residency - -In order to enable data residency feature, make sure to make a call to `setUrlStrategy` method of the `AdjustConfig` instance with one of the following constants: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_EU); // for EU data residency region -adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_TR); // for Turkey data residency region -adjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_US); // for US data residency region -``` -
-Web View SDK -
- -```js -adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyEU); // for EU data residency region -adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyTR); // for Turkey data residency region -adjustConfig.setUrlStrategy(AdjustConfig.DataResidencyUS); // for US data residency region -``` -
- -**Note:** Please, do not turn this setting on before making sure with the support team that this feature is enabled for your app because otherwise SDK traffic will get dropped. - -### COPPA compliance - -By deafult Adjust SDK doesn't mark app as COPPA compliant. In order to mark your app as COPPA compliant, make sure to call `setCoppaCompliantEnabled` method of `AdjustConfig` instance with boolean parameter `true`: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setCoppaCompliantEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setCoppaCompliantEnabled(true); -``` -
- -**Note:** By enabling this feature, third-party sharing will be automatically disabled for the users. If later during the app lifetime you decide not to mark app as COPPA compliant anymore, third-party sharing **will not be automatically re-enabled**. Instead, next to not marking your app as COPPA compliant anymore, you will need to explicitly re-enable third-party sharing in case you want to do that. - -### Play Store Kids Apps - -By default Adjust SDK doesn't mark app as Play Store Kids App. In order to mark your app as the app which is targetting kids in Play Store, make sure to call `setPlayStoreKidsAppEnabled` method of `AdjustConfig` instance with boolean parameter `true`: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setPlayStoreKidsAppEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setPlayStoreKidsAppEnabled(true); -``` -
- -## Testing and troubleshooting - -### I'm seeing the "Session failed (Ignoring too frequent session. ...)" error. - -This error typically occurs when testing installs. Uninstalling and reinstalling the app is not enough to trigger a new install. The servers will determine that the SDK has lost its locally aggregated session data and ignore the erroneous message, given the information available on the servers about the device. - -This behavior can be cumbersome during testing, but is necessary in order to have the sandbox behavior match production as much as possible. - -You can reset your app's session data for any device directly from the Adjust Dashboard using our [Testing Console][testing_console] if you have Editor-level access (or higher) to the app. - -Once the device has been correctly forgotten, the Testing Console will return `Forgot device`. If the device was already forgotten (or if the values were incorrect) the link will return `Advertising ID not found`. - -Forgetting the device will not reverse the GDPR forget call. - -If your current package gives you access, you can also inspect and forget a device using our [Developer API][dev_api]. - -### Is my broadcast receiver capturing the install referrer? - -If you followed the instructions in the [guide](#qs-gps-intent), the broadcast receiver should be configured to send the install referrer to our SDK and to our servers. - -You can test this by manually triggering a test install referrer. Replace `com.your.appid` with your app ID and run the following command with the [adb](http://developer.android.com/tools/help/adb.html) tool that comes with Android Studio: - -``` -adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver --es "referrer" "adjust_reftag%3Dabc1234%26tracking_id%3D123456789%26utm_source%3Dnetwork%26utm_medium%3Dbanner%26utm_campaign%3Dcampaign" -``` - -If you already use a different broadcast receiver for the `INSTALL_REFERRER` intent and followed this [guide][referrer], replace `com.adjust.sdk.AdjustReferrerReceiver` with your broadcast receiver. - -You can also remove the `-n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver` parameter so that all the apps in the device will receive the `INSTALL_REFERRER` intent. - -If you set the log level to `verbose`, you should be able to see the log from reading the referrer: - -``` -V/Adjust: Referrer to parse (adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign) from reftag -``` - -And a click package added to the SDK's package handler: - -``` -V/Adjust: Path: /sdk_click - ClientSdk: android4.6.0 - Parameters: - app_token abc123abc123 - click_time yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - created_at yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - environment sandbox - gps_adid 12345678-0abc-de12-3456-7890abcdef12 - needs_attribution_data 1 - referrer adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign - reftag abc1234 - source reftag - tracking_enabled 1 -``` - -If you perform this test before launching the app, you won't see the package being sent. The package will be sent once the app is launched. - -**Important:** We encourage you to **not** use the `adb` tool for testing this particular feature. In order to test your full referrer content (in case you have multiple parameters separated with `&`), with `adb` you will need to encode that content in order to get it into your broadcast receiver. If you don't encode it, `adb` will cut your referrer after the first `&` sign and deliver wrong content to your broadcast receiver. - -If you would like to see how your app receives an unencoded referrer value, we would encourage you to try our example app and alter the content being passed so that it fires with intent inside of the `onFireIntentClick` method inside of the `MainActivity.java` file: - -```java -public void onFireIntentClick(View v) { - Intent intent = new Intent("com.android.vending.INSTALL_REFERRER"); - intent.setPackage("com.adjust.examples"); - intent.putExtra("referrer", "utm_source=test&utm_medium=test&utm_term=test&utm_content=test&utm_campaign=test"); - sendBroadcast(intent); -} -``` - -Feel free to alter the second parameter of `putExtra` method with content of your choice. - -### Can I trigger an event at application launch? - -Triggering an event at this time might not do what you expect. Here's why: - -The `onCreate` method on the global `Application` class is called not only at application launch, but also when a system or application event is captured by the app. - -Our SDK is prepared for initialization at this time, but has not actually started. This will only happen when an activity takes place, i.e., when a user actually launches the app. - -Triggering an event at this time would start the Adjust SDK and send the events, even though the app was not launched by the user - at a time that depends on factors external to the app. - -Triggering events at application launch will thus result in inaccuracies in the number of installs and sessions tracked. - -If you want to trigger an event after the install, use the [attribution callback](#af-attribution-callback). - -If you want to trigger an event when the app is launched, use the `onCreate` method for the given activity. - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[en-readme]: README.md -[zh-readme]: doc/chinese/README.md -[ja-readme]: doc/japanese/README.md -[ko-readme]: doc/korean/README.md +Distributed under the [MIT license](https://opensource.org/licenses/MIT). See [`MIT-LICENSE`](MIT-LICENSE) for the full text. [en-helpcenter]: https://help.adjust.com/en/developer/android-sdk-documentation [zh-helpcenter]: https://help.adjust.com/zh/developer/android-sdk-documentation [ja-helpcenter]: https://help.adjust.com/ja/developer/android-sdk-documentation [ko-helpcenter]: https://help.adjust.com/ko/developer/android-sdk-documentation - -[example-java]: Adjust/example-app-java -[example-kotlin]: Adjust/example-app-kotlin -[example-keyboard]: Adjust/example-app-keyboard -[example-tv]: Adjust/example-app-tv -[example-webbridge]: Adjust/example-app-webbridge - -[maven]: http://maven.org -[referrer]: doc/english/misc/multiple-receivers.md -[releases]: https://github.com/adjust/android_sdk/releases -[google-ad-id]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en -[event-tracking]: https://docs.adjust.com/en/event-tracking -[callbacks-guide]: https://docs.adjust.com/en/callbacks -[new-referrer-api]: https://developer.android.com/google/play/installreferrer/library.html -[special-partners]: https://docs.adjust.com/en/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[android-dashboard]: http://developer.android.com/about/dashboards/index.html -[currency-conversion]: https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies -[android-application]: http://developer.android.com/reference/android/app/Application.html -[android-launch-modes]: https://developer.android.com/guide/topics/manifest/activity-element.html -[google-play-services]: http://developer.android.com/google/play-services/setup.html -[reattribution-with-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[android-purchase-verification]: https://github.com/adjust/android_purchase_sdk -[testing_console]: https://docs.adjust.com/en/testing-console/#how-to-clear-your-advertising-id-from-adjust-between-tests -[dev_api]: https://docs.adjust.com/en/adjust-for-developers/ - -[sdk2sdk-mopub]: doc/english/sdk-to-sdk/mopub.md - -## License - -The Adjust SDK is licensed under the MIT License. - -Copyright (c) 2012-2019 Adjust GmbH, http://www.adjust.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/doc/chinese/README.md b/doc/chinese/README.md deleted file mode 100644 index 38dd49955..000000000 --- a/doc/chinese/README.md +++ /dev/null @@ -1,2298 +0,0 @@ -**该指南即将过期。** - -该自述文件即将过期。现在,您可以前往我们的帮助中心查看此 SDK 文档。 - -* [English][en-helpcenter] -* [中文][zh-helpcenter] -* [日本語][ja-helpcenter] -* [한국어][ko-helpcenter] - -## 摘要 - -这是 Adjust™ 的安卓 SDK 包。您可以在 [adjust.com] 了解更多有关 Adjust™ 的信息。 - -阅读本文的其他语言版本:[English][en-readme]、[中文][zh-readme]、[日本語][ja-readme]、[한국어][ko-readme]。 - -## 目录 - -### 快速入门 - - * [应用示例](#qs-example-apps) - * [入门指南](#qs-getting-started) - * [添加 SDK 至您的项目](#qs-add-sdk) - * [添加 Google Play 服务](#qs-gps) - * [添加权限](#qs-permissions) - * [Proguard 设置](#qs-proguard) - * [Install referrer](#qs-install-referrer) - * [Google Play Referrer API](#qs-gpr-api) - * [Google Play Store intent](#qs-gps-intent) - * [华为 Referrer API](#qs-huawei-referrer-api) - * [集成 SDK 至您的应用](#qs-integrate-sdk) - * [基本设置](#qs-basic-setup) - * [原生应用 SDK](#qs-basic-setup-native) - * [Web Views SDK](#qs-basic-setup-web) - * [会话跟踪](#qs-session-tracking) - * [API level 14 及以上版本](#qs-session-tracking-api-14) - * [API level 9 - 13 版本](#qs-session-tracking-api-9) - * [SDK 签名](#qs-sdk-signature) - * [Adjust 日志记录](#qs-adjust-logging) - * [构建您的应用](#qs-build-the-app) - -### 深度链接 - - * [深度链接概览](#dl) - * [标准深度链接场景](#dl-standard) - * [延迟深度链接场景](#dl-deferred) - * [通过深度链接的再归因](#dl-reattribution) - * [链接解析](#link-resolution) - -### 事件跟踪 - - * [跟踪事件](#et-tracking) - * [跟踪收入](#et-revenue) - * [收入重复数据删除](#et-revenue-deduplication) - * [应用收入验证](#et-purchase-verification) - -### 自定义参数 - - * [自定义参数概览](#cp) - * [事件参数](#cp-event-parameters) - * [事件回传参数](#cp-event-callback-parameters) - * [事件合作伙伴参数](#cp-event-partner-parameters) - * [事件回传标识符](#cp-event-callback-id) - * [会话参数](#cp-session-parameters) - * [会话回传参数](#cp-session-callback-parameters) - * [会话合作伙伴参数](#cp-session-partner-parameters) - * [延迟启动](#cp-delay-start) - -### 其他功能 - - * [推送标签 (卸载跟踪)](#af-push-token) - * [归因回传](#af-attribution-callback) - * [广告收入跟踪](#af-ad-revenue) - * [订阅跟踪](#af-subscriptions) - * [会话与事件回传](#af-session-event-callbacks) - * [用户归因](#af-user-attribution) - * [设备 ID](#af-device-ids) - * [Google Play 服务广告 ID](#af-gps-adid) - * [Amazon 广告 ID](#af-amazon-adid) - * [Adjust 设备 ID](#af-adid) - * [预安装应用](#af-preinstalled-apps) - * [离线模式](#af-offline-mode) - * [禁用跟踪](#af-disable-tracking) - * [事件缓冲](#af-event-buffering) - * [后台跟踪](#af-background-tracking) - * [GDPR 被遗忘权](#af-gdpr-forget-me) - * [第三方分享](#af-third-party-sharing) - * [禁用第三方分享](#af-disable-third-party-sharing) - * [启用第三方分享](#af-enable-third-party-sharing) - * [许可监测](#af-measurement-consent) - -### 测试与故障排查 - - * [显示 "session failed (Ignoring too frequent session...)" 出错信息](#tt-session-failed) - * [我的广播接收器是否能成功获取 install referrer?](#tt-broadcast-receiver) - * [我能否在应用激活时触发事件?](#tt-event-at-launch) - -### 许可 - - -## 快速入门 - -### 应用示例 - -在 [`example-app-java`][example-java]、[`example-app-kotlin`][example-kotlin] 和 [`example-app-keyboard`][example-keyboard] 目录中,您可以找到安卓示例应用;在 [`example-webbridge` ][example-webbridge] 目录中,您可以找到使用 web view 的示例应用;[`example-app-tv`][example-tv] 目录中,您可以找到安卓 TV 示例应用。您可以打开安卓项目查看这些示例,了解如何集成 Adjust SDK。 - -### 快速入门 - -此处为将 Adjust SDK 集成进安卓应用时需进行的最低要求步骤。我们假定您使用 Android Studio 进行安卓开发。Adjust SDK 集成支持的最低安卓 API 级别为 **9 (Gingerbread)**。 - -### 添加 SDK 至您的项目 - -如果您使用的是 Maven,请添加下行到您的 `build.gradle` 文件: - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -如果您想在应用 web view 中使用 Adjust SDK,请也添加下列附加依赖项: - -```gradle -implementation 'com.adjust.sdk:adjust-android-webbridge:4.31.0' -``` - -**请注意:** web view 扩展支持的最低安卓 API 级别为 17 (Jelly Bean)。 - -您还可以将 Adjust SDK 和 web view 扩展作为 JAR 文件来添加,这可从我们的[发布页面][releases]中下载。 - -### 添加 Google Play 服务 - -自 2014 年 8 月 1 日起,Google Play 商店中的应用必须使用 [Google 广告 ID] 来对设备进行唯一标识。为了让 Adjust SDK 能使用 Google 广告 ID,请务必集成 [Google Play 服务]。如果您尚未完成该集成,请将 dependency 加入 Google Play 服务库中,具体请将以下依赖项添加到应用 `build.gradle` 文件的 `dependencies` 块中: - -```gradle -implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' -``` - -**请注意**:Adjust SDK 未与 Google Play 服务库中 `play-services-analytics` 的任何特定版本绑定。您可以使用最新版本的库,也可以按需要使用任意其他版本。 - -### 添加权限 - -Adjust SDK 需要下列权限。如果尚未添加,请将权限加入您的 `AndroidManifest.xml` 文件中: - -```xml - - -``` - -如果您的**发布目标非 Google Play 商店**,请同时添加以下权限: - -```xml - -``` - -#### 添加收集 Google 广告 ID 的许可 - -如果您针对的是 Android 12 及更高版本 (API level 31),则需要添加`com.google.android.gms.AD_ID` 许可来读取设备的广告 ID。请将下列行添加至您的 `AndroidManifest.xml` 中,以启用许可。 - -```xml - -``` - -要了解更多信息,请参阅 [Google `AdvertisingIdClient.Info` 相关文档](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)。 - -### Proguard 设置 - -如果您使用的是 Proguard,请将如下代码行添加至您的 Proguard 文件: - -``` --keep class com.adjust.sdk.**{ *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } -``` - -如果您的**发布目标非 Google Play 商店**,请使用下列 `com.adjust.sdk` 包规则: - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### Install referrer - -为了将应用的安装归因到正确的来源,Adjust 需要获取有关 **install referrer** (安装引荐来源) 的信息。这可以通过 **Google Play Referrer API** 或使用广播接收器(broadcast receiver) 捕捉 **Google Play Store intent** 来获得。 - -**重要提示**:Google 引入 Google Play Referrer API 是为了提供一种更可靠、更安全的方法,以获取 Install Referrer 信息并帮助归因服务商对抗点击劫持。我们**强烈建议**您的应用支持 Google Play Referrer API。相比之下,通过 Google Play Store intent 获取 install referrer 的方法则安全性较低。Google Play Store intent 暂时与新的 Google Play Referrer API 并行存在,但将来会被弃用。 - -#### Google Play Referrer API - -要在应用中支持 Google Play Referrer API,请务必按照[添加 SDK 至您的项目](#qs-add-sdk)一节中的说明正确操作,并确保将下列代码行加入`build.gradle` 文件中: - -``` -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -请仔细遵循[Proguard 设置](#qs-proguard)一节中的说明操作。请确保您已经添加了说明中所提及的全部规则,尤其是本功能必需的规则: - -``` --keep public class com.android.installreferrer.** { *; } -``` - -要支持该功能,您需要采用 **Adjust SDK v4.12.0 或更新版本**。 - -#### Google Play Store intent - -**请注意**:Google [宣布](https://android-developers.googleblog.com/2019/11/still-using-installbroadcast-switch-to.html),2020 年 3 月 1 日起弃用通过 `INSTALL_REFERRER` intent 发送 referrer 信息的做法。如果您在使用上述方法访问 referrer 信息,请迁移至 [Google Play Referrer API](#qs-gpr-api)方法。 - -您应当使用广播接收器捕捉 Google Play Store `INSTALL_REFERRER` intent。如果您**未使用自己的广播接收器**来接收 `INSTALL_REFERRER` intent ,那么请在 `AndroidManifest.xml` 的 `application` 标签中添加如下 `receiver` 标签。 - -```xml - - - - - -``` - -我们使用这个广播接收器来检索 install referrer,并将其传送给后端。 - -如果您使用不同的广播接收器接收 `INSTALL_REFERRER` intent,请按照[此说明][referrer],以正确方式向 Adjust 广播接收器发送 ping 命令。 - -#### 华为 Referrer API - -从版本 4.21.1 开始,Adjust SDK 将支持对装有华为 App Gallery 10.4 或更新版本的设备进行安装跟踪。无需其他集成步骤,就可以开始使用华为 Referrer API。 - -### 集成 SDK 至您的应用 - -我们从设置基本会话跟踪开始。 - -### 基本设置 - -如果您要将 SDK 集成至原生应用,请按照[原生应用 SDK](#qs-basic-setup-native)一节中的说明操作。如果您要将 SDK 集成到使用 web view 的应用中,请按照下方 [Web view SDK](#qs-basic-setup-web) 中的说明操作。 - -#### 原生应用 SDK - -我们建议您使用全局安卓[应用程序][android-application]类进行 SDK 初始化。如果应用中还没有此类,请按照下列步骤操作: - -- 创建一个扩展 `Application` 的类。 -- 打开应用的 `AndroidManifest.xml` 文件,找到 `` 元素。 -- 添加 `android:name` 属性,将其设置为您的新应用程序类的名称。 - - 在示例应用中,我们将` Application` 类命名为 `GlobalApplication` 。因此,manifest 文件会被设置为: - ```xml - - - ``` - -- 在 `Application` 类中,找到或创建 `onCreate` 方法。添加下列代码,初始化 Adjust SDK: - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - string appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - } - } - ``` - -用您的应用识别码 (app token) 替换 `{YourAppToken}`。您可以在[控制面板]上找到该识别码。 - -下一步,您必须将 `environment` (环境模式) 设为 sandbox 或生产模式: - -```java -String environment = AdjustConfig.ENVIRONMENT_SANDBOX; -String environment = AdjustConfig.ENVIRONMENT_PRODUCTION; -``` - -**重要提示**只有在您或其他人正在测试您的应用时,才应将该值设为 `AdjustConfig.ENVIRONMENT_SANDBOX` 。在发布应用之前,请务必将环境改设为`AdjustConfig.ENVIRONMENT_PRODUCTION`。再次研发和测试时,请将其重新设置为`AdjustConfig.ENVIRONMENT_SANDBOX`。 - -我们按照设置的环境来区分真实流量和来自测试设备的测试流量。非常重要的是,您必须始终根据您的目前状态更新环境! - -#### Web Views SDK - -在获得 `WebView` 对象的引用后: - -- 调用 `webView.getSettings().setJavaScriptEnabled(true)`,以便在 web view 中启用 Javascript -- 调用 `AdjustBridge.registerAndGetInstance(getApplication(), webview)`,来启动 `AdjustBridgeInstance` 默认实例。 -- 这也会将 Adjust 网桥注册为 web view 的 Javascript 接口 -- 如有必要,请调用 `AdjustBridge.setWebView()` 来设置新的`WebView`。 -- 调用 `AdjustBridge.unregister()` ,以取消注册 `AdjustBridgeInstance` 和 `WebView`. - -完成这些步骤后,您的 activity 应该以如下形式呈现: - -```java -public class MainActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - WebView webView = (WebView) findViewById(R.id.webView); - webView.getSettings().setJavaScriptEnabled(true); - webView.setWebChromeClient(new WebChromeClient()); - webView.setWebViewClient(new WebViewClient()); - - AdjustBridge.registerAndGetInstance(getApplication(),webview); - try { - webView.loadUrl("file:///android_asset/AdjustExample-WebView.html"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void onDestroy() { - AdjustBridge.unregister(); - - super.onDestroy(); - } -} -``` - -完成以上步骤后,您就成功将 Adjust bridge 添加进自己的应用了。Javascript bridge 现已启用,可在 Adjust 原生安卓 SDK 和您的页面间进行通讯,它会被加载进 web view 中。 - -在您的 HTML 文件中,导入位于 assets 文件夹根目录中的 Adjust Javascript 文件。如果您的 HTML 文件也存在,请按如下方式导入: - -```html - - - - -``` - -一旦您添加对 Javascript 文件的引用后,在 HTML 文件中使用它们来初始化 Adjust SDK: - -```js -let yourAppToken = '{YourAppToken}'; -let environment = AdjustConfig.EnvironmentSandbox; -let adjustConfig = new AdjustConfig(yourAppToken, environment); - -Adjust.onCreate(adjustConfig); -``` - -用您的应用识别码 (app token) 替换 `{YourAppToken}`。您可以在[控制面板]上找到该应用识别码。 - -然后,取决于您处于测试或是生产模式,请将 `environment` (环境模式)设为以下对应值: - -```js -let environment = AdjustConfig.EnvironmentSandbox; -let environment = AdjustConfig.EnvironmentProduction; -``` - -**重要提示:** 只有在您或其他人正在测试您的应用时,才应将该值设为 `AdjustConfig.EnvironmentSandbox` 。在发布应用之前,请务必将环境设置为``AdjustConfig.EnvironmentProduction` 。如果再次开始开发和测试,请将其重新设置为`AdjustConfig.EnvironmentSandbox` 。 - -我们按照设置的环境来区分真实流量和来自测试设备的测试流量。非常重要的是,您必须始终根据您的目前状态更新环境! - -### 会话跟踪 - -**请注意**:这一步**非常重要**。请**确保您在应用中正确设置它**。正确完成本步骤,可确保 Adjust SDK 正确跟踪您应用中的会话。 - -#### API level 14 及以上版本 - -- 添加一个私有类 (private class) 以实现 `ActivityLifecycleCallbacks` 接口。如果您不能访问该接口,则表示您的应用仅支持安卓 API level 14 以下版本。在这种情况下,请按照此[说明](#qs-session-tracking-api-9),手动更新每项 Activity。如果您在之前已经对应用的每个Activity调用了 `Adjust.onResume` 和 `Adjust.onPause` ,请将其全部移除。 -- 编辑 `onActivityResumed(Activity activity)` 方法,并添加 `Adjust.onResume()` 调用。编辑 -`onActivityPaused(Activity activity)` 方法,并添加对 `Adjust.onPause()` 的调用。 -- 在设置 Adjust SDK 的位置添加 `onCreate()` 方法,并添加调用 `registerActivityLifecycleCallbacks` 以及被创建的 `ActivityLifecycleCallbacks` 类实例。 - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - string appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - - registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); - } - - private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks { - @Override - public void onActivityResumed(Activity activity) { - Adjust.onResume(); - } - - @Override - public void onActivityPaused(Activity activity) { - Adjust.onPause(); - } - - //... - } - } - ``` - -#### API level 9 - 13 版本 - -如果您的应用 gradle 中的 `minSdkVersion` 是在 `9` 至 `13` 版本之间,您应当考虑至少升级至版本 14 以简化集成流程。请查看官方安卓[控制面板][android-dashboard],了解目前市场上各主要版本的占比。 - -为了进行准确的会话跟踪,每当任一 Activity 重新开始或者暂停时都需要调用某个 Adjust SDK 方法。否则 SDK 可能会错过一个会话开始或者会话结束。请遵循以下步骤对您的应用中的**每个 Activity**进行正确设置: - -- 在 Activity 的 `onResume` 方法中调用 `Adjust.onResume()`。必要时创建该方法。 -- 在 Activity 的 `onPause` 方法中调用 `Adjust.onPause()`。必要时创建该方法。 - -完成以上步骤后,您的 Activity 应如下: - -```java -import com.adjust.sdk.Adjust; - -public class YourActivity extends Activity { - protected void onResume() { - super.onResume(); - Adjust.onResume(); - } - protected void onPause() { - super.onPause(); - Adjust.onPause(); - } -} -``` - -对您的应用中的**每个 Activity** 重复以上步骤。如果您在之后创建新的 Activity,也请按照以上步骤设置。取决于您的编码方式,您也可通过设置所有 Activitiy 的通用超类来实现它。 - -### SDK 签名 - -账户管理员必须启用 SDK 签名。如果您希望使用该功能,请联系 Adjust 支持(support@adjust.com)。 - -如果您已经在账户中启用了 SDK 签名,并可访问 Adjust 控制面板的应用密钥,请使用以下方法来集成 SDK 签名到您的应用。 - -在您的 config 实例中调用 `setAppSecret` 来设置应用密钥: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); -config.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(adjustConfig); -``` -
- -### Adjust 日志 - -您可以增加或减少在测试中看到的日志数量,方法是用以下参数之一来调用 config 实例上的 `setLogLevel`: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -config.setLogLevel(LogLevel.VERBOSE); // enable all logs -config.setLogLevel(LogLevel.DEBUG); // disable verbose logs -config.setLogLevel(LogLevel.INFO); // disable debug logs (default) -config.setLogLevel(LogLevel.WARN); // disable info logs -config.setLogLevel(LogLevel.ERROR); // disable warning logs -config.setLogLevel(LogLevel.ASSERT); // disable error logs -config.setLogLevel(LogLevel.SUPRESS); // disable all logs -``` -
-Web View SDK -
- -```js -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // enable all logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug); // disable verbose logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo); // disable debug logs (default) -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn); // disable info logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelError); // disable warning logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert); // disable error logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); // disable all logs -``` -
- -如果您希望禁用所有日志输出,除了将日志级别设置为抑制以外,您还应该对配置对象使用构建函数,它将获取 boolean 参数来显示是否应该支持抑制日志级别: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment, true); -config.setLogLevel(LogLevel.SUPRESS); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment, true); -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); -Adjust.onCreate(adjustConfig); -``` -
- -### 构建您的应用 - -创建并运行您的安卓应用。在 `LogCat` 查看工具中,设置筛选 `tag:Adjust` ,以隐藏所有其他日志记录。应用启动后,您应当可以看到下列 Adjust 日志:`Install tracked` (安装已跟踪)。 - -## 深度链接 - -### 深度链接概述 - -如果您使用的是已启用深度链接的 Adjust 跟踪链接,则可以接收有关深度链接 URL 及其内容的相关信息。不论用户的设备上已经安装了应用 (标准深度链接场景),或者尚未安装应用 (延迟深度链接场景),用户都可与链接交互。在标准深度链接场景中,安卓平台自身会支持您获取关于深度链接内容的信息。但是,安卓平台不提供对延迟深度链接场景的支持。在此情况下,Adjust SDK 可以帮助您获取有关深度链接内容的信息。 - -### 标准深度链接场景 - -如果用户已经安装了您的应用,您希望在用户点击带有 `deep_link` (深度链接) 参数的 Adjust 跟踪链接后打开应用,则必须在应用中启用深度链接。请选择需要的**唯一方案名称** (unique scheme name),并将其分配至您希望在用户点击链接后应用打开时启动的 Activity 中。您可以在 `AndroidManifest.xml` 文件中进行设置。请在 manifest 文件中添加 `intent-filter` 至您指定的 Activity 定义,并分配指定的方案名至 `android:scheme` 属性值: - -```xml - - - - - - - - - - - - - - -``` - -如果您希望在跟踪链接被点击后打开应用,请在 Adjust 跟踪链接的 `deep_link` 参数中使用指定的 Scheme 名称。未添加任何深度链接信息的跟踪链接将如下所示: - -``` -https://app.adjust.com/abc123?deep_link=adjustExample%3A%2F%2F -``` - -请记住:链接中的 `deep_link` 参数值**必须采用 URL 编码形式**。 - -如上所述完成应用设置,当用户点击跟踪链接时,您的应用将连带 `MainActivity` intent 打开。在 `MainActivity` 类中,您将自动获取关于 `deep_link` 参数的内容信息。虽然该内容在链接中已编码,但是它在发送给您后**不会**被编码。 - -`AndroidManifest.xml` 文件中的 `android:launchMode` Activity 设置决定 Activity 文件中 `deep_link` 参数内容的传递位置。请查看安卓[官方文档][android-launch-modes],了解有关 `android:launchMode` 可能属性值的更多信息。 - -通过 `intent` 对象发送至您指定的 Activity 的深度链接内容信息将可能被传递至两个位置 — Activity 的 `onCreate` 或 `onNewIntent` 方法。一旦应用被打开,方法被触发后,您将获得在点击链接中被传递至 `deep_link` 参数中的实际深度链接。您可以使用这些信息为应用增加一些附加逻辑。 - -您可以按以下两种方式提取深度链接内容: - -```java -@Override -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - // data.toString()-> This is your deep_link parameter value. -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - // data.toString()-> This is your deep_link parameter value. -} -``` - -### 延迟深度链接场景 - -用户点击含有 `deep_link` 参数的 Adjust 跟踪链接,但在点击发生时用户设备上并未安装应用,就会发生延迟深度链接场景。用户点击链接时,会被重定向至 Play 应用商店来下载和安装应用。在首次应用打开后,`deep_link` 参数内容将被发送至您的应用。 - -Adjust SDK 默认自动打开延迟深度链接,无须额外设置。 - -#### 延迟深度链接回传 - -如果您希望控制 Adjust SDK 是否打开延迟深度链接,可以通过在配置对象中设置回传的方式实现。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Evaluate the deeplink to be launched. -config.setOnDeeplinkResponseListener(newOnDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - // ... - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; - } - } -}); - -Adjust.onCreate(config); -``` - -Adjust SDK 从后台接收到关于深度链接内容的信息后,将在监听器内向您传递相关内容信息,并等待您的 `boolean` 返回值。该返回值决定是否由 Adjust SDK 启动您从深度链接已分配方案名称的 activity (如标准深度链接场景一样)。 - -如果您的返回值为 `true`,我们将启动该 activity,触发在[标准深度链接场景](#dl-standard)一节中所描述的场景。如果您不希望 SDK 启动 Activity,您可以从监听器返回 `false` 值,并根据深度链接内容自行决定下一步应用中的动作。 -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setDeferredDeeplinkCallback(function(deeplink) {}); - -Adjust.onCreate(adjustConfig); -``` - -在延迟深度链接场景中,您可对配置对象进行一个额外设置。一旦 Adjust SDK 获得延迟深度链接信息,您便可选择我们的 SDK 是否应该打开链接。您可在配置对象上调用 `setOpenDeferredDeeplink` 方法进行设置: - -```js -// ... - -function deferredDeeplinkCallback(deeplink) {} - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setOpenDeferredDeeplink(true); -adjustConfig.setDeferredDeeplinkCallback(deferredDeeplinkCallback); - -Adjust.start(adjustConfig); - -``` - -请记住,如果您不设置回传,**在默认情况下 Adjust SDK 将始终尝试启动链接**。 -
- -### 通过深度链接的再归因 - -Adjust 支持您使用深度链接开展再交互推广活动。请查看我们的[官方文档][reattribution-with-deeplinks],了解更多信息。 - -如果您正在使用该功能,为了准确地再归因用户,您需要在应用中设置一个额外调用至 Adjust SDK。 - -一旦您已经在应用中收到深度链接内容信息,请添加调用至 `Adjust.appWillOpenUrl(Uri, Context)` 方法。添加该调用后,Adjust SDK 将发送信息至 Adjust 后台,查看深度链接中是否有任何新的归因信息。如果您的用户因为点击带有深度链接内容的 Adjust 跟踪链接而被再归因,您将会看到应用中的[归因回传](#af-attribution-callback)被触发并附有该用户的新归因信息。 - -`Adjust.appWillOpenUrl(Uri,Context)` 调用应当以下列方式呈现: - -```java -@Override -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -**请注意**:安卓 SDK v4.14.0 发布后,`Adjust.appWillOpenUrl(Uri)` 方法已被标记为 **弃用**。请换用 `Adjust.appWillOpenUrl(Uri,Context)` 方法。 - -**Web view 特别提示**:您还可如下所示在 web view 中使用 Javascript 中的 `Adjust.appWillOpenUrl` 函数进行调用: - -```js -Adjust.appWillOpenUrl(deeplinkUrl); -``` - -### 链接解析 - -通过电子邮件服务提供商 (ESP) 投放深度链接且需要使用自定义跟踪链接来跟踪点击时,可以使用 `AdjustLinkResolution` 类的 `resolveLink` 方法进行链接解析。这样,当用户在应用中打开深度链接时,您就能记录用户与电子邮件推广活动的互动了。 - -`resolveLink` 方法携带下列参数: - -- `url` - 打开应用程序的深度链接 -- `resolveUrlSuffixArray` - 需要解析的、已设置推广活动的自定义域名 -- `adjustLinkResolutionCallback` - 将包含最终 URL 的回传 - -如果接收到的链接不属于 `resolveUrlSuffixArray` 中指定的任何域名,那么回传就会原样转发深度链接 URL;如果链接包含所指定的域名,那么 SDK 就会尝试解析链接,并将得出的深度链接返回至 `callback` 参数。您也可以使用 `Adjust.appWillOpenUrl` 方法,在 Adjust SDK 中针对返回的深度链接进行再归因。 - -> **请注意**:在尝试解析 URL 时,SDK 会自动追溯最多 10 个重定向 (redirect),并将其中最新的 URL 返回为 `回传` URL,也就是说,如果要追溯的重定向超过 10 个,那么 SDK 就会返回 **第 10 个重定向 URL**。 - -**示例** - -```java -AdjustLinkResolution.resolveLink(url, - new String[]{"example.com"}, - new AdjustLinkResolution.AdjustLinkResolutionCallback() { - @Override - public void resolvedLinkCallback(Uri resolvedLink) { - Adjust.appWillOpenUrl(resolvedLink, getApplicationContext()); - } -}); -``` - -## 事件跟踪 - -### 事件跟踪 - -您可以使用 Adjust 来跟踪应用中的任何事件。假设您想跟踪特定按钮的所有点击。要做到这一点,您需要在[控制面板]中创建新的事件识别码。假设事件识别码为 `abc123`。在按钮的 `onClick` 方法中,添加以下行来跟踪点击: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` -
- -### 跟踪收入 - -如果您的用户可通过点击广告或进行应用内购买的方式为您带来收入,您也可以通过事件来跟踪此类收入。假设一次点击能带来一欧分的收入。您可以这样来跟踪收入事件: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01,'EUR'); -Adjust.trackEvent(adjustEvent); -``` -
- -您可以将其与回传参数相结合。 - -设置货币识别码后,Adjust 会自动将收入转化为您所选的报告收入。[在这里][currency-conversion]了解更多货币换算信息。 - -如果您想要跟踪应用内购买,请确保仅在购买完成且商品已购买后才调用 `trackEvent`。要想避免跟踪实际未产生的收入,这点十分重要。 - -要进一步了解 Adjust 收入和事件跟踪相关信息,请参阅[事件跟踪指南][event-tracking]。 - -### 收入去重 - -您也可以选择添加交易 ID,以避免跟踪重复收入。这样,最后 10 个交易 ID 将被记录下来,交易 ID 重复的收入事件则会被跳过。这对于跟踪应用内购买尤其有用。请在下方查看示例: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -adjustEvent.setOrderId("{OrderId}"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01,'EUR'); -adjustEvent.setOrderId('{OrderId}'); -Adjust.trackEvent(event); -``` -
- -### 应用内收入验证 - -如果您想要验证应用内购买,可以使用 [Adjust 收入验证][android-purchase-verification],这是一款服务器端收据验证工具。点击链接了解更多信息。 - -## 自定义参数 - -### 自定义参数概述 - -除了 Adjust SDK 默认收集的数据点之外,您还可以使用 Adjust SDK 进行跟踪,并根据需要添加任意数量的自定义值(用户 ID、产品 ID 等)到事件或会话中。自定义参数仅作为原始数据提供,且 **不会** 出现在 Adjust 控制面板中。 - -针对内部使用而收集的值,请使用**回传参数**,并对与外部合作伙伴共享的值使用**合作伙伴参数**。如果某个值(如产品 ID)既会被用于内部,也会与外部合作伙伴分享,我们建议同时使用回传和合作伙伴参数来跟踪该值。 - - -### 事件参数 - -### 事件回传参数 - -您可以在 [控制面板] 中为事件输入回传 URL。这样,只要跟踪到事件,我们都会向该 URL 发送 GET 请求。您可以在跟踪前调用事件实例的 `addCallbackParameter` ,向该事件添加回传参数。然后我们会将这些参数附加至您的回传 URL。 - -例如,如果您已注册 URL `http://www.example.com/callback`,则您将这样跟踪事件: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addCallbackParameter("key", "value"); -adjustEvent.addCallbackParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addCallbackParameter('key','value'); -adjustEvent.addCallbackParameter('foo','bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -在这种情况下,我们会跟踪该事件并发送请求至: - -``` -http://www.example.com/callback?key=value&foo=bar -``` - -Adjust 支持各种占位符,例如可以用作参数值的 `{gps_adid}`。我们会在产生的回传中将占位符 (在该情况下) 替换为当前设备的 Google Play 服务 ID。请注意,我们不会存储您的任何自定义参数。我们 **仅** 将这些参数附加到您的回传中。如果您尚未针对事件注册回传,这些参数甚至不会被读取。 - -若想进一步了解 URL 回传,查看可用参数的完整列表,请参阅我们的 [回传指南][callbacks-guide]。 - -### 事件合作伙伴参数 - -参数在控制面板中激活后,您可以将其发送至渠道合作伙伴。 - -方式和上述提及的回传参数类似,可以通过调用事件实例上的 `addPartnerParameter` 方法来添加。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addPartnerParameter("key", "value"); -adjustEvent.addPartnerParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addPartnerParameter('key','value'); -adjustEvent.addPartnerParameter('foo','bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -您可以在我们的 [特殊合作伙伴指南][special-partners] 中了解更多有关特殊合作伙伴以及这些集成的信息。 - -### 事件回传 ID - -您可以为想要跟踪的每个事件添加自定义字符串 ID。我们会在事件成功和/或失败回传中报告该标识符,以便您了解哪些事件已被成功跟踪。通过调用事件实例上的 `setCallbackId` 方法来设置此标识符: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setCallbackId("Your-Custom-Id"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setCallbackId('Your-Custom-Id'); -Adjust.trackEvent(adjustEvent); -``` -
- -### 会话参数 - -会话参数被保存在本地,并随每个 Adjust SDK **事件** 和 **会话** 一同发送。您添加这些参数找呢的任何一个后,下次就无需再度添加,因为这些参数已经被保存。添加同样的参数两次不会有任何影响。 - -这些会话参数在 Adjust SDK 启动之前可以被调用,以确保它们在安装时可被发送。如果您需要在安装同时发送参数,但只有在 SDK 启动后才能获取所需的值,您可以通过[延迟](#delay-start) Adjust SDK 第一次启动以允许该行为。 - -### 会话回传参数 - -注册在[事件](#event-callback-parameters)中的相同回传参数也可以被保存发送至 Adjust SDK 的每一个事件和会话中。 - -会话回传参数的接口与事件回传参数的接口类似。该参数是通过调用 `Adjust.addSessionCallbackParameter(String key, String value)`: 被添加,而不是通过添加 Key 和值至事件: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.addSessionCallbackParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` -
- -会话回传参数将与被添加至事件的回传参数合并。被添加至事件的回传参数拥有高于会话回传参数的优先级。这意味着,当被添加至事件的回传参数拥有与会话回传参数同样的 Key 时,以被添加至事件的回传参数值为准。 - -您可以通过传递 Key 至 `Adjust.removeSessionCallbackParameter(String key)` 的方式来删除特定会话回传参数。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.removeSessionCallbackParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionCallbackParameter('foo'); -``` -
- -如果您希望删除会话回调参数中所有的 Key 及相应值,可以通过 `Adjust.resetSessionCallbackParameters(`) 方式重置: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.resetSessionCallbackParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionCallbackParameters(); -``` -
- -### 会话合作伙伴参数 - -与 [会话回传参数](#session-callback-parameters) 的方式一样,会话合作伙伴参数也会与 SDK 的每个事件或会话一同发送。 - -这些参数会传送至在 Adjust [控制面板] 中已激活相关集成的渠道合作伙伴。 - -会话合作伙伴参数接口与事件合作伙伴参数接口类似。该参数是通过调用 `Adjust.addSessionPartnerParameter(String key, String value)` 被添加,而不是通过添加 Key 和值至事件: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.addSessionPartnerParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionPartnerParameter('foo', 'bar'); -``` -
- -会话合作伙伴参数将与被添加至事件的合作伙伴参数合并。被添加至事件的合作伙伴参数具有高于会话合作伙伴参数的优先级。这意味着,当被添加至事件的合作伙伴参数拥有与会话合作伙伴参数同样的 Key 时,以被添加至事件的合作伙伴参数值为准。 - -您可以通过传递 Key 至 `Adjust.removeSessionPartnerParameter(String key)` 方法,删除特定的会话合作伙伴参数: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.removeSessionPartnerParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionPartnerParameter('foo'); -``` -
- -如果您希望删除会话合作伙伴参数中所有的 Key 及其相应值,可以通过 `Adjust.resetSessionPartnerParameters()`. 方法重置。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.resetSessionPartnerParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionPartnerParameters(); -``` -
- -### 延迟启动 - -延迟 Adjust SDK 的启动可以为您的应用提供更充裕的时间,来接收所有想要随安装发送的会话参数(例如:唯一标识符)。 - -利用 config 实例中的 `setDelayStart` 方法,以秒为单位设置初始延迟时间: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
-Web View SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
- -在此示例中,Adjust SDK 不会在 5.5 秒内发送初始安装会话以及创建的任何事件。5.5 秒后 (或您在其此期间调用 `Adjust.sendFirstPackages()`),每个会话参数会添加至延迟的安装会话和事件,并且 Adjust SDK 会继续照常运行。 - -**您最多可以将 Adjust SDK 的启动时间延长 10 秒**。 - - -## 其他功能 - -将 Adjust SDK 集成到项目中后,您即可利用以下功能: - -### 推送标签 (卸载跟踪) - -推送标签用于受众分群工具和客户回传;也是跟踪卸载和重装所需的信息。 - -要向我们发送推送通知标签,请在获得标签 (或每当标签值变更) 时向 Adjust 添加下列调用: - - - - - - - - - - - - - - -
-原生 SDK -
- -```java -Adjust.setPushToken(pushNotificationsToken, context); -``` - -更新后的签名加入了 `context`,可允许 SDK 涵盖更多场景,确保推送标签被发送。因此,我们建议您使用以上签名方式。 - -尽管如此,我们仍支持之前没有 `context` 的相同方法签名。 - -
-Web View SDK -
- -```js -Adjust.setPushToken(pushNotificationsToken); -``` -
- -### 归因回传 - -您可以注册一个监听器 (listener),以获取跟踪链接归因变化的通知。考虑到归因的不同来源,归因信息无法被同步提供。 - -请查看我们的[归因数据政策][attribution-data]了解更多信息。 - -使用 config 实例,在启动 SDK 之前添加归因回传: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -config.setOnAttributionChangedListener(newOnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) {} -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function attributionCallback(attribution) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAttributionCallback(attributionCallback); -Adjust.onCreate(adjustConfig); -``` -
- -SDK 收到最终归因数据后,监听器函数会被调用。在监听器函数中,您可以访问 `attribution` 参数。以下是其属性的摘要: - -- `trackerToken` 目前归因的跟踪码字符串。 -- `trackerName` 目前归因的跟踪链接名称字符串。 -- `network` 目前归因的渠道分组层字符串。 -- `campaign` 目前归因的推广分组层字符串。 -- `adgroup` 目前归因的广告组分组层字符串。 -- `creative` 目前归因的素材分组层字符串。 -- `clickLabel` 目前归因的点击标签字符串。 -- `adid` Adjust 设备标识符字符串。 -- `costType` 成本类型字符串。 -- `costAmount` 成本金额。 -- `costCurrency` 成本币种字符串。 - -**请注意**:只有在`AdjustConfig` 中通过调用 `setNeedsCost` 方法来进行配置后,`costType`、 `costAmount` 和 `costCurrency` 成本数据才可用。如果未进行配置,或已配置但这些字段不属于归因的一部分,那么字段值就会为 `null`。此功能仅适用于 SDK 4.25.0 及以上版本。 - -### 订阅跟踪 - -**请注意**:此功能仅适用于原生 SDK 4.22.0 及以上版本。 - -您可以用 Adjust SDK 跟踪 Play 应用商店的订阅,并验证这些订阅是否有效。订阅购买成功后,请向 Adjust SDK 进行如下调用: - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` -
- -订阅跟踪参数: - -- [price](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros) -- [currency](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode) -- [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku) -- [orderId](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid) -- [signature](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsignature) -- [purchaseToken](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetoken) -- [purchaseTime](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetime) - -与事件跟踪一样,您也可以向订阅对象附加回传和合作伙伴参数: - -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -// add callback parameters -subscription.addCallbackParameter("key","value"); -subscription.addCallbackParameter("foo","bar"); - -// add partner parameters -subscription.addPartnerParameter("key","value"); -subscription.addPartnerParameter("foo","bar"); - -Adjust.trackPlayStoreSubscription(subscription); -``` - -### 广告收入跟踪 - -**注意**:此功能仅适用于原生 SDK 4.18.0 及以上版本。 - -您可以通过调用以下方法,使用 Adjust SDK 对广告收入进行跟踪: - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.trackAdRevenue(source, payload); -``` -
- -您需要传递的方法参数包括: - -- `source` - 表明广告收入来源信息的` String` 对象。 -- `payload` - 包含广告收入 JSON 的` JSONObject` 对象。 - -目前,我们支持以下 `source` 参数值: - -- `AD_REVENUE_MOPUB` - 代表 MoPub 广告聚合平台(更多相关信息,请查看 [集成指南][sdk2sdk-mopub]) - -### 会话和事件回传 - -您可以注册一个监听器,以在事件或者会话被跟踪时获取通知。监听器共有 4 个:一个用来跟踪成功事件,一个跟踪失败事件,一个跟踪成功会话,一个跟踪失败会话。您可以在创建配置对象后添加任意数量的监听器: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Set event success tracking delegate. -config.setOnEventTrackingSucceededListener(newOnEventTrackingSucceededListener() { - @Override - public void onFinishedEventTrackingSucceeded(AdjustEventSuccess eventSuccessResponseData) { - // ... - } -}); - -// Set event failure tracking delegate. -config.setOnEventTrackingFailedListener(newOnEventTrackingFailedListener() { - @Override - public void onFinishedEventTrackingFailed(AdjustEventFailure eventFailureResponseData) { - // ... - } -}); - -// Set session success tracking delegate. -config.setOnSessionTrackingSucceededListener(newOnSessionTrackingSucceededListener() { - @Override - public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess sessionSuccessResponseData) { - // ... - } -}); - -// Set session failure tracking delegate. -config.setOnSessionTrackingFailedListener(newOnSessionTrackingFailedListener() { - @Override - public void onFinishedSessionTrackingFailed(AdjustSessionFailure sessionFailureResponseData) { - // ... - } -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function eventSuccessCallback(eventSuccessResponseData) {} -function eventFailureCallback(eventFailureResponseData) {} -function sessionSuccessCallback(sessionSuccessResponseData) {} -function sessionFailureCallback(sessionFailureResponseData) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setEventSuccessCallback(eventSuccessCallback); -adjustConfig.setEventFailureCallback(eventFailureCallback); -adjustConfig.setSessionSuccessCallback(sessionSuccessCallback); -adjustConfig.setSessionFailureCallback(sessionFailureCallback); -Adjust.onCreate(adjustConfig); -``` -
- -SDK 尝试向服务器发送包 (package) 后,将会调用监听器函数。在监听器函数中,您可以访问专门用于监听器的响应数据对象。成功会话响应数据对象字段的摘要如下: - -- `message` 服务器信息字符串或者 SDK 记录的错误信息。 -- `Timestamp` 服务器时间戳字符串。 -- `Adid` 由 Adjust 提供的设备唯一标识符字符串。 -- `JsonResponse` JSON 对象及服务器响应。 - -两个事件响应数据对象都包含: - -- 如果跟踪的包是一个事件,那么 `EventToken` 代表事件识别码字符串。 -- `CallbackId` 为事件对象设置的自定义[回传 ID](#cp-event-callback-id)字符串。 - -事件和会话跟踪失败的对象也均包含: - -- `willRetry` 布尔,表示稍后是否会尝试重新发送数据包。 - -### 用户归因 - -如同之前在[归因回传一节](#af-attribution-callback)阐述的那样,只要归因信息发生更改,就会触发此回传,想要随时访问用户当前的归因信息,您可通过调用 `Adjust` 实例的以下方法来实现: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustAttribution attribution = Adjust.getAttribution(); -``` -
-Web View SDK -
- -```js -let attribution = Adjust.getAttribution(); -``` -
- -**请注意**:Adjust SDK 版本必须为 v4.11.0 或**更高**,才能进行该调用。 - -**注意**:只有在我们的后台跟踪到应用安装并触发归因回传后,您才能获取当前的归因信息。因此,在 SDK 初始化以及归因回传触发前,您**无法**访问用户的归因值。 - -### 设备 ID - -Adjust SDK 支持您接收设备标识符。 - -### Google Play 服务广告 ID - -某些服务 (如 Google Analytics) 要求您协调广告 ID 及客户 ID 以避免重复报告。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -在获取 Google 广告 ID 时您会遇到限制:Google 广告 ID 只能在后台线程中读取。如果调用带上下文 (context) 的 `getGoogleAdId` 函数和 `OnDeviceIdsRead` 实例,那么在任何情况下都能成功: - -```java -Adjust.getGoogleAdId(this, new OnDeviceIdsRead() { - @Override - public void onGoogleAdIdRead(String googleAdId) {} -}); -``` -
-Web View SDK -
- -如需获取设备的 Google 广告设备 ID,您必须传递一个回传函数到 `Adjust.getGoogleAdId`,其将在参数中接收 Google 广告 ID,如下所示: - -```js -Adjust.getGoogleAdId(function(googleAdId) { - // ... -}); -``` -
- -### Amazon 广告 ID - -如果您需要获取 Amazon 广告 ID,请调用` Adjust` 实例的下列方法: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -String amazonAdId = Adjust.getAmazonAdId(context); -``` -
-Web View SDK -
- -```js -let amazonAdId = Adjust.getAmazonAdId(); -``` -
- -### Adjust 设备 ID - -我们的后端会为每个安装您应用的设备生成唯一的 **Adjust 设备标识符** (即 **adid**).为了获得此标识符,请调用 `Adjust` 实例的下列方法: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -String adid = Adjust.getAdid(); -``` -
-Web View SDK -
- -```js -let adid = Adjust.getAdid(); -``` -
- -**请注意**:Adjust SDK 版本必须为 v4.11.0 或**更高**,才能进行该调用。 - -**请注意**:只有在我们的后台跟踪到应用安装后,您才能获取有关 **adid** 的信息。因此,在 SDK 初始化以及成功跟踪到应用安装前,您**无法**访问 **adid** 值。 - -### 预安装应用 - -您可以使用 Adjust SDK,识别设备上已在生产过程中预安装您应用的用户。Adjust 可提供两个解决方案,其中一个采用系统负载,另一个采用默认跟踪链接。 - -总体来说,我们推荐您使用 system payload 解决方案。但是,在有些使用情境下,可能需要用到跟踪链接。请访问我们的[帮助中心](https://help.adjust.com/zh/article/pre-install-tracking),了解 Adjust 的预装合作伙伴与合作伙伴的集成。如果您不确定该采用哪种解决方案,请联系 integration@adjust.com。 - -#### 使用 system payload - -**SDK v4.23.0 及更高版本**支持该x解决方案。 - -创建设置对象后,请在参数为 true 的前提下,调用 `setPreinstallTrackingEnabled`: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
- -#### 采用默认跟踪链接 - -- 在 [控制面板] 中创建新的跟踪链接。 -- 打开应用委托,设置配置的默认跟踪链接: - - - - - - - - - - - - - - -
- 原生应用 SDK -
- - ```java - adjustConfig.setDefaultTracker("{TrackerToken}"); - ``` -
- Web View SDK -
- - ```js - adjustConfig.setDefaultTracker('{TrackerToken}'); - ``` -
- -- 用您在步骤 1 中创建的跟踪码替换 `{TrackerToken}`。请注意,控制面板显示的是跟踪链接 (包括 `http://app.adjust.com/`)。而在源代码中,您应该仅输入 6 个或 7 个字符的识别码,而不是整个跟踪链接。 - -- 创建并运行应用。您应该可以在 LogCat 中看到以下行: - - ``` - 默认跟踪链接:'abc123' - ``` - -### 离线模式 - -您可以将 Adjust SDK 设为离线模式,暂停向我们的服务器传输数据 (但仍然保存跟踪数据用于之后发送)。Adjust SDK 处于离线模式时,所有信息都会保存在一个文件中。请注意不要在离线模式下触发太多事件。 - -调用参数为 `true` 的 `setOfflineMode` 即可激活脱机模式。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.setOfflineMode(true); -``` -
-Web View SDK -
- -```js -Adjust.setOfflineMode(true); -``` -
- -相反地,您可以调用 `setOfflineMode`,启用参数为 `false`,以终止离线模式。当 Adjust SDK 调回在线模式后,保存的所有信息都会发送到我们的服务器,并保留正确的时间信息。 - -与禁用跟踪不同,此设置在会话之间将**不被保存**。也就是说,即使应用在处于离线模式时停用,SDK 每次启动时都必定处于在线模式。 - - -### 禁用跟踪 - -您可以通过调用 `setEnabled`,启用参数为 `false`,来禁用 Adjust SDK 对当前设备的一切跟踪功能。**该设置在会话间保存。**。 - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.setEnabled(false); -``` -
-Web View SDK -
- -```js -Adjust.setEnabled(false); -``` -
- -您可以调用 `isEnabled` 函数,查看 Adjust SDK 目前是否启用。您始终可以通过调用启用参数设置为 `true` 的 `setEnabled` 来激活 Adjust SDK。 - -### 事件缓冲 - -如果您的应用大量使用事件跟踪,您可能想要延迟部分网络请求,以便每分钟按批量发送。您可以利用配置实例来启用事件缓冲: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -adjustConfig.setEventBufferingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setEventBufferingEnabled(true); -``` -
- -### 后台跟踪 - -Adjust SDK 的默认行为是当应用处于后台时暂停发送网络请求。您可以在配置实例中更改此设置: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -adjustConfig.setSendInBackground(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setSendInBackground(true); -``` -
- -### GDPR 被遗忘权 - -根据欧盟的《一般数据保护条例》(GDPR) 第 17 条规定,用户行使被遗忘权时,您可以通知 Adjust。调用以下方法时,Adjust SDK 将会收到指示向 Adjust 后端传达用户选择被遗忘的信息: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.gdprForgetMe(context); -``` -
-Web View SDK -
- -```js -Adjust.gdprForgetMe(); -``` -
- -收到此信息后,Adjust 将清除用户数据,并且 Adjust SDK 将停止跟踪该用户。以后不会再向 Adjust 发送来自此设备的请求。 - -请注意,即便在测试环境中,此决定也是永久性的,**不可逆转**。 - -## 具体用户的第三方数据分享 - -当有用户禁用、启用或重启第三方合作伙伴数据分享时,您可以通知 Adjust。 - -### 为具体用户禁用第三方数据分享 - -请调用以下方法,指示 Adjust SDK 将用户禁用数据分享的选择传递给 Adjust 后端: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -收到此信息后,Adjust 会停止向合作伙伴分享该用户的数据,而 Adjust SDK 将会继续如常运行。 - -### 为具体用户启用或重启第三方数据分享 - -请调用以下方法,指示 Adjust SDK 将用户启用或变更数据分享的选择传递给 Adjust 后端: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -收到此信息后,Adjust 会就是否与合作伙伴分享该用户的数据做出相应变更,而 Adjust SDK 将会继续如常运行。 - -请调用以下方法,指示 Adjust SDK 向 Adjust 后端发送精细选项: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -### 监测具体用户的许可 - -要在 Adjust 控制面板中启用或禁用数据隐私设置,包括许可有效期和用户数据留存期,您需要安装以下方法。 - -请调用以下方法,指示 Adjust SDK 将数据隐私设置传递给 Adjust 后端: - - - - - - - - - - - - - - -
-原生应用 SDK -
- -```java -Adjust.trackMeasurementConsent(true); -``` -
-Web View SDK -
- -```js -Adjust.trackMeasurementConsent(true); -``` -
- -收到此信息后,Adjust 会启用或禁用许可监测。而 Adjust SDK 将会继续如常运行。 - -## 测试与故障排查 - -### 显示 "session failed (Ignoring too frequent session...)" 出错信息。 - -该错误一般发生在安装测试时。单凭卸载和重装应用不足以触发新安装。由于我们服务器已经有该设备的纪录,服务器会认定该设备的 SDK 丢失了本地聚合的会话数据,并忽略该错误信息。 - -虽然该行为可能在测试阶段比较麻烦,但却是必须的,目的是为了让 sandbox 环境的行为尽可能地符合生产环境的行为。 - -如果您拥有应用编辑员级别 (或更高级别) 的权限,则可以使用我们的[测试控制台][testing_console]直接从 Adjust 控制面板重置任何设备的应用会话数据。 - -一旦设备被正确遗忘,测试控制台将返回 `Forgot device`。如果设备已经被遗忘 (或者值不正确),链接将返回 `Advertising ID not found`。 - -遗忘设备将不会逆转 GDPR 遗忘调用。 - -如果您当前的包允许访问,您还可以使用我们的[开发者 API][dev_api] 检查和忘记设备。 - -### 我的广播接收器是否能成功获取 Install Referrer? - -如果您按照[指南](#qs-gps-intent)描述的步骤来设置, 广播接收器就应该可以将 install referrer 发送到 SDK 以及我们的服务器。 - -您可以手动触发测试 Install Referrer,检查设置情况。将 `com.your.appid` 替换为您的应用 ID,并使用 Android Studio 自带的 [adb](http://developer.android.com/tools/help/adb.html) 工具运行下列命令: - -``` -adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver --es "referrer" "adjust_reftag%3Dabc1234%26tracking_id%3D123456789%26utm_source%3Dnetwork%26utm_medium%3Dbanner%26utm_campaign%3Dcampaign" -``` - -如果您已经按照该[指南][referrer]说明,设置了另一个广播接收器使用 `INSTALL_REFERRER` intent ,请用您的广播接收器替换 `com.adjust.sdk.AdjustReferrerReceiver` 。 - -您也可以删除 `-n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver` 参数,让设备上的所有应用接收 `INSTALL_REFERRER` intent。 - -如果您将日志级别设置为 `verbose`,就应该可以通过读取 referrer 查看日志: - -``` -V/Adjust: Referrer to parse (adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign) from reftag -``` - -以及添加点击包 (click package) 到 SDK 包处理器: - -``` -V/Adjust: Path: /sdk_click - ClientSdk: android4.6.0 - Parameters: - app_token abc123abc123 - click_time yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - created_at yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - environment sandbox - gps_adid 12345678-0abc-de12-3456-7890abcdef12 - needs_attribution_data 1 - referrer adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign - reftag abc1234 - source reftag - tracking_enabled 1 -``` - -如果您在启动应用前执行以上测试,数据包将不会被发送。数据包将于应用启动后被发送。 - -**重要提示**:我们建议您不要使用 `adb` 工具测试该功能。为了测试完整的 referrer 内容 (在由 `&` 分隔多个参数的情况下),如果使用 `adb`,您就需要对内容进行编码以便发送给广播接收器。如未编码,`adb` 将在第一个 `&` 符号后切断 referrer,并向您的广播接收器发送错误内容。 - -如果您希望查看应用如何接收未编码的 referrer 值,我们建议您使用我们的示例应用,并更改传递的内容,以便被 `MainActivity.java` 文件内的 `onFireIntentClick` 方法中的 intent 触发: - -```java -public void onFireIntentClick(View v) { - Intent intent = new Intent("com.android.vending.INSTALL_REFERRER"); - intent.setPackage("com.adjust.examples"); - intent.putExtra("referrer", "utm_source=test&utm_medium=test&utm_term=test&utm_content=test&utm_campaign=test"); - sendBroadcast(intent); -} -``` - -您可随意使用自选内容更改 `putExtra` 方法的第二个参数。 - -### 我能否在应用激活时触发事件? - -此时触发事件可能无法达到您预期的效果。原因如下: - -全局 `Application` 类上的 `onCreate` 方法不仅在应用启动时调用,而且在应用捕捉到系统或应用事件时调用。 - -此时,我们的 SDK 已经准备初始化了,但是还没有正式启动。只有当 activity 发生时,比如当用户真正激活应用时,SDK 才会正式启动。 - -即使用户没有激活应用,此时触发事件将启动 Adjust SDK 并发送事件 — 具体时间取决于应用的外部因素。 - -在应用激活时触发事件会导致被跟踪的安装及会话数量报告不准确。 - -如果您想在安装后触发事件,请使用[归因回传](#af-attribution-callback)。 - -如果您想在应用激活时触发事件,请为指定 activity 使用 `onCreate` 方法。 - -[dashboard]: http://adjust.com/zh -[控制面板]: http://adjust.com/zh -[adjust.com]: http://adjust.com/zh - -[en-readme]: ../../README.md -[zh-readme]: ../chinese/README.md -[ja-readme]: ../japanese/README.md -[ko-readme]: ../korean/README.md - -[example-java]: ../../Adjust/example-app-java -[example-kotlin]: ../../Adjust/example-app-kotlin -[example-keyboard]: ../../Adjust/example-app-keyboard -[example-tv]: ../../Adjust/example-app-tv -[example-webbridge]: ../../Adjust/example-app-webbridge - -[maven]: http://maven.org -[referrer]: https://github.com/adjust/android_sdk/blob/master/doc/chinese/misc/multiple-receivers.md -[releases]: https://github.com/adjust/android_sdk/releases -[google-ad-id]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en -[Google 广告 ID]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en -[event-tracking]: https://docs.adjust.com/zh/event-tracking -[callbacks-guide]: https://docs.adjust.com/zh/callbacks -[new-referrer-api]: https://developer.android.com/google/play/installreferrer/library.html -[special-partners]: https://docs.adjust.com/zh/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[android-dashboard]: http://developer.android.com/about/dashboards/index.html -[currency-conversion]: https://docs.adjust.com/zh/event-tracking/#tracking-purchases-in-different-currencies -[android-application]: http://developer.android.com/reference/android/app/Application.html -[android-launch-modes]: https://developer.android.com/guide/topics/manifest/activity-element.html -[google-play-services]: http://developer.android.com/google/play-services/setup.html -[Google Play 服务]: http://developer.android.com/google/play-services/setup.html -[reattribution-with-deeplinks]: https://docs.adjust.com/zh/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[android-purchase-verification]: https://github.com/adjust/android_purchase_sdk -[testing_console]: https://docs.adjust.com/zh/testing-console/#how-to-clear-your-advertising-id-from-adjust-between-tests -[dev_api]: https://docs.adjust.com/zh/adjust-for-developers/ - -[sdk2sdk-mopub]: ../../doc/chinese/sdk-to-sdk/mopub.md -[集成指南]: https://github.com/adjust/android_sdk/tree/master/doc/chinese - -[en-helpcenter]: https://help.adjust.com/en/developer/android-sdk-documentation -[zh-helpcenter]: https://help.adjust.com/zh/developer/android-sdk-documentation -[ja-helpcenter]: https://help.adjust.com/ja/developer/android-sdk-documentation -[ko-helpcenter]: https://help.adjust.com/ko/developer/android-sdk-documentation - -## 许可 - -Adjust SDK 拥有MIT 许可证。 - -版权所有(c) 2012-2021 Adjust GmbH,http://www.adjust.com - -特此免费授予获得本软件及相关文档文件(“软件”)副本的任何人,得以无限制地处理本软件,其范围包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售本软件的副本;具备本软件上述权限之人员需遵守以下条件: - -上述版权声明和本许可声明,应包含在本软件的所有副本或主要部分中。 - -本软件“按原样”提供,不提供任何形式的明示或暗示保证,包括对适销性、适用于特定用途或非侵权性的保证。任何情况下,作者或版权所有者都不应承担任何索赔、损害赔偿或其他责任,无论是因软件或使用或其他软件处理引起的或与其相关的合同行为、侵权行为或其他行为。 - - diff --git a/doc/chinese/misc/fb-pixel.md b/doc/chinese/misc/fb-pixel.md deleted file mode 100644 index e6672d0c4..000000000 --- a/doc/chinese/misc/fb-pixel.md +++ /dev/null @@ -1,115 +0,0 @@ -## Facebook像素集成 - -[Facebook像素](https://www.facebook.com/business/help/952192354843755)是由Facebook提供的仅限于Web的分析工具。在过去,我们无法使用Facebook SDK来跟踪应用网页视图(Webview)中的像素事件。[FB SDK](https://developers.facebook.com/docs/analytics)4.34版本的发布使之成为可能,并通过[混合移动应用事件(Hybrid Mobile App Events)](https://developers.facebook.com/docs/app-events/hybrid-app-events)将Facebook像素事件转化为Facebook应用事件。 - -您现在还可通过Adjust SDK跟踪Facebook像素,而无需集成FB SDK。 - -## Facebook集成 - -### 示例应用 - -[`example-fbpixel`目录][example-fbpixel]中的示例应用向您演示了如何使用Adjust网页视图SDK跟踪Facebook像素事件。 - -### Facebook应用ID - -虽然无需集成FB SDK,但您必须遵循与FB SDK相同的一些集成步骤以将Facebook像素集成到Adjust SDK中。 - -如[FB SDK安卓SDK指南](https://developers.facebook.com/docs/android/getting-started/#app_id)中所述,您须将Facebook应用ID添加到应用中。 您可按照该指南中的步骤操作,同时我们将步骤复制如下: - -- 打开`strings.xml`文件。示例路径:`/app/src/main/res/values/strings.xml`。 -- 添加新的字符串(名称为`facebook_app_id`,值为Facebook应用ID)。 -- 打开`AndroidManifest.xml`。 -- 将`uses-permission`元素添加到清单: - - ```xml - - ``` - -- 将`meta-data`元素添加到`application`元素中: - -```xml - - ... - - ... - - ``` - -### Facebook像素配置 - -请参考Facebook指南了解如何集成Facebook像素。Javascript代码应如下所示: - -```js - - -... - -``` - -现在,如[混合移动应用事件指南](https://developers.facebook.com/docs/app-events/hybrid-app-events)`Update Your Pixel(更新您的像素)`部分所述,您须更新Facebook像素代码如下: - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**注意**:**非常重要**的一点是您必须首先调用''init'`并且之后立即调用`'set'`方法。Facebook提供给您需粘贴到HTML网页的代码片段(如上所示)包含调用`'init'`方法后的页面视图事件的`'track'`方法。为了正确跟踪此页面视图事件,请务必在两者之间调用`'set'`方法! - -## Adjust集成 - -### 注册Facebook SDK Javascript界面 - -请按照[安卓Web视图SDK](web_views.md)应用的集成指南进行操作。如下文注册和获取Adjust bridge默认实例: - -```java -AdjustBridge.registerAndGetInstance(getApplication(), webview); -``` - -保存返回实例,如`adjustBridgeInstance`,然后添加以下行: - -```java -adjustBridgeInstance.registerFacebookSDKJSInterface(); -``` - -### 事件名称配置 - -Adjust网桥SDK将Facebook像素事件转化为Adjust事件。 - -因此,您必须将Facebook像素映射到特定的Adjust事件,或者在启动Adjust SDK和跟踪任意Facebook像素事件***之前***配置默认的Adjust事件识别码,包括从Facebook像素配置中复制粘贴的`fbq('track', 'PageView');`。 - -为了将Facebook像素事件映射到Adjust事件,请在初始化Adjust SDK之前在`adjustConfig`实例中调用`addFbPixelMapping(fbEventNameKey,adjEventTokenValue)`。应类似以下示例: - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -请注意,在跟踪Facebook像素事件:`fbq('track', 'Search', ...);` 和 `fbq('track', 'Purchase', ...);` 时应可实现匹配。但遗憾的是我们无法访问Javascript中跟踪的事件名称与FB SDK使用的事件名称之间的完整映射方案。 - -以下为到目前为止我们收集的事件名称信息,供您参考: - -| 像素事件名称 | 对应Facebook应用事件名称 -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - -以上列表也许还不完整;Facebook也可能添加或更新当前列表。在测试时,请查看Adjust日志以获取提示信息,例如: - -``` -未就名称为:'fb_mobile_search'的事件配置默认事件识别码或找到匹配。它将不会被Adjust作为事件来跟踪。 -``` - -如果您未配置映射,还可以选择使用默认的Adjust事件。您只需在初始化Adjust SDK之前调用`adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);`。 - -[example-fbpixel]: ../../Adjust/example-app-fbpixel diff --git a/doc/chinese/misc/multiple-receivers.md b/doc/chinese/misc/multiple-receivers.md deleted file mode 100644 index 9cf5ef1eb..000000000 --- a/doc/chinese/misc/multiple-receivers.md +++ /dev/null @@ -1,31 +0,0 @@ -## 多个广播接收器 - -如果有多个来源需要注册您应用的广播接收器(broadcast receiver) 以获取`INSTALL_REFERRER` Intent,那么您须集成自己的`BroadcastReceiver`,然后用其调用您希望支持的其他所有接收器。 - -如果您已在 Manifest 文件中定义了您自己的广播接收器,比如类似以下的设置: - -```xml - - - - - -``` - -那么请确保按以下方式通知 Adjust (或其他需要该信息)的广播接收器关于 Intent 的内容: - -```java -public class InstallReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - // Adjust receiver. - new AdjustReferrerReceiver().onReceive(context, intent); - // Google Analytics receiver. - new CampaignTrackingReceiver().onReceive(context, intent); - // And any other receiver which needs the intent. - } -} -``` diff --git a/doc/chinese/misc/pre-install-tracker-tool.md b/doc/chinese/misc/pre-install-tracker-tool.md deleted file mode 100644 index 1825197d0..000000000 --- a/doc/chinese/misc/pre-install-tracker-tool.md +++ /dev/null @@ -1,156 +0,0 @@ -# adjust 商店&预安装跟踪码工具 - -adjust 商店&预安装跟踪码工具(`adjust-dtt`)是一个ruby命令行工具,使您能够插入adjust预安装跟踪码信息至您的APK文件。该信息将在之后由adjust SDK读取,您可以将每个预安装应用的用户绑定到特定的adjust跟踪码中。 - -为了运行`adjust-dtt`工具,您需要在您的Linux / Mac OS X机器上安装以下三个工具: - -1. `ruby` – 用于运行`adjust-dtt`工具 -2. `apktool` – 用于APK解包和重新打包 -3. `jarsigner` – 用于给APK签名 - -Mac OS X默认安装Ruby。如果您的Linux发行版未默认安装Ruby,请查看此说明,了解如何在不同的Linux发行版上安装Ruby: https://www.ruby-lang.org/en/documentation/installation/ - -参阅这里了解如何安装apktool: https://ibotpeaches.github.io/Apktool/install/ - -如果您已在机器上安装了用于Mac OS X的`brew`包管理器 (http://brew.sh/) ,您可以通过运行以下命令轻松安装apktool: - -``` -brew install apktool -``` - -或者,您可以在机器上安装`jarsigner`,该工具是Java开发工具包(JDK)的一部分。举例来说,一旦在Mac OS X上安装了JDK(在此例中为版本1.8),您可在此找到它: - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/ -``` - -JDK安装带一个`bin`文件夹,(如果您使用和以上相同的安装路径)该文件夹应位于此路径: - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ -``` - -在此文件夹中,您可以找到`jarsigner`工具,该工具对于后续使用`adjust-dtt`工具是必要的。 - -`adjust-dtt`工具假定此两个工具 (`apktool` and `jarsigner`) 的路径都被添加至您的系统`PATH`变量中。 如果还未完成添加,您需要将包含这此两个工具的文件夹添加至`PATH`变量。 - -**注意**: 如果您使用推荐方式(官方安装向导或`brew`)来添加`apktool`,您可以从终端的任何位置运行`apktool`(它的路径将被自动添加至`PATH`变量),但是如果您决定以其它方式,即其位置不是作为`PATH`变量一部分的方式来添加`apktool`,您需要添加一个包含文件夹到`PATH`变量。 - -假设以下为`apktool` (1)和`jarsigner` (2)的位置: - -1. /User/dummy/some/random/folder/ -2. /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ - -为了添加这两个位置至`PATH`变量,您需要编辑`.bash_profile`文件。该文件通常位于`$HOME`根目录: - -``` -$HOME/.bash_profile -``` - -选择您偏好的编辑器并打开该文件,在文件末端添加如下行: - -``` -export PATH="/Users/dummy/some/random/folder:/Library/Java/JavaVirtualMachines/jdk 1.8.0_102.jdk/Contents/Home/bin:$PATH" -``` - -在`apktool`自动存在于您的`PATH`(比如`brew`安装自带)的情况下,您无需再添加路径至`PATH`变量。而是(参考上例)添加下行,而不是上行: - -``` -export PATH="/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin: $PATH" -``` - -保存更改并运行以下命令立即应用更改: - -``` -source $HOME/.bash_profile -``` - -**注意**: 本教程假定您正在使用`bash` shell,如果您在使用其他shell(例如`zsh`),请依据您的shell设置执行以上步骤。 - -现在您已经完成所有设置,可以开始使用`adjust-dtt`工具。 - -您计划发布的APK已经签名;即使生成的是“未签名”的APK版本,Android Studio仍会使用您计算机上的默认调试签名密钥库(keystore)对其进行签名。该密钥库应该位于: - -``` -$HOME/.android/debug.keystore -``` - -如果您正在从Android Studio导出已签名的APK,您将使用自定义签名密钥库文件对APK进行签名。 - -您需要访问您的默认调试密钥库文件或者自定义文件,以使用`adjust-dtt`工具。该操作的原因是`apktool`一旦用于解压APK,将完全删除APK上的所有签名,当APK在编辑后被重新打包,签名则不会被重新启用。因此,您需要运行`jarsigner`工具,并向其传递签名信息,以便重新签名APK,实现APK在安卓设备上的传送和使用。 - -一切准备就绪后,您最后要做的就是在adjust控制面板上创建一个跟踪链接并获取其识别码,您将使用该跟踪码作为预安装应用的默认跟踪码。 - -获取所有信息后,您可以生成一个`adjust-config.yaml`配置文件,填入您想要发布您应用的每个商店设置,并设置预安装跟踪码。 - -如下`adjust-config.yaml`文件示例,假设我们想要为**store_1**, **store_2**和**store_3**三个虚构商店构建一个APK: - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: - store_1: - default_tracker: abc123 - store_2: - default_tracker: abc456 - store_3: - default_tracker: abc789 -``` - -您可以设置以下参数: - -1. `apk_path` = 您的APK文件的完整路径(全局和每个商店) -2. `keystore_path` = 用于APK签名的密钥库文件的完整路径(全局和每个商店) -3. `keystore_pass` = 您的密钥库签名密码(全局和每个商店) -4. `keystore_alias` = 您的密钥库别名(全局和每个商店) -5. `default_tracker` = 您的预安装adjust跟踪码(仅每个商店) - -如果您希望对未定义参数的每个商店应用这些设置,您可以在root中全局定义前四个参数。如果您不仅全局而且对每个商店定义了参数,则指定的商店参数将被用于生成APK。举例来说,配置文件将如下: - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: - store_1: - default_tracker: abc123 - keystore_path: /Users/uerceg/Desktop/apk/differentkeystore.jks - keystore_pass: differentkeystorepass - keystore_alias: differentkeystorealias - store_2: - default_tracker: abc456 - store_3: - default_tracker: abc789 -``` - - -如上例,在为`store_1`生成APK时,`adjust-dtt`工具将使用`differentkeystore.jks`、`differentkeystorepass` 和 `differentkeystorealias`。**stores**参数必须要在root中,您可以在root中按您的需要定义多个商店。之后将为每个商店生成一个修改后的APK文件。 - -正确设置`adjust-config.yaml`文件后,你只需如下运行`adjust-dtt`工具: - -``` -adjust-dtt adjust-config.yaml -``` - -**注意**: 如果您无法运行`adjust-dtt`工具,请检查是否分配了执行权限,如没有,请运行: - -``` -chmod +x adjust-dtt -``` - -然后再次尝试运行`adjust-dtt`工具。 - -当您运行`adjust-dtt`工具时,将会发生以下情况: - -1. 您的应用的APK文件被解压,带有您的APK名称的文档将被创建在原APK文件处。 -2. 搜索assets文件夹,以及assets文件夹中的`adjust_config.properties`文件(包含默认跟踪码信息)。 -3. 如果assets文件夹或者`adjust_config.properties`不存在,它们将被自动创建,跟踪码将以`default_tracker` (默认跟踪码)参数被写入配置文件中。 -4. 如果APK已经包含了 `adjust_config.properties`文件,但是默认跟踪码未被写入, 则`default_tracker`参数值将被写入文件。如果APK文件已经包含默认跟踪码,该跟踪码将与您的传递至命令的值比较,如果两个值不同,则使用您传递给命令的值。 -5. 重新打包APK。 -6. APK将使用您传递的`keystore_path`、 `keystore_pass` 和`keystore_alias`参数值进行签名。 -7. 生成的APK将保留和原始名相同的名称,并附加`_[store_name]`后缀。如上例,我们将生成三个APK文件,名称为 `example-release_store_1.apk`、`example- release_store_2.apk` 和 `example-release_store_3.apk`。您可以在发布它们之前随意重新命名这些文件。 - -如果您对此工具有任何疑问,欢迎随时电邮联系我们: support@adjust.com 。 diff --git a/doc/chinese/plugins/imei.md b/doc/chinese/plugins/imei.md deleted file mode 100644 index 1ffcf294f..000000000 --- a/doc/chinese/plugins/imei.md +++ /dev/null @@ -1,62 +0,0 @@ -## IMEI插件 - -对于特定市场,IMEI 及 MEID 可被用于安卓的归因。如希望启用该功能,请按照我们[文档][imei_doc]中的指引,于 Adjust 控制面板中完成必要的设置,然后添加本插件。 - -关于设备 ID 的读取,本 IMEI 插件依然遵循 Adjust 安卓 SDK 的默认逻辑,并在此基础上**额外地**允许 Adjust 安卓 SDK 读取设备的 IMEI 和 MEID 值。 - -**重要事项:** 本 IMEI 插件**仅**适用于**非Google Play商店**中发布的应用。 - -在使用此插件前,请确保已经阅读 Adjust 官方 [Android SDK 的集成指南][readme],并成功将 Adjust SDK 集成于您的应用中。然后,请按照以下额外步骤设置,以使 Adjust SDK 开始收集并跟踪 IMEI 及 MEID。 - -### 添加 IMEI 插件至应用中 - -如果您使用的是 Maven,请在您的 `build.gradle` 文件中,于已有的Adjust SDK 依赖处,添加 IMEI 插件的依赖,如: - -``` -implementation 'com.adjust.sdk:adjust-android:4.16.0' -implementation 'com.adjust.sdk:adjust-android-imei:4.16.0' -``` - -您也可以在我们的[发布页面][releases]中下载和添加 JAR 文件形式的 Adjust IMEI 插件。 - -### 添加权限 - -如果您的 `AndroidManifest.xml` 文件中尚未包含以下权限,请添加: - -```xml - -``` - -请注意,对于安卓6.0后的版本,有可能需要 [请求应用权限](https://developer.android.com/training/permissions/requesting),除非安卓操作系统已被更改。 - -### Proguard 设置 - -官方 `README` 对需要发布到 Google Play 商店的应用的 Proguard 规则进行了说明。如果该情况不适用于您的应用,您可以移除与 Google Play 服务库以及 Install Referrer(安装引荐来源)库相关的规则,最后设置将为: - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### 使用插件 - -最后,请在启动 SDK 前,调用 `AdjustImei.readImei()` 以读取 IMEI 和 MEID 值: - -```java -AdjustImei.readImei(); - -// ... - -Adjust.onCreate(config); -``` - -如要 SDK 停止读取 IMEI 和 MEID 值,可调用 `AdjustIMEI.doNotReadImei()` 方法。 - -### 结语 - -**请务必注意** IMEI 和 MEID 是持久识别符(persistent identifier),这将是您的责任确保从您终端用户处收集和处理该项个人信息是合法的。 - -[readme]: ../README.md -[releases]: https://github.com/adjust/adjust_android_sdk/releases -[imei_doc]: https://docs.adjust.com/zh/imei-and-meid-attribution-for-android -[gps_adid]: https://github.com/adjust/android_sdk/blob/master/doc/english/gps_adid.md - diff --git a/doc/chinese/plugins/oaid.md b/doc/chinese/plugins/oaid.md deleted file mode 100644 index 0d36e22af..000000000 --- a/doc/chinese/plugins/oaid.md +++ /dev/null @@ -1,59 +0,0 @@ -## OAID 插件 - -OAID 是由移动安全联盟 (MSA) 推出的广告 ID。所有中国国内的手机厂商都应当提供此 ID。利用 OAID,您可以在谷歌服务不可用的市场中实现安卓设备的跟踪和归因。 - -使用 OAID 插件后,Adjust 安卓 SDK 除读取默认搜索的设备 ID 外,还将可以读取设备的 OAID 值。运行 MSA SDK 的所有设备及搭载 HMS (华为移动服务) 的华为设备均可进行 OAID 的读取。 - -在开始之前,请确保您已阅读官方的 [安卓 SDK 自述文件][自述文件],并已成功将 Adjust SDK 集成到您的应用中。 - -如欲启用 Adjust SDK 以收集和跟踪 OAID,请按以下步骤操作。如只需使用插件读取华为设备的 OAID,则您可以跳过将 MSA SDK 集成至应用 的步骤。 - -### 将 OAID 插件添加至您的应用 - -如果您使用的是 Maven,请将以下 OAID 插件依赖项添加到现有 Adjust SDK 依赖项旁的 `build.gradle` 文件: - -``` -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.adjust.sdk:adjust-android-oaid:4.31.0' -``` - -您还可以将 Adjust OAID 插件作为 JAR 文件进行添加,该文件可从我们的 [版本页面][releases] 下载。 - -### 将 MSA SDK 添加至您的应用 - -注意:对于华为设备,您无需通过添加 MSA SDK 来读取 OAID。OAID 插件可直接调用华为移动服务来读取该值。 - -如需启用 OAID 插件读取使用 MSA SDK 的 OAID 值,请将 MSA SDK (AAR 文件) 复制到项目的 libs 目录中并设置依赖。您还需要将 Supplierconfig.json 复制到项目的assets目录中。 - -您可以在 [此处][msasdk] 找到 MSA SDK 和相关详细说明。 - - -### ProGuard 设置 - -如果您使用的是 ProGuard 并且不会在 Google Play 商店中发布您的应用,则您可以在 [SDK 自述文件][readme proguard] 中删除所有与 Google Play 服务和 Install Referrer 库相关的规则。 - -按如下方式使用所有 `com.adjust.sdk` 包规则: - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### 使用插件 - -如欲读取 OAID 值,请在启动 SDK 前调用 `AdjustOaid.readOaid()`: - -```java -AdjustOaid.readOaid(); - -// ... - -Adjust.onCreate(config); -``` - -如欲阻止 SDK 读取 OAID 值,请调用 `AdjustOaid.doNotReadOaid()`. - - -[readme]: ../../chinese/README.md -[releases]: https://github.com/adjust/android_sdk/releases -[readme proguard]: ../../chinese/README.md#qs-proguard -[msasdk]: http://www.msa-alliance.cn/col.jsp?id=120 diff --git a/doc/chinese/sdk-to-sdk/admob.md b/doc/chinese/sdk-to-sdk/admob.md deleted file mode 100644 index 6cff20fa4..000000000 --- a/doc/chinese/sdk-to-sdk/admob.md +++ /dev/null @@ -1,30 +0,0 @@ -# 通过 Adjust SDK 跟踪 AdMob 广告收入 - -[Adjust 安卓 SDK 自述文件][android-readme] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.28.0** - -如果您想使用 AdMob SDK 跟踪广告收入,可以借助我们的 SDK 到 SDK 集成,将数据发送到 Adjust 后端。要做到这一点,您需要构建 Adjust 广告收入对象,其中包含想记录的信息,然后将对象发送到 `trackAdRevenue` 方法。 - -> 请注意:如果您对 AdMob 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 [support@adjust.com](mailto:support@adjust.com)。 - -### 示例 - -```java -rewardedAd = new RewardedAd(this, AD_UNIT_ID); -// set paid event listener -rewardedAd.setOnPaidEventListener(new OnPaidEventListener() { - @Override - public void onPaidEvent(AdValue adValue) { - // ... - // send ad revenue info to Adjust - AdjustAdRevenue adRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_ADMOB); - adRevenue.setRevenue(adValue.getValueMicros() / 1000000, adValue.getCurrencyCode()); - Adjust.trackAdRevenue(adRevenue); - } -} -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/chinese/README.md diff --git a/doc/chinese/sdk-to-sdk/applovin-max.md b/doc/chinese/sdk-to-sdk/applovin-max.md deleted file mode 100644 index 861beae3e..000000000 --- a/doc/chinese/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,30 +0,0 @@ -# 通过 Adjust SDK 跟踪 AppLovin MAX 广告收入 - -[Adjust 安卓 SDK 自述文件][android-readme] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.28.0** - -如果您想使用 AppLovin MAX SDK 跟踪广告收入,可以借助我们的 SDK-to-SDK 集成,将数据发送到 Adjust 后端。为此,请通过来源 `AD_REVENUE_APPLOVIN_MAX` 调用 `trackAdRevenue` 方法。 - -> 请注意:如果您对 AppLovin MAX 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 [support@adjust.com](mailto:support@adjust.com) - -### 示例 - -```java -@Override -public void onAdRevenuePaid(final MaxAd ad) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue( AdjustConfig.AD_REVENUE_APPLOVIN_MAX); - adjustAdRevenue.setRevenue(ad.getRevenue(),"USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.getNetworkName()); - adjustAdRevenue.setAdRevenueUnit(ad.getAdUnitId()); - adjustAdRevenue.setAdRevenuePlacement(ad.getPlacement()); - - Adjust.trackAdRevenue(adjustAdRevenue); -} - -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/chinese/README.md - diff --git a/doc/chinese/sdk-to-sdk/ironsource.md b/doc/chinese/sdk-to-sdk/ironsource.md deleted file mode 100644 index fcf4dd6c0..000000000 --- a/doc/chinese/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,27 +0,0 @@ -# 通过 Adjust SDK 跟踪 ironSource 广告收入 - -[Adjust 安卓 SDK 自述文件][android-readme] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.28.0** - -如果您想使用 ironSource SDK 跟踪广告收入,可以借助我们的 SDK-to-SDK 集成,将数据发送到 Adjust 后端。为此,请通过来源 `AD_REVENUE_IRONSOURCE` 调用 `trackAdRevenue` 方法。 - -> 请注意:如果您对 ironSource 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 [support@adjust.com](mailto:support@adjust.com) - -### 示例 - -```java -public void onImpressionSuccess (ImpressionData impressionData) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_IRONSOURCE); - adjustAdRevenue.setRevenue(impressionData.getRevenue(),"USD"); - // optional fields - adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdNetwork()); - adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnit()); - adjustAdRevenue.setAdRevenuePlacement(impressionData.getPlacement()); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/chinese/README.md diff --git a/doc/chinese/sdk-to-sdk/mopub.md b/doc/chinese/sdk-to-sdk/mopub.md deleted file mode 100644 index 6d736225a..000000000 --- a/doc/chinese/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,24 +0,0 @@ -## 通过 Adjust SDK 跟踪 MoPub 广告收入 - -[Adjust 安卓 SDK 自述文件][android-readme] - -[MoPub 安卓文档][mopub-docs] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -在实施 MoPub SDK `onImpression` 回传方法时,请确保按照如下方式调用 Adjust SDK 的 `trackAdRevenue` 方法: - -```java -public void onImpression(@NonNull final String adUnitId, @Nullable final ImpressionData impressionData) { - // Pass impression data JSON to Adjust SDK. - Adjust.trackAdRevenue(AdjustConfig.AD_REVENUE_MOPUB, impressionData.getJsonRepresentation()); -} -``` - -如果您对 MoPub 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 support@adjust.com。 - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[android-readme]: ../../chinese/README.md diff --git a/doc/english/migration/migrate.md b/doc/english/migration/migrate.md deleted file mode 100644 index 8a8ad1b2c..000000000 --- a/doc/english/migration/migrate.md +++ /dev/null @@ -1,203 +0,0 @@ -## Migrate your Adjust SDK for Android to 4.31.0 from 3.6.2 - -### The Application class - -One major change is how the Adjust SDK is initialized. You should now use a global Android [Application][android-application] class instead of the manifest file. If you don't already use one for your app, follow the steps in our [README][basic-setup]. - -A second major change is how to configure the Adjust SDK. All initial setup is now done with a new config object. Inside the `onCreate` method of the `Application` class: - -- Create an the config object `AdjustConfig` with the app token, the environment and `this`. -- Optionally configure it. -- Launch the SDK by invoking `Adjust.onCreate` with the config object. - -Here is an example of how the setup might look before in the manifest and after the migration in the `Application` class: - -#### Before - -```xml - - - -``` - -#### After - -```java -import com.adjust.sdk.Adjust; -import com.adjust.sdk.AdjustConfig; - -public class YourApplicationClass extends Application { - @Override - public void onCreate() { - super.onCreate(); - // configure Adjust - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - config.setLogLevel(LogLevel.INFO); // if not configured, INFO is used by default. - Adjust.onCreate(config); - } -} -``` - -### Event tracking - -We also introduced proper event objects that can be set up before they are tracked. Again, an example of how it might look like before and after: - -#### Before - -```java -Map parameters = new HashMap(); -parameters.put("key", "value"); -parameters.put("foo", "bar"); -Adjust.trackEvent("abc123", parameters); -``` - -#### After - -```java -AdjustEvent event = new AdjustEvent("abc123"); -event.addCallbackParameter("key", "value"); -event.addCallbackParameter("foo", "bar"); -Adjust.trackEvent(event); -``` - -### Revenue tracking - -Revenues are now handled like normal events. You just set a revenue and a currency to track revenues. Note that it is no longer possible to track revenues without associated event tokens. You might need to create an additional event token in your dashboard. - -*Please note* - the revenue format has been changed from a cent float to a whole currency-unit float. Current revenue tracking must be adjusted to whole currency units (i.e., divided by 100) in order to remain consistent. - -#### Before - -```java -Adjust.trackRevenue(1.0, "abc123"); -``` - -#### After - -```java -AdjustEvent event = new AdjustEvent("abc123"); -event.setRevenue(0.01, "EUR"); -Adjust.trackEvent(event); -``` - -## Additional steps if you come from v2.1.x - -We renamed the main class `com.adeven.adjustio.AdjustIo` to `com.adjust.sdk.Adjust`. Follow these steps to update all Adjust SDK calls. - -1. Right click on the old `AdjustIo` project in the `Package Explorer` and select `Delete`. Check the box `Delete project contents on disk` and confirm `OK`. - -2. From the Eclipse menu select `Search → File...`, select the tab `File Search`, enter the search text `AdjustIo` and check the box `Case sensitive`. Make sure the file name pattern is `*` and the scope is `Workspace`. - - ![][search] - -3. Click `Replace...`, enter the replacement text `Adjust` and click `Preview >`. All Adjust calls in java files and all Adjust settings in manifest files should be replaced. After you reviewed these changes confirm with `OK`. - - ![][replace] - -4. In the same fashion, replace `adeven.adjustio` with `adjust.sdk` in all manifest files to update the package name of the `ReferrerReceiver`. - -5. Download version v3.6.2 and create a new Android project from the `Adjust` folder. - - ![][import] - -6. Open the Android properties of your apps and make sure that the new `Adjust` library is selected. - -7. For each of your apps, right click on it in the `Package Explorer` and select `Source → Organize Imports`. - -8. Build your project to confirm that everything is properly connected again. - -The Adjust SDK v3.6.2 added delegate notifications. Check out the [README] for details. - -## Additional steps if you come from v2.0.x - -Add Adjust settings to your `AndroidManifest.xml`. Add the following `meta-data` tags inside the `application` tag. - -```xml - - - -``` - -![][settings] - -Replace `{YourAppToken}` with your App Token. You can find it in your [dashboard]. - -The log level is now set globally by `AdjustLogLevel`. Possible values: - -- `verbose` - enable all logging -- `debug` - enable more logging -- `info` - the default -- `warn` - disable info logging -- `error` - disable warnings as well -- `assert` - disable errors as well - -Depending on whether or not you build your app for testing or for production you must adjust the `AdjustEnvironment` setting: - -- `sandbox` - for testing -- `production` - before publishing - -**Important:** This value should be set to `sandbox` if and only if you or someone else is testing your app. Make sure to set the environment to `production` just before you publish the app. Set it back to `sandbox` when you start testing it again. - -We use this environment to distinguish between real traffic and artificial traffic from test devices. It is very important that you keep this value meaningful at all times! - -## Additional steps if you come from v2.0.x - -1. Every activity of your app should call `Adjust.onResume` in its own `onResume` method. Remove the `appToken` parameter in all those calls. Afterwards it should look like this: - - ```java - protected void onResume() { - super.onResume(); - Adjust.onResume(this); - } - ``` - -2. Remove all calls to `Adjust.setLogLevel`. - -## Additional steps if you come from v1.x - -3. We no longer use the `Adjust.appDidLaunch()` method for initialization. Delete the call in your launch activity's `onCreate` method. - -4. Instead, to provide proper session tracking, it is required to call certain new Adjust methods every time any Activity resumes or pauses. Otherwise the SDK might miss a session start or session end. In order to do so you should follow these steps for **each** Activity of your app: - - - Open the source file of your Activity. - - Add the `import` statement at the top of the file. - - In your Activity's `onResume` method call `Adjust.onResume`. Create the method if needed. - - In your Activity's `orPause` method call `Adjust.onPause`. Create the method if needed. - - After these steps your activity should look like this: - - ```java - import com.adjust.sdk.Adjust; - // ... - public class YourActivity extends Activity { - protected void onResume() { - super.onResume(); - Adjust.onResume(this); - } - protected void onPause() { - super.onPause(); - Adjust.onPause(); - } - // ... - } - ``` - - ![][activity] - - Repeat these steps for **every** Activity of your app. Don't forget these steps when you create new Activities in the future. Depending on your coding style you might want to implement this in a common superclass of all your Activities. - -5. The `amount` parameter of the `trackRevenue` methods is now of type `double`, so you can drop the `f` suffixes in number literals (`12.3f` becomes `12.3`). - -[README]: ../../../README.md -[dashboard]: https://adjust.com -[basic-setup]: ../../../README.md#qs-basic-setup -[application_name]: http://developer.android.com/guide/topics/manifest/application-element.html#nm -[android-application]: http://developer.android.com/reference/android/app/Application.html - -[search]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/search.png -[import]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/import2.png -[replace]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/replace.png -[activity]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/activity4.png -[settings]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/settings.png diff --git a/doc/english/misc/eclipse.md b/doc/english/misc/eclipse.md deleted file mode 100644 index 83c1e22af..000000000 --- a/doc/english/misc/eclipse.md +++ /dev/null @@ -1,44 +0,0 @@ -## Integrate Adjust using Eclipse - -Since SDK version 4.0.0 we recommend using Android Studio. Follow these steps to integrate the Adjust SDK using Eclipse. - -Please, have in mind that this document contains only integration information which differs from the ones stated in official [README][readme]. Once you do Eclipse specific integration described in this document, please refer to main `README` for any additional integration and/or SDK usage instructions. - -## Basic Installation - -The most straightforward way to integrate the Adjust SDK in an Eclipse project is by linking the compiled JAR. - -### Get the JAR - -You can get the Adjust SDK JAR from our [releases page][releases]. Another way is to download it from the [Maven repository][maven] by searching for [`com.adjust.sdk`][maven-search]. - -### Add the Adjust SDK JAR to your project - -After downloading the JAR file, drag it into the `libs` folder inside your project. This will make the Adjust SDK available in your app. - -### Add Google Play Services - -Since the 1st of August of 2014, apps in the Google Play Store must use the [Google Advertising ID][google-ad-id] to uniquely identify devices. To allow the Adjust SDK to use the Google Advertising ID, you must integrate the [Google Play Services][google-play-services]. If you haven't done this yet, follow these steps: - -- Copy the library project from `/extras/google/google-play-services/libproject/google-play-services_lib/` to the location where you maintain your Android app projects. - -- Import the library project into your Eclipse workspace. Click `File > Import`, select `Android > Existing Android Code into Workspace`, and browse to the copy of the library project to import it. - -- In your app project, reference Google Play services library project. See [Referencing a Library Project for Eclipse][eclipse-library] for more information on how to do this. You should be referencing a copy of the library that you copied to your development workspace. You should not reference the library directly from the Android SDK directory. - -- After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the [][application] element: - - ```xml - - ``` - - -[maven]: http://maven.org -[readme]: ../../../README.md -[releases]: https://github.com/adjust/android_sdk/releases -[application]: http://developer.android.com/guide/topics/manifest/application-element.html -[google-ad-id]: https://developer.android.com/google/play-services/id.html -[maven-search]: http://search.maven.org/#search%7Cga%7C1%7Ccom.adjust.sdk -[eclipse-library]: http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject -[google-play-services]: http://developer.android.com/google/play-services/setup.html diff --git a/doc/english/misc/fb-pixel.md b/doc/english/misc/fb-pixel.md deleted file mode 100644 index ceea5781b..000000000 --- a/doc/english/misc/fb-pixel.md +++ /dev/null @@ -1,115 +0,0 @@ -## Facebook Pixel integration - -[The Facebook Pixel](https://www.facebook.com/business/help/952192354843755) is a web-only analytics tool from Facebook. In the past it was impossible to use the Facebook SDK to track Pixel events in an app's web view. Since the release of [FB SDK](https://developers.facebook.com/docs/analytics) v4.34, it's now possible to do so, and use the [Hybrid Mobile App Events](https://developers.facebook.com/docs/app-events/hybrid-app-events) to convert Facebook Pixel events into Facebook App events. - -It is also now possible to use the Facebook Pixel in your app's webv iew with the Adjust SDK, without integrating the FB SDK. - -## Facebook integration - -### Example app - -There is an example app inside the [`example-fbpixel` directory][example-fbpixel] that demonstrates how Facebook Pixel events can be tracked with usage of Adjust web view SDK. - -### Facebook App ID - -There is no need to integrate the FB SDK; however, you must follow a few of the same integration steps from the FB SDK in order for the Adjust SDK to integrate the Facebook Pixel. - -As is described in the [FB SDK Android SDK guide](https://developers.facebook.com/docs/android/getting-started/#app_id) you will need to add your Facebook App ID to the app. You can follow the steps in that guide, but we've also copied them here below: - -- Open your `strings.xml` file. Example path: `/app/src/main/res/values/strings.xml`. -- Add a new string with the name `facebook_app_id` and value as your Facebook App ID -- Open `AndroidManifest.xml` -- Add a `uses-permission` element to the manifest: - - ```xml - - ``` - -- Add a `meta-data` element to the `application` element: - -```xml - - ... - - ... - - ``` - -### Facebook Pixel configuration - -Follow Facebook's guide on how to integrate the Facebook Pixel. The Javascript code should look something like this: - -```js - - -... - -``` - -Now, just as described in the [Hybrid Mobile App Events guide](https://developers.facebook.com/docs/app-events/hybrid-app-events) `Update Your Pixel` section, you'll need to update the Facebook Pixel code like this: - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**Note**: Please pay attention that it is **very important** that you first call `'init'` and immediately afterwards `'set'` method. Facebook's script snipet they offer you to paste to your HTML web page (like shown above) contains `'track'` method for page view event right after call to `'init'` method. In order for this page view event to be properly tracked, please make sure to call `'set'` method in between! - -## Adjust integration - -### Register the Facebook SDK Javascript interface - -Follow the integration guide for [Android web view SDK](web_views.md) apps. In the section where you register and get the Adjust bridge default instance (see below): - -```java -AdjustBridge.registerAndGetInstance(getApplication(), webview); -``` - -save the return instance, as `adjustBridgeInstance`, for example, and then add the following line: - -```java -adjustBridgeInstance.registerFacebookSDKJSInterface(); -``` - -### Event name configuration - -The Adjust web bridge SDK translates Facebook Pixel events into Adjust events. - -For this reason it's necessary to map Facebook Pixels to specific Adjust events, or to configure a default Adjust event token ***before*** tracking any Facebook Pixel event, including the copy-pasted `fbq('track', 'PageView');` from the Facebook Pixel configuration. - -To map Facebook Pixel events and Adjust events, call `addFbPixelMapping(fbEventNameKey, adjEventTokenValue)` in the `adjustConfig` instance before initializing the Adjust SDK. An example of mapping could be: - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -Note that this would match when tracking the Facebook pixel events `fbq('track', 'Search', ...);` and `fbq('track', 'Purchase', ...);` respectively. Unfortunatly, we do not have access to the entire mapping scheme between the event names tracked in Javascript and the event names used by the FB SDK. - -To help you, here is the event name information we've found so far: - -| Pixel event name | Corresponding Facebook app event name -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - -This may not be an exhaustive list; it's also possible that Facebook will add to or update the current list. While testing, check the Adjust logs for warnings such as: - -``` -There is not a default event token configured or a mapping found for event named: 'fb_mobile_search'. It won't be tracked as an adjust event -``` - -There is also the option to use a default Adjust event even if you do not have mapping configured. Just call `adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);` before initializing the Adjust SDK. - -[example-fbpixel]: ../../../Adjust/example-app-fbpixel diff --git a/doc/english/misc/multi-process-app.md b/doc/english/misc/multi-process-app.md deleted file mode 100644 index 74e051c9a..000000000 --- a/doc/english/misc/multi-process-app.md +++ /dev/null @@ -1,59 +0,0 @@ -## Adjust SDK with multi-process apps - -Android applications can consist of one or more processes. You can choose to run your services or activities in a process other than the main one. You implement this by setting `android:process` property inside your process or activity definition in the Android manifest file. - -```xml - - -``` - -```xml - - -``` - -By defining your services or activities like this, you are forcing them to run in a different process than the main one. - -By default, the name of your main process is the same as your app package name. If your app package name is `com.example.myapp`, that will also be the name of your main process. In that case, `YourActivity` and `YourService` will run in a process named `com.example.myapp:YourProcessName`. - -The Adjust SDK **does not currently support** tracking from more than one process in an app. If you are using multiple processes in your app, you should set the main process name in the `AdjustConfig` object. - -```java -String appToken = "{YourAppToken}"; -String environment = AdjustConfig.ENVIRONMENT_SANDBOX; // or AdjustConfig.ENVIRONMENT_PRODUCTION - -AdjustConfig config = new AdjustConfig(this, appToken, environment); -config.setProcessName("com.example.myapp"); - -Adjust.onCreate(config); -``` - -You can also change the name of your main process by changing the `android:process` property of your `application` in the Android manifest file. - -```xml - - -``` - -If you name your main process like this, then you should set your main process name in `AdjustConfig` object like this: - -```java -config.setProcessName("com.example.myapp:YourMainProcessName"); -``` - -This will inform our SDK of your main process name, so that the SDK will not initialize in any other process where you might try to use it. If you try to use the SDK from some other process, you will get the following log message: - -``` -05-06 17:15:06.885 8743-8743/com.example.myapp:YourProcessName I/Adjust﹕ Skipping initialization in background process (com.example.myapp:YourProcessName) -``` - -If you do not set your main process name in the `AdjustConfig` object and then try to call the SDK in multiple processes, you will initialize several different instances of the SDK, as different processes in Android do not share the same memory space. This can lead to some unpredictability, so we strongly advise you to always set your main process name if you have a multi-process app, or ensure that you do not use the Adjust SDK in more than one process in your app. diff --git a/doc/english/misc/multiple-receivers.md b/doc/english/misc/multiple-receivers.md deleted file mode 100644 index 534e6cfa7..000000000 --- a/doc/english/misc/multiple-receivers.md +++ /dev/null @@ -1,30 +0,0 @@ -## Support for multiple broadcast receivers - -If multiple sources need to register a broadcast receiver for the `INSTALL_REFERRER` intent in your app, you will have to implement your own -`BroadcastReceiver`, which calls all the other receivers you want to support. If you have your own broadcast receiver defined in your manifest file (similar to the one stated below): - -```xml - - - - - -``` - -please make sure to inform the Adjust broadcast receiver (and any other that might need the information) of your intent content like so: - -```java -public class InstallReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - // Adjust receiver. - new AdjustReferrerReceiver().onReceive(context, intent); - // Google Analytics receiver. - new CampaignTrackingReceiver().onReceive(context, intent); - // And any other receiver which needs the intent. - } -} -``` diff --git a/doc/english/misc/pre-install-tracker-tool.md b/doc/english/misc/pre-install-tracker-tool.md deleted file mode 100644 index 0e88f5052..000000000 --- a/doc/english/misc/pre-install-tracker-tool.md +++ /dev/null @@ -1,155 +0,0 @@ -## Adjust Store & Pre-install Tracker Tool - -Adjust Store & Pre-install Tracker Tool (`adjust-dtt`) is a small ruby command line tool that enables you to insert pre-installed Adjust tracker information into your APK file. This information will later be read by the Adjust SDK and enable you to tie the users of each pre-installed app to a specific Adjust tracker. - -In order to run the `adjust-dtt` tool, you need to have three tools installed on your Linux / Mac OS X machine: - -1. `ruby` – used for running the `adjust-dtt` tool -2. `apktool` – used for APK unpacking and re-packing -3. `jarsigner` – used for APK signing purposes - -Ruby comes installed by default on Mac OS X. In case your Linux distribution doesn’t have it installed by default, please check these instructions on how to install it on different Linux distributions: https://www.ruby-lang.org/en/documentation/installation/ - -How to install the apktool is described here: https://ibotpeaches.github.io/Apktool/install/ - -If you have the `brew` package manager (http://brew.sh/) for Mac OS X set up on your machine, you can easily install the apktool by running: - -``` -brew install apktool -``` - -Alternatively, `jarsigner` is the tool available as part of the Java Development Kit (JDK) which needs to be installed on your machine. For example, once JDK (in this case, version 1.8) is installed on Mac OS X, it will be found at this location: - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/ -``` - -The JDK installation contains a `bin` folder, which (if we use the same installation path as above) is located at this path: - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ -``` - -Inside of this folder, you can find the `jarsigner` tool, which is needed in order to use the `adjust-dtt` tool. - -The `adjust-dtt` tool assumes that the paths of both of these tools (`apktool` and `jarsigner`) are added to your system `PATH` variable. If this is not done, you will need to add the folders containing these two tools to the `PATH` variable. - -**Note**: Adding the `apktool` via either of these suggested methods (official installation guide or `brew`) will enable you to run the `apktool` from any place in your terminal (its path will be added automatically to your `PATH` variable), but in case you decided to add the `apktool` in a way in which its location is not part of the `PATH` variable, you will need to add a containing folder to the `PATH` variable. - -Let's assume that these are the locations of the `apktool` (1) and `jarsigner` (2): - -1. /User/dummy/some/random/folder/ -2. /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ - -In order to add these two locations to the `PATH` variable, you need to edit your `.bash_profile` file. It is usually located in the root of your `$HOME` directory: - -``` -$HOME/.bash_profile -``` - -Open this with your preferred editor and add the following to the end of it: - -``` -export PATH="/Users/dummy/some/random/folder:/Library/Java/JavaVirtualMachines/jdk 1.8.0_102.jdk/Contents/Home/bin:$PATH" -``` - -In case the `apktool` exists automatically in your `PATH` (as part of an installation via `brew`, for example), you don’t need to add its path to the `PATH` variable. Instead (and following the example above), add the following line, instead of the one above: - -``` -export PATH="/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin: $PATH" -``` - -Save the changes and run the following command to immediately apply the changes: - -``` -source $HOME/.bash_profile -``` - -**Note**: This tutorial assumes that you are using the `bash` shell. If you are using another shell (`zsh`, for example), please perform the above steps in accordance with your shell settings. - -You have now set everything up so that you can use the `adjust-dtt` tool. - -The APK that you are planning to distribute is signed; even if you have generated an "unsigned" version of the APK, Android Studio will still have signed it with a default debug signing keystore which exists on your machine. The most probable location for this is: - -``` -$HOME/.android/debug.keystore -``` - -If you are exporting a signed APK from Android Studio, then you are signing the APK with your custom signing keystore file. - -You will need to have access to either your default debug keystore file or your custom one in order to use the `adjust-dtt` tool. The reason for this is that the `apktool`, once used to unpack the APK, completely removes any signing from the APK, and once the APK is repacked following editing, signing is not re-enabled. Because of this, you will need to run the `jarsigner` tool and pass signing information to it in order to re-sign your APK so that it can be delivered and used on Android devices. - -If everything is ready, the only thing left to do is to create a tracker on the Adjust dashboard that you want to use as the default tracker for your pre-installed app and get its token. - -With all this information, you should be able to generate an `adjust-config.yaml` configuration file and fill it up with settings for each store you want your app to be published in for which you need to set up pre-installed tracker settings. - -Below, you can see an example `adjust-config.yaml` file which assumes that we want to build an APK for three different imaginary stores named **store_1**, **store_2** and **store_3**: - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: - store_1: - default_tracker: abc123 - store_2: - default_tracker: abc456 - store_3: - default_tracker: abc789 -``` - -You can set up following parameters: - -1. `apk_path` = Full path to your APK file (global and per store) -2. `keystore_path` = Full path to your keystore file used for APK signing (global and per store) -3. `keystore_pass` = Your keystore signing password (global and per store) -4. `keystore_alias` = Your keystore alias (global and per store) -5. `default_tracker` = Your pre-installed Adjust tracker token (per store only) - -The first four parameters can be defined globally in root if you want those settings to be used for every store for which you do not define that parameter. If you define a parameter globally and for the store, the specific store parameter will be used for APK generation. So, for example, the config file can look like this: - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: - store_1: - default_tracker: abc123 - keystore_path: /Users/uerceg/Desktop/apk/differentkeystore.jks - keystore_pass: differentkeystorepass - keystore_alias: differentkeystorealias - store_2: - default_tracker: abc456 - store_3: - default_tracker: abc789 -``` - -In this case, the `adjust-dtt` tool will use `differentkeystore.jks`, `differentkeystorepass` and `differentkeystorealias` when generating the APK for `store_1`. The **stores** parameter must be in the root, and inside of it you can define as many stores as you like. A modified APK file will be generated for each store. - -With the `adjust-config.yaml` file properly configured, you just need to run the `adjust-dtt` tool like this: - -``` -adjust-dtt adjust-config.yaml -``` - -**Note**: If you are unable to run the `adjust-dtt` tool, check if it has executive permissions assigned, and, if it does not, please run: - -``` -chmod +x adjust-dtt -``` - -Then try to run the `adjust-dtt` tool again. - -When you run the `adjust-dtt` tool, the following happens: - -1. Your app's APK file is unpacked and a folder bearing your APK's name is created in the folder where the APK file is located. -2. An assets folder is searched for followed by an `adjust_config.properties` file (which contains the default tracker info) within the assets folder. -3. If the assets folder or `adjust_config.properties` file do not exist, they are auto-created and the tracker passed as the `default_tracker` parameter is written to the config file. -4. If the APK already contains an `adjust_config.properties` file but the default tracker value isn't written in it, the `default_tracker` parameter value is written to the file. If the config file already contains a default tracker value, the existing value is compared with the one you passed to the command, and, if they differ, the one you passed to the command is used. -5. The APK is repacked. -6. The APK is signed with the information you passed as the values of the `keystore_path`, `keystore_pass` and `keystore_alias` parameters. -7. That's it. The generated APK will have the same name as your original one with a `_[store_name]` suffix appended to it. In the aobve example, we will get three APK files generated named `example-release_store_1.apk`, `example- release_store_2.apk` and `example-release_store_3.apk`. Feel free to rename them as you wish before you distribute them. - -If you have any questions or issues with this tool, feel free to contact us: support@adjust.com diff --git a/doc/english/plugins/criteo.md b/doc/english/plugins/criteo.md deleted file mode 100644 index c939778da..000000000 --- a/doc/english/plugins/criteo.md +++ /dev/null @@ -1,191 +0,0 @@ -## Criteo plugin - -If you are using Maven, add the following Criteo plugin dependency to your `build.gradle` file next to already existing dependency to Adjust SDK: - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.16.0' -implementation 'com.adjust.sdk:adjust-android-criteo:4.16.0' -``` - -You can also add Adjust Criteo plugin as JAR file which can be downloaded from our [releases page][releases]. - -Now you can integrate each of the different Criteo events, like in the following examples: - -### View Listing - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{viewListingEventToken}"); -List productIds = Arrays.asList("productId1", "productId2", "productId3"); -AdjustCriteo.injectViewListingIntoEvent(event, productIds); -Adjust.trackEvent(event); -``` - -### View Product - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{viewProductEventToken}"); -AdjustCriteo.injectViewProductIntoEvent(event, "productId1"); -Adjust.trackEvent(event); -``` - -### Cart - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{cartEventToken}"); -CriteoProduct product1 = new CriteoProduct(100, 1, "productId1"); -CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2"); -CriteoProduct product3 = new CriteoProduct(50, 2, "productId3"); - -List products = Arrays.asList(product1, product2, product3); -AdjustCriteo.injectCartIntoEvent(event, products); -Adjust.trackEvent(event); -``` - -### Transaction confirmation - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{transactionConfirmedEventToken}"); -CriteoProduct product1 = new CriteoProduct(100, 1, "productId1"); -CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2"); -CriteoProduct product3 = new CriteoProduct(50, 2, "productId3"); - -List products = Arrays.asList(product1, product2, product3); -AdjustCriteo.injectTransactionConfirmedIntoEvent(event, products, "transactionId", "newCustomerId"); -Adjust.trackEvent(event); -``` - -### User Level - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{userLevelEventToken}"); -AdjustCriteo.injectUserLevelIntoEvent(event, 1); -Adjust.trackEvent(event); -``` - -### User Status - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{userStatusEventToken}"); -AdjustCriteo.injectUserStatusIntoEvent(event, "uiStatusValue"); -Adjust.trackEvent(event); -``` - -### Achievement Unlocked - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{achievementUnlockedEventToken}"); -AdjustCriteo.injectAchievementUnlockedIntoEvent(event, "AchievementUnlocked"); -Adjust.trackEvent(event); -``` - -### Custom Event - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{customEventEventToken}"); -AdjustCriteo.injectCustomEventIntoEvent(event, "uiDataValue"); -Adjust.trackEvent(event); -``` - -### Custom Event 2 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{customEvent2EventToken}"); -AdjustCriteo.injectCustomEvent2IntoEvent(event, "uiData2Value", 3); -Adjust.trackEvent(event); -``` - -### Hashed Email - -It's possible to attach an hashed email in every Criteo event with the `injectHashedEmailIntoCriteoEvents` method. The hashed email will be sent with every Criteo event for the duration of the application lifecycle, so it must be set again when the app is re-lauched. The hashed email can be removed by setting the `injectHashedEmailIntoCriteoEvents` method with `null`. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectHashedEmailIntoCriteoEvents("8455938a1db5c475a87d76edacb6284e"); -``` - -### Search dates - -It's possible to attach a check-in and check-out date to every Criteo event with the `injectViewSearchDatesIntoCriteoEvent` method. The dates will be sent with every Criteo event for the duration of the application lifecycle, so it must be set again when the app is re-lauched. - -The search dates can be removed by setting the `injectViewSearchDatesIntoCriteoEvents` dates with `null`. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectViewSearchDatesIntoCriteoEvents("2015-01-01", "2015-01-07"); -``` - -### Partner ID - -It's possible to attach a partner ID in every Criteo event with the `injectPartnerIdIntoCriteoEvents` method. The partner id will be sent with every Criteo event for the duration of the application lifecycle, so it must be set again when the app is re-lauched. The partner ID can be removed by setting the `injectPartnerIdIntoCriteoEvents` method with `null`. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectPartnerIdIntoCriteoEvents("{CriteoPartnerId}"); -``` - -### Send deeplink - -For each activity that accepts deep links, find the onCreate method and add the folowing call: - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - Intent intent = getIntent(); - Uri data = intent.getData(); - - AdjustEvent event = new AdjustEvent("{deeplinkEventToken}"); - AdjustCriteo.injectDeeplinkIntoEvent(event, data); - Adjust.trackEvent(event); -} -``` - -### Customer ID - -It's possible to attach the customer ID to every Criteo event with the `injectCustomerIdIntoCriteoEvents` method. The customer ID will be sent with every Criteo event for the duration of the application life cycle, so it must be set again when the app is re-launched. - -The customer ID can be removed by setting the `injectCustomerIdIntoCriteoEvents` value to `null`. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectCustomerIdIntoCriteoEvents("{CriteoCustomerId}"); -``` - -### User Segment - -It's possible to attach the user segment to every Criteo event with the `injectUserSegmentIntoCriteoEvents` method. The user segment will be sent with every Criteo event for the duration of the application life cycle, so it must be set again when the app is re-launched. - -The user segment can be removed by setting the `injectUserSegmentIntoCriteoEvents` value to `null`. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectUserSegmentIntoCriteoEvents("{CriteoUserSegment}"); -``` - - -[releases]: https://github.com/adjust/android_sdk/releases diff --git a/doc/english/plugins/imei.md b/doc/english/plugins/imei.md deleted file mode 100644 index 9b20086b7..000000000 --- a/doc/english/plugins/imei.md +++ /dev/null @@ -1,61 +0,0 @@ -## IMEI plugin - -For specific markets, IMEI and MEID can be used for attribution on Android. In order to use this feature, please complete the [required steps][imei-doc] within your Adjust Dashboard and then use this plugin. - -This IMEI plugin respects the behavior of the Adjust Android SDK in terms of device ID reading **while additionally** allowing the Adjust SDK to read the IMEI and MEID values of a device. - -**Important:** This Adjust plugin is meant to be used only in apps that are **NOT being published to the Google Play Store**. - -Before using this plugin, please make sure that you have read official [Android SDK README][readme] and successfully completed Adjust SDK integration into your app. After that, please make sure to perform these additional steps if you want to enable Adjust SDK to collect and track IMEI identifier. - -### Add IMEI plugin to your app - -If you are using Maven, add the following IMEI plugin dependency to your `build.gradle` file next to already existing dependency to Adjust SDK: - -``` -implementation 'com.adjust.sdk:adjust-android:4.16.0' -implementation 'com.adjust.sdk:adjust-android-imei:4.16.0' -``` - -You can also add Adjust IMEI plugin as JAR file which can be downloaded from our [releases page][releases]. - -### Add permission - -Add the following permission, if it is not already present in your `AndroidManifest.xml` file: - -```xml - -``` - -Remember that after `Android 6.0` it might be necessary to [request app permission](https://developer.android.com/training/permissions/requesting) if the Android OS has not already been altered to avoid it. - -### Proguard settings - -Official `README` suggests which rules should be added assuming that your app will be published in Google Play Store. If this is not the case, feel free to remove all the rules related to Google Play Services and install referrer libraries. In that case, rules you need to add should look like this: - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### Use the plugin - -Finally, in order to read IMEI and MEID values, you need to call `AdjustImei.readImei()` before starting the SDK: - -```java -AdjustImei.readImei(); - -// ... - -Adjust.onCreate(config); -``` - -You can call a method `AdjustImei.doNotReadImei()` to stop the SDK from reading IMEI and MEID values. - -### Final note - -**Please keep in mind** that IMEI and MEID are persistent identifiers and that it is your responsibility to ensure that the collection and processing of this personal data from your app's end-users is lawful. - -[readme]: ../../../README.md -[releases]: https://github.com/adjust/android_sdk/releases -[imei-doc]: https://docs.adjust.com/en/imei-and-meid-attribution-for-android -[gps-adid]: ../gps_adid.md diff --git a/doc/english/plugins/oaid.md b/doc/english/plugins/oaid.md deleted file mode 100644 index 3fdf973ac..000000000 --- a/doc/english/plugins/oaid.md +++ /dev/null @@ -1,67 +0,0 @@ -## OAID plugin - -OAID is an advertising ID that the MSA (Mobile Security Alliance) announced all Chinese-manufactured devices should provide. You can use it to attribute and track Android devices in many markets where Google Play Services is not available. - -The OAID plugin enables the Adjust Android SDK to read a device’s OAID value *in addition* to the other device IDs it searches for by default. OAID is readable on all devices using the MSA SDK or HMS (Huawei Mobile Service) on Huawei devices. -Before getting started, make sure you have read the official [Android SDK README][readme] and successfully integrated the Adjust SDK into your app. - -To enable the Adjust SDK to collect and track OAID, follow these steps. To only use the plugin to read the OAID of Huawei devices, you can skip the step [Add the MSA SDK to your app](#add-msa-sdk). - -### Add the OAID plugin to your app - -If you are using Maven, add the following OAID plugin dependency to your `build.gradle` file next to the existing Adjust SDK dependency: - -``` -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.adjust.sdk:adjust-android-oaid:4.31.0' -``` - -You can also add the Adjust OAID plugin as JAR file, which you can download from our [releases page][releases]. - -### Add the MSA SDK to your app - -**Note:** It is not necessary to add the MSA SDK to read the OAID from Huawei devices. The OAID plugin can use the Huawei Mobile Service (version 2.6.2 or later) for this. - -To enable the OAID plugin to read OAID values using the MSA SDK, copy the MSA SDK (AAR file) to the libs directory of your project and set the dependency. You also need to copy the supplierconfig.json to the assets directory of your project. - -**Note**: MSA SDK version 1.0.13 and later is supported by Adjust OAID plugin v4.23.0 and later. MSA SDK versions of plugin prior to version 1.0.13 are supported by Adjust OAID plugin v4.22.0 and earlier. - -**Note**: MSA SDK version 1.0.23 and later is supported by Adjust OAID plugin v4.24.1 and later. - -You can find the MSA SDK and detailed instructions [here][msasdk]. - -### Proguard settings - -If you’re using Proguard and will not publish your app in the Google Play Store, you can remove all of the rules related to Google Play Services and install referrer libraries in the [SDK README][readme proguard]. - -Use all `com.adjust.sdk` package rules like this: - -``` --keep public class com.adjust.sdk.** { *; } -``` - -If you are adding the MSA SDK AAR as a dependency, then add the following rules: - -``` --keep class com.bun.miitmdid.core.** { *; } -``` - -### Use the plugin - -To read OAID values, call `AdjustOaid.readOaid(applicationContext)` before starting the SDK: - -```java -AdjustOaid.readOaid(applicationContext); - -// ... - -Adjust.onCreate(config); -``` - -To stop the SDK from reading OAID values, call `AdjustOaid.doNotReadOaid()`. - - -[readme]: ../../../README.md -[releases]: https://github.com/adjust/android_sdk/releases -[readme proguard]: https://github.com/adjust/android_sdk#qs-proguard -[msasdk]: http://www.msa-alliance.cn/col.jsp?id=120 diff --git a/doc/english/plugins/sociomantic.md b/doc/english/plugins/sociomantic.md deleted file mode 100644 index 84aa1ba1a..000000000 --- a/doc/english/plugins/sociomantic.md +++ /dev/null @@ -1,438 +0,0 @@ -## Sociomantic plugin - -If you are using Maven, add the following Sociomantic plugin dependency to your `build.gradle` file next to already existing dependency to Adjust SDK: - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.16.0' -implementation 'com.adjust.sdk:adjust-android-sociomantic:4.16.0' -``` - -You can also add Adjust Sociomantic plugin as JAR file which can be downloaded from our [releases page][releases]. - -You should have access to the Sociomantic events methods as well as constants that you should use for property names of your dictionaries: - -```java -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; -``` - -Before sending any Sociomantic you should set a partner id as shown below: - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustSociomantic.injectPartnerIdInSociomanticEvents("{sociomanticPartnerId}"); -``` - -Now you can integrate each of the different Sociomantic events, like in the following examples below. - -### Customer Event - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(HOMEPAGE_TOKEN); -Map customerData = new HashMap<>(); -customerData.put(AdjustSociomantic.SCMCustomerAgeGroup, "0"); - -AdjustSociomantic.injectCustomerDataIntoEvent(event, customerData); -Adjust.trackEvent(event); -``` - -### View Home Page - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(HOMEPAGE_TOKEN); -Adjust.trackEvent(event); -``` - -### View Listing - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(LISTING_TOKEN); -List 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); -``` - -### View Product - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(PRODUCT_VIEW_TOKEN); -Map product = new HashMap<>(); -List 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); -``` - -*Available product parameters for reporting product view:* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter nameRequirementDescriptionNote
SCMCategoryRequired*Product category (entire category path)Category information provided in the tracking code on category or listing pages should match the category information provided in the feed or in the tracking code of product pages.
SCMProductNameRequired*Product nameSpecial characters should not be encoded but provided in proper UTF-8. Do not use any HTML markup.
SCMSalePriceRequired*Sale price as decimal value (e.g. 2.99)Please use a dot as a decimal separator and do not use any thousand separators.
SCMAmountRequired*Regular price as decimal value (e.g. 3.99)Please use a dot as a decimal separator and do not use any thousand separators.
SCMCurrencyRequired*Currency code in ISO 4217 format (e.g. EUR)Fixed currency code. Should have been provided to you in the tracking code examples.
SCMProductURL>Required*Product URL (deeplink)Please provide a working deeplink ideally without any click tracking parameter (Google Analytics, HURRA, Eulerian, etc.), Please always use deeplinks with http://
SCMProductImageURLRequired*Product image URLPlease provide images in a reasonable size. For an optimal appearance in the ads the images should be at least 200x200px and should have the same aspect ratio.
SCMBrandRequired*Product brandSpecial characters should not be encoded but provided in proper UTF-8 (Same as SCMProductName above). Do not use any HTML markup.
SCMDescriptionOptionalShort product descriptionSpecial characters should not be encoded but provided in proper UTF-8 (Same as SCMProductName above). Do not use any HTML markup.
SCMTimestampOptionalTimestamp until when the product is available (please use GMT time)Please provide the date a visitor has searched for. It should be an NSTimeInterval wrapped in NSNumber (see example).
SCMValidityTimestampOptionalTimestamp until when the product is available (please use GMT time)Please provide the unix timestamp until when the product is available. Please use 0 for products that are always available. It should be an NSTimeInterval wrapped in NSNumber (Same as SCMTimestamp above).
SCMQuantityOptionalNumber of products in stockPlease integrate this field only after discussion with your personal Sociomantic contact
SCMScoreOptionalPriority score of the product (value range is between 0 to 10.0)Please integrate this field only after discussion with your personal Sociomantic contact
- -\*optional, if provided in the feed - -If you’re not certain what setup you should use please contact your Technical Account Manager at Sociomantic. - -### Cart - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(BASKET_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMCurrency, "EUR"); -product1.put(AdjustSociomantic.SCMQuantity, 1); - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); -AdjustSociomantic.injectCartIntoEvent(event, products); -Adjust.trackEvent(event); -``` - -*Available cart parameters for reporting cart view* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter nameRequirementDescriptionNote
SCMProductIDRequiredProduct IDPlease provide the product ID without any subIDs for any color or size variations.
SCMAmountOptionalProduct price as decimal value (e.g. 2.99)Please use a dot as a decimal separator and do not use any thousand separators. Please only provide price per product, even if quantity has a value larger than 1.
SCMCurrencyOptionalCurrency code in ISO 4217 format (e.g. EUR)Fixed currency code. Should have been provided to you in the tracking code examples.
SCMQuantityOptionalQuantity of the product selectedPlease use an integer value.
- -### Unconfirmed Transaction - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); -AdjustSociomantic.injectTransactionIntoEvent(event, "123456", products); -Adjust.trackEvent(event); -``` - -Or with parameters: - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); -Map parameters = new HashMap<>(); -parameters.put(AdjustSociomantic.SCMCurrency, "EUR"); -parameters.put(AdjustSociomantic.SCMAmount, 42); - -AdjustSociomantic.injectTransactionIntoEvent(event, "123456", products, parameters); - -Adjust.trackEvent(event); -``` - -### Confirmed Transaction - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); -AdjustSociomantic.injectConfirmedTransactionIntoEvent(event, "123456", products); -Adjust.trackEvent(event); -``` - -Or with parameters: - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); -Map parameters = new HashMap<>(); -parameters.put(AdjustSociomantic.SCMCurrency, "EUR"); -parameters.put(AdjustSociomantic.SCMAmount, 42); - -AdjustSociomantic.injectConfirmedTransactionIntoEvent(event, "123456", products, parameters); -Adjust.trackEvent(event); -``` - -*Available cart parameters for reporting transaction view* - -See cart parameters - -*Available transaction parameters for reporting transaction views* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter nameRequirementDescriptionNote
SCMAmountOptionalProduct price as decimal value (e.g. 2.99)Please use a dot as a decimal separator and do not use any thousand separators. Please only provide price per product, even if quantity has a value larger than 1.
SCMCurrencyOptionalCurrency code in ISO 4217 format (e.g. EUR)Fixed currency code. Should have been provided to you in the tracking code examples.
SCMQuantityOptionalQuantity of the product selectedPlease use an integer value.
- -### Lead Event - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(LEAD_TOKEN); -AdjustSociomantic.injectLeadIntoEvent(event, "123456"); -Adjust.trackEvent(event); -``` - -Or confirmed lead: - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(LEAD_TOKEN); -AdjustSociomantic.injectLeadIntoEvent(event, "123456", Boolean.TRUE); -Adjust.trackEvent(event); -``` - - -[releases]: https://github.com/adjust/android_sdk/releases diff --git a/doc/english/plugins/trademob.md b/doc/english/plugins/trademob.md deleted file mode 100644 index b94ecacd8..000000000 --- a/doc/english/plugins/trademob.md +++ /dev/null @@ -1,82 +0,0 @@ -## Trademob plugin - -If you are using Maven, add the following Trademob plugin dependency to your `build.gradle` file next to already existing dependency to Adjust SDK: - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.16.0' -implementation 'com.adjust.sdk:adjust-android-trademob:4.16.0' -``` - -You can also add Adjust Trademob plugin as JAR file which can be downloaded from our [releases page][releases]. - -For questions regarding this plugin, please reach out to `eugenio.warglien@trademob.com` - -You can now use Trademob event in the following ways: - -### View Listing - -```java -import com.adjust.sdk.plugin.AdjustTrademob; - -AdjustEvent event = new AdjustEvent("{viewListingEventToken}"); -List items = Arrays.asList("itemId1", "itemId2", "itemId3"); -Map metadata = new HashMap<>(); -metadata.put("info1", "value1"); -metadata.put("info2", "value2"); - -AdjustTrademob.injectViewListingIntoEvent(event, items, metadata); -Adjust.trackEvent(event); -``` - -### View Item - -```java -import com.adjust.sdk.plugin.AdjustTrademob; - -AdjustEvent event = new AdjustEvent("{viewItemEventToken}"); -Map metadata = new HashMap<>(); -metadata.put("info1", "value1"); -metadata.put("info2", "value2"); - -AdjustTrademob.injectViewItemIntoEvent(event, "itemId1", metadata); -Adjust.trackEvent(event); -``` - -### Add to Basket - -```java -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 items = Arrays.asList(itemId1, itemId2, itemId3); - -AdjustTrademob.injectAddToBasketIntoEvent(event, items, null); -Adjust.trackEvent(event); -``` - -### Checkout - -```java -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 items = Arrays.asList(itemId1, itemId2, itemId3); - -Map metadata = new HashMap<>(); -metadata.put("info1", "value1"); -metadata.put("info2", "value2"); - -AdjustTrademob.injectCheckoutIntoEvent(event, items, metadata); -Adjust.trackEvent(event); -``` - - -[releases]: https://github.com/adjust/android_sdk/releases diff --git a/doc/english/sdk-to-sdk/admob.md b/doc/english/sdk-to-sdk/admob.md deleted file mode 100644 index b42d005b6..000000000 --- a/doc/english/sdk-to-sdk/admob.md +++ /dev/null @@ -1,32 +0,0 @@ -# Track AdMob ad revenue with Adjust SDK - -[Adjust Android SDK README][android-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.28.0** - -> Note: In order to enable this feature, please reach out to your Google point of contact. Your point of contact will be able to activate the feature for you to access it. - -If you want to track your ad revenue with the Admob SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method. - -> Note: If you have any questions about ad revenue tracking with Admob, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com). - -### Example - -```java -rewardedAd.setOnPaidEventListener(new OnPaidEventListener() { - @Override - public void onPaidEvent(AdValue adValue) { - // ... - // send ad revenue info to Adjust - AdjustAdRevenue adRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_ADMOB); - adRevenue.setRevenue(adValue.getValueMicros() / 1000000.0, adValue.getCurrencyCode()); - Adjust.trackAdRevenue(adRevenue); - } -} -``` - -For more information on how to properly integrate and set up AdMob SDK, please check out the [official documentation](https://developers.google.com/admob/android/early-access/paid-events). - -[android-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/adobe.md b/doc/english/sdk-to-sdk/adobe.md deleted file mode 100644 index e1a4ae5aa..000000000 --- a/doc/english/sdk-to-sdk/adobe.md +++ /dev/null @@ -1,53 +0,0 @@ -## Integrate Adjust with the Adobe SDK - -To integrate Adjust with all Adobe SDK tracked events, you must send your Adjust attribution data to the Adobe SDK after receiving the attribution response from our backend. Follow the steps in the [attribution callback][attribution-callback] chapter of our Android SDK guide to implement this. To use the Adobe SDK API, the callback method can be set as the following: - -```java -public class YourApplicationClass extends Application { - @Override - public void onCreate() { - super.onCreate(); - - // Initialize Adobe SDK. - Config.setContext(this.getApplicationContext()); - Config.setDebugLogging(true); - - // Configure Adjust - AdjustConfig config = new AdjustConfig(this, appToken, environment); - - config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) { - Map adjustData = new HashMap(); - - // Do not change the key "Adjust Network". This key is being used in the Data Connector Processing Rule. - if (attribution.network != null) { - adjustData.put("Adjust Network", attribution.network); - } - // Do not change the key "Adjust Campaign". This key is being used in the Data Connector Processing Rule. - if (attribution.campaign != null) { - adjustData.put("Adjust Campaign", attribution.campaign); - } - // Do not change the key "Adjust Adgroup". This key is being used in the Data Connector Processing Rule. - if (attribution.adgroup != null) { - adjustData.put("Adjust Adgroup", attribution.adgroup); - } - // Do not change the key "Adjust Creative". This key is being used in the Data Connector Processing Rule. - if (attribution.creative != null) { - adjustData.put("Adjust Creative", attribution.creative); - } - - // Send Data to Adobe using Track Action. - Analytics.trackAction("Adjust Campaign Data Received", adjustData); - } - }); - - Adjust.onCreate(config); - } -} -``` - -Before you implement this interface, please take care to consider the [possible conditions for usage of some of your data][attribution-data]. - -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[attribution-callback]: ../../../README.md#af-attribution-callback diff --git a/doc/english/sdk-to-sdk/applovin-max.md b/doc/english/sdk-to-sdk/applovin-max.md deleted file mode 100644 index 2e7ea8be7..000000000 --- a/doc/english/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,29 +0,0 @@ -# Track AppLovin MAX ad revenue with Adjust SDK - -[Adjust Android SDK README][android-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.28.0** - -If you want to track your ad revenue with the AppLovin MAX SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, call the `trackAdRevenue` method with the source `AD_REVENUE_APPLOVIN_MAX`. - -> Note: If you have any questions about ad revenue tracking with AppLovin MAX, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com) - -### Example - -```java -@Override -public void onAdRevenuePaid(final MaxAd ad) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue( AdjustConfig.AD_REVENUE_APPLOVIN_MAX); - adjustAdRevenue.setRevenue(ad.getRevenue(), "USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.getNetworkName()); - adjustAdRevenue.setAdRevenueUnit(ad.getAdUnitId()); - adjustAdRevenue.setAdRevenuePlacement(ad.getPlacement()); - - Adjust.trackAdRevenue( adjustAdRevenue); -} - -``` - -[android-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/batch.md b/doc/english/sdk-to-sdk/batch.md deleted file mode 100644 index 5cfc37aaf..000000000 --- a/doc/english/sdk-to-sdk/batch.md +++ /dev/null @@ -1,38 +0,0 @@ -## Integrate Adjust with the Batch.com SDK - -To integrate Adjust with the Batch.com SDK, you must send your Adjust attribution data to the Batch SDK after receiving the attribution response from the Adjust backend. Follow the steps in the [attribution callback][attribution-callback] chapter of our Android SDK guide to implement this. To use the Batch.com SDK API, the callback method can be set as the following: - -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) { - // Initiate Batch user editor to set new attributes. - BatchUserDataEditor editor = Batch.User.editor(); - - if (attribution.network != null) { - editor.setAttribute("adjust_network", attribution.network); - } - if (attribution.campaign != null) { - editor.setAttribute("adjust_campaign", attribution.campaign); - } - if (attribution.adgroup != null) { - editor.setAttribute("adjust_adgroup", attribution.adgroup); - } - if (attribution.creative != null) { - editor.setAttribute("adjust_creative", attribution.creative); - } - - // Send new attributes to Batch servers. - editor.save(); - } -}); - -Adjust.onCreate(config); -``` - -Before you implement this interface, please consider the [possible conditions for usage of some of your data][attribution-data]. - -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[attribution-callback]: ../../../README.md#af-attribution-callback diff --git a/doc/english/sdk-to-sdk/helium-chartboost.md b/doc/english/sdk-to-sdk/helium-chartboost.md deleted file mode 100644 index 973c015d8..000000000 --- a/doc/english/sdk-to-sdk/helium-chartboost.md +++ /dev/null @@ -1,40 +0,0 @@ -# Track Helium Chartboost ad revenue with Adjust SDK - -[Adjust Android SDK README][android-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.1** - -If you want to track your ad revenue with the Helium SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, call the `trackAdRevenue` method with the source `AD_REVENUE_HELIUM_CHARTBOOST`. - -> Note: If you have any questions about ad revenue tracking with Helium Chartboost, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com) - -### Example - -```java -public void ilrdObserver (final HeliumImpressionData impData) { - final AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_HELIUM_CHARTBOOST); - // extract the ILRD payload - final JSONObject json = impData.getIlrdInfo(); - try { - final double adRevenue = json.getDouble("ad_revenue"); - final String currencyType = json.getString("currency_type"); - adjustAdRevenue.setRevenue(adRevenue, currencyType); - } catch (JSONException e) { - // error handling as either revenue or currency was not present - return; - } - // optional fields - final String networkName = json.optString("network_name"); // Helium demand network name - final String placementName = json.optString("placement_name"); // Helium placement name - final String lineItemName = json.optString("line_item_name"); // Helium line item name - adjustAdRevenue.setAdRevenueNetwork(networkName); - adjustAdRevenue.setAdRevenueUnit(placementName); - adjustAdRevenue.setAdRevenuePlacement(lineItemName); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[android-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/ironsource.md b/doc/english/sdk-to-sdk/ironsource.md deleted file mode 100644 index ae04524de..000000000 --- a/doc/english/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# Track ironSource ad revenue with Adjust SDK - -[Adjust Android SDK README][android-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.28.0** - -If you want to track your ad revenue with the ironSource SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, call the `trackAdRevenue` method with the source `AD_REVENUE_IRONSOURCE`. - -> Note: If you have any questions about ad revenue tracking with ironSource, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com) - -### Example - -```java -public void onImpressionSuccess (ImpressionData impressionData) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_IRONSOURCE); - adjustAdRevenue.setRevenue(impressionData.getRevenue(), "USD"); - // optional fields - adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdNetwork()); - adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnit()); - adjustAdRevenue.setAdRevenuePlacement(impressionData.getPlacement()); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[android-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/mixpanel.md b/doc/english/sdk-to-sdk/mixpanel.md deleted file mode 100644 index 65728b316..000000000 --- a/doc/english/sdk-to-sdk/mixpanel.md +++ /dev/null @@ -1,48 +0,0 @@ -## Integrate Adjust with Mixpanel SDK - -The Mixpanel API allows to register common properties to be sent in all activities as `super properties`, as it is explained in the [Mixpanel page][mixpanel-android]. To integrate adjust with all tracked events of Mixpanel, you must set the `super properties` after receiving the response data of each activity. Follow the steps of the [attribution callback][attribution-callback] chapter in our Android SDK guide to implement it. The callback method can be set as the following, to use the Mixpanel API: - -```java -public class YourApplicationClass extends Application { - @Override - public void onCreate() { - super.onCreate(); - // Configure Adjust. - AdjustConfig config = new AdjustConfig(this, appToken, environment); - - config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) { - MixpanelAPI mixpanel = MixpanelAPI.getInstance(context, MIXPANEL_TOKEN); - - // The Adjust properties will be sent with all future track calls. - JSONObject props = new JSONObject(); - insertJsonProperty(props, "[Adjust]Network", attribution.network); - insertJsonProperty(props, "[Adjust]Campaign", attribution.campaign); - insertJsonProperty(props, "[Adjust]Adgroup", attribution.adgroup); - insertJsonProperty(props, "[Adjust]Creative", attribution.creative); - - if (props.length() > 0) { - mixpanel.registerSuperProperties(props); - } - } - - private void insertJsonProperty(JSONObject props, String name, String value) { - try { - if (value != null) { - props.put(name, value); - } - } catch(JSONException e) { } - } - }); - - Adjust.onCreate(config); - } -} -``` - -Before you implement this interface, please take care to consider [possible conditions for usage of some of your data][attribution-data]. - -[mixpanel-android]: https://mixpanel.com/help/reference/android#superproperties -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[attribution-callback]: ../../../README.md#af-attribution-callback diff --git a/doc/english/sdk-to-sdk/mopub.md b/doc/english/sdk-to-sdk/mopub.md deleted file mode 100644 index b205c9eb8..000000000 --- a/doc/english/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,24 +0,0 @@ -## Track MoPub ad revenue with Adjust SDK - -[Adjust Android SDK README][android-readme] - -[MoPub Android documentation][mopub-docs] - -Minimal SDK version required for this feature: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -Inside of your MoPub SDK `onImpression` callback method implementation, make sure to invoke `trackAdRevenue` method of Adjust SDK like this: - -```java -public void onImpression(@NonNull final String adUnitId, @Nullable final ImpressionData impressionData) { - // Pass impression data JSON to Adjust SDK. - Adjust.trackAdRevenue(AdjustConfig.AD_REVENUE_MOPUB, impressionData.getJsonRepresentation()); -} -``` - -In case you have any questions about ad revenue tracking with MoPub, please contact your dedicated account manager or send an email to support@adjust.com. - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[android-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/unity.md b/doc/english/sdk-to-sdk/unity.md deleted file mode 100644 index 3ad845439..000000000 --- a/doc/english/sdk-to-sdk/unity.md +++ /dev/null @@ -1,41 +0,0 @@ -# Track Unity ad revenue with Adjust SDK - -[Adjust Android SDK README][android-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.1** - -If you want to track your ad revenue with the Unity SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, call the `trackAdRevenue` method with the source `AD_REVENUE_UNITY`. - -> Note: If you have any questions about ad revenue tracking with Unity, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com) - -For more information, see the Unity Mediation [API documentation](https://docs.unity.com/mediation/APIReferenceAndroid.html) and [impression event documentation](https://docs.unity.com/mediation/SDKIntegrationAndroidImpressionEvents.html). - -### Example - -```java -// implement an impression listener -final IImpressionListener impressionListener = new IImpressionListener() { - @Override - public void onImpression(@NonNull String adUnitId, @Nullable ImpressionData impressionData) { - // send impression data to Adjust - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_UNITY); - adjustAdRevenue.setRevenue(impressionData.getPublisherRevenuePerImpression(), impressionData.getCurrency()); - // optional fields - adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdSourceName()); - adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnitId()); - adjustAdRevenue.setAdRevenuePlacement(impressionData.getAdSourceInstance()); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); - } -}; - -// subscribe the impression listener to the impression event publisher -ImpressionEventPublisher.subscribe(impressionListener); - -// unsubscribe the impression listener from the impression event publisher -ImpressionEventPublisher.unsubscribe(impressionListener); -``` - -[android-readme]: ../../../README.md diff --git a/doc/japanese/README.md b/doc/japanese/README.md deleted file mode 100644 index 234345ab9..000000000 --- a/doc/japanese/README.md +++ /dev/null @@ -1,2291 +0,0 @@ -**このガイドはまもなく廃止されます。** - -このREADMEファイルはまもなく廃止されます。SDKのドキュメントはAdjustヘルプセンターに掲載されています。以下のリンクよりご覧ください。 - -* [English][en-helpcenter] -* [中文][zh-helpcenter] -* [日本語][ja-helpcenter] -* [한국어][ko-helpcenter] - -## 概要 - -これはネイティブAdjust™のAndroid SDKガイドです。Adjust™についての詳細はadjust.comをご覧ください。 - -Read this in other languages: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## 目次 - -## クイックスタート - - * [サンプルアプリ](#qs-example-apps) - * [基本的な導入方法](#qs-getting-started) - * [プロジェクトにSDKを追加](#sdk-add) - * [Google Play Servicesの追加](#qs-gps) - * [パーミッションの追加](#qs-permissions) - * [Proguard の設定](#qs-proguard) - * [インストールリファラー](#qs-install-referrer) - * [Google Play Referrer API](#qs-gpr-api) - * [Google Play Store のインテント](#qs-gps-intent) - * [HuaweiリファラーAPI](#qs-huawei-referrer-api) - * [アプリにSDKを実装](#qs-integrate-sdk) - * [基本設定](#qs-basic-setup) - * [Native App SDK](#qs-basic-setup-native) - * [WebView SDK](#qs-basic-setup-web) - * [セッショントラッキング](#qs-session-tracking) - * [APIレベルが14以降](#qs-session-tracking-api-14) - * [APIレベルが9〜13](#qs-session-tracking-api-9) - * [SDKシグネチャー](#qs-sdk-signature) - * [Adjustログ](#qs-adjust-logging) - * [アプリのビルド](#qs-build-the-app) - -### ディープリンク - - * [スタンダードディープリンク](#dl-standard) - * [ディファードディープリンク](#dl-deferred) - * [ディープリンクを介したリアトリビューション](#dl-reattribution) - * [リンクのresolution (解析と変換)](#link-resolution) - -### イベントトラッキング - - * [イベントトラッキング](#et-tracking) - * [収益のトラッキング](#et-revenue) - * [収益の重複排除 (deduplication)](#et-revenue-deduplication) - * [アプリ内購入認証](#et-purchase-verification) - -### カスタムパラメーター - - * [カスタムパラメーターの概要](#cp) - * [イベントパラメーター](#cp-event-parameters) - * [イベントコールバックパラメーター](#cp-event-callback-parameters) - * [イベントパートナーパラメーター](#cp-event-partner-parameters) - * [イベントコールバックID](#cp-event-callback-id) - * [セッションパラメーター](#cp-session-parameters) - * [セッションコールバックパラメーター](#cp-session-callback-parameters) - * [セッションパートナーパラメーター](#cp-session-partner-parameters) - * [ディレイスタート](#cp-delay-start) - -### 追加機能 - - * [Pushトークン (uninstall tracking)](#af-push-token) - * [アトリビューションコールバック](#af-attribution-callback) - * [広告収益のトラッキング](#af-ad-revenue) - * [サブスクリプション計測](#af-subscriptions) - * [イベントとセッションのコールバック](#af-session-event-callbacks) - * [ユーザーアトリビューション](#af-user-attribution) - * [デバイス ID](#af-device-ids) - * [Google Play 開発者サービスの広告ID](#af-gps-adid) - * [Amazonの広告ID (fire_adid)](#af-amazon-adid) - * [Adjust のデバイスID](#af-adid) - * [プリインストールトラッカー](#af-preinstalled-apps) - * [オフラインモード](#af-offline-mode) - * [トラッキングの無効化](#af-disable-tracking) - * [イベントバッファリング](#af-event-buffering) - * [バックグラウンドでのトラッキング](#af-background-tracking) - * [GDPR消去する権利(忘れられる権利)](#af-gdpr-forget-me) - * [サードパーティーとの共有](#af-third-party-sharing) - * [サードパーティーとの共有を無効にする](#af-disable-third-party-sharing) - * [サードパーティーとの共有を有効にする](#af-disable-third-party-sharing) - * [ユーザー同意による計測](#af-measurement-consent) - -### テストとトラブルシューティング - - * ["Session failed (Ignoring too frequent session...)"というエラーが出る](#tt-session-failed) - * [ブロードキャストレシーバーがインストールリファラーを受信していない](#tt-broadcast-receiver) - * [アプリ起動時にイベントを始動したい](#tt-event-at-launch) - -### ライセンス - - -## クイックスタート - -### サンプルアプリ - -Android サンプルアプリがexample ディレクトリ [`example-app-java`][example-java] および [`example-app-kotlin`][example-kotlin] directories)にあります。Webviewに使用するサンプルアプリは[`example-webbridge` directory][example-webbridge] 、Android TVのサンプルは [`example-app-tv`][example-tv]をご覧ください。をご覧ください。SDK実装の際は、Androidプロジェクトを開き、このサンプルをご参照ください。Androidプロジェクトを開くと、Adjust SDKの導入方法の実例を確認できます。 - -### 基本的な導入方法 - -Adjust SDKをAndroidプロジェクトに実装する手順を説明します。ここでは、Androidアプリケーションの開発にAndroid Studioが使用されていること、また、対象はAndroid APIレベル**9(Gingerbread)** 以降であることを条件に説明します。 - -### SDKをプロジェクトに追加する - -Mavenを使用している場合は、以下の内容を`build.gradle`ファイルに追加します。file: - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -アプリの WebView内でAdjust SDKを使用したい場合は、以下のdependencyを追加してください。 - -```gradle -implementation 'com.adjust.sdk:adjust-android-webbridge:4.31.0' -``` - -**注意**:WebView拡張機能用にサポートされている最小のAndroid APIレベルは17(Jelly Bean)です。 - -Adjust SDK およびWebView拡張機能をJAR ファイルとして追加し、Adjust[リリースページ][releases]からダウンロードすることもできます。 - -### Google Playサービスの追加 - -2014年8月1日より、Google Playストアのアプリには、端末をユニーク判別するために[Google Advertising ID(Google広告ID)][google-ad-id]の使用が義務付けられました。Adjust SDKでGoogle Advertising IDを使用するには、[Google Play Service][google-play-services]を導入する必要があります。導入済みでない場合は、以下の手順に沿って設定してください。アプリの`build.gradle`ファイルを開き、`dependencies`ブロックに次の行を追加してください。file: - -```gradle -implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' -``` - -**注意**:Adjust SDKは、Google Playサービスの一つである`play-services-analytics`ライブラリの特定のバージョンとは紐付いていませんので、必要に応じて最新バージョンをご使用ください。 - -### パーミッションの追加 - -`AndroidManifest.xml`ファイルにAdjust SDKに必要なパーミッションが存在しない場合は、以下を追加してください。 - -```xml - - -``` - -**Google Playストア以外の第三者ストアからアプリをリリースする**場合は、以下のパーミッションも追加してください。 - -```xml - -``` - -#### Google 広告IDを取得するためのパーミッションの追加 - -Android 12以上(APIレベル31)を対象としている場合、デバイスの広告IDを読み取るにはパーミッション「com.google.android.gms.AD_ID」を追加する必要があります。パーミッションを有効にするには、「AndroidManifest.xml」に次の行を追加します。 - -```xml - -``` - -詳細については、[Googleの`AdvertisingIdClient.Info` のドキュメント](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid) をご覧ください。 - -### Proguardの設定 - -Proguardをお使いの場合は、以下をProguardファイルに追加してください。 - -``` --keep class com.adjust.sdk.**{ *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.**{ *; } -``` - -**Google Playストア以外の第三者ストアからアプリをリリースする**場合は、`com.adjust.sdk`のパッケージ規定に従ってください。 - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### インストールリファラー - -アプリのインストールをアトリビューションソースに正確にアトリビュートするため、Adjustは**インストールリファラー**の情報を必要とします。そのために**Google Play Referrer API**かブロードキャストレシーバーを使用して、**Google Playストアのインテント**を取得します。 - -**重要**:Google Play Referrer APIは、Androidのインストールリファラーをより安全に提供し、またクリックインジェクションの不正に対抗する目的でGoogleが新たに導入したものです。アプリケーションでこれをサポートすることを**強く推奨します**。Google Playストアのインテントは、インストールのリファラー情報を取得する上で安全性が低い方法です。当面、新しいGoogle Play Referrer APIと並行して引き続き存在しますが、将来廃止される予定です。 - -#### Google Play Referrer API - -アプリでこのAPIをサポートするには、[SDKをプロジェクトに追加する](#qs-add-sdk)の章の手順に適切に従って、以下の行を`build.gradle`ファイルに追加していることを確認してください。file: - -``` -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -また、[Proguardの設定](#qs-proguard)の章をよく読んで、記載されているすべてのルール、特に、この機能に必要なルールが追加されていることを確認してください。 - -``` --keep public class com.android.installreferrer.**{ *; } -``` - -この機能は、**Adjust SDK v4.12.0以降**を使用している場合にサポートされます。 - -#### Google Playストアのインテント - -**注意**:Googleは、リファラー情報を提供するための`INSTALL_REFERRER`インテントの使用を2020年3月1日付で廃止することを[発表しました](https://android-developers.googleblog.com/2019/11/still-using-installbroadcast-switch-to.html) 。この方法でリファラー情報にアクセスしている場合は、[Google Play リファラーAPI](#qs-gpr-api)の方法に移行してください。 - -Google Play ストアの`INSTALL_REFERRER`インテントは、ブロードキャストレシーバーを使用して受信することをおすすめします。**ブロードキャストレシーバーを使用せずに`INSTALL_REFERRER`インテントを取得したい**場合、以下の`receiver`タグを`AndroidManifest.xml`の`application`タグ内に追加してください。 - -```xml - - - - - -``` - -Adjustはこのブロードキャストレシーバーを使用して、インストールのリファラー情報を取得し、バックエンドに転送します。 - -`INSTALL_REFERRER`インテントに対して既に他のブロードキャストレシーバーを使用している場合、[こちらの説明][referrer]に従って、Adjust ブロードキャストレシーバーを追加してください。 - -#### Huawei Referrer API - -v4.21.1以降より、Adjust SDKはHuawei App Galleryバージョン10.4以降のHuawei端末へのインストール計測をサポートしています。HuaweiリファラAPIの使用を開始するために連携手順を追加で設定する必要はありません。 - -### SDKをアプリに実装する - -まず最初に、基本的なセッショントラッキングを設定します。 - -### 基本設定 - -ネイティブアプリにSDKを実装する場合は、以下の[ネイティブアプリSDK](#qs-basic-setup-native)に示す手順に従ってください。SDKをアプリ内のWebViewで使用する場合は、以下の[WebView SDK](#qs-basic-setup-web)に示す手順に従ってください。 - -#### ネイティブアプリSDK - -SDKの初期化には、Android[アプリケーション][android-application]のグローバルクラスを使用することを推奨します。アプリ内に存在しない場合、以下の手順に従ってください。 - -- `Application`を継承したクラスを作成します。 -- アプリの`AndroidManifest.xml`ファイルを開き、`application`エレメントを確認します。 -- `android:name`属性を追加し、先頭にドット(.)を付けて新規アプリケーションのクラス名をセットします。 - - サンプルアプリの場合、`GlobalApplication`という名前の`Application`クラスを使用しているため、マニフェストファイルの設定は以下の通りになります。 - ```xml - - - ``` - -- `Application`クラスの`onCreate`メソッドをご確認いただき、無い場合は作成してください。また、以下のコードを追加してAdjust SDKを初期化してください。 - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - } - } - ``` - -`{YourAppToken}`をアプリトークンに差し替えてください。トークンは [dashboard] で確認できます。 - -アプリのビルドをテスト用(Sandbox)か本番用(Production)に分けるためには、SDK内の環境`environment`をいずれかにセットする必要があります。 - -```java -String environment = AdjustConfig.ENVIRONMENT_SANDBOX; -String environment = AdjustConfig.ENVIRONMENT_PRODUCTION; -``` - -**重要:** リリース前のテスト段階では、`AdjustConfig.ENVIRONMENT_SANDBOX`に設定してください。アプリをストアに申請する前に、SDKの環境を`AdjustConfig.ENVIRONMENT_PRODUCTION`に変更してください。再度開発やテストを行う場合は、設定を`AdjustConfig.ENVIRONMENT_SANDBOX`に戻してください。 - -Adjustはこの環境設定を使用して、本番用の計測数値とテスト端末からのテスト計測を区別してレポート画面に表示します。この値の設定には常に注意が必要ですが、購入イベントを計測する場合は特に気をつけてください。 - -#### Web Views SDK - -`WebView`オブジェクトのリファレンスを取得後: - -- `webView.getSettings().setJavaScriptEnabled(true)`を呼び出して、JavaScriptをWebViewで有効化します -- `AdjustBridge.registerAndGetInstance(getApplication(), webview)`をコールして`AdjustBridgeInstance`のデフォルトインスタンスを起動します起動します -- これにより、AdjustブリッジがWebViewのJavaScript Interfaceとして登録されます -- 必要に応じて、`AdjustBridge.setWebView()`を呼び出して新たな`WebView`を設定します -- `AdjustBridgeInstance` と `WebView`の登録を取り消す場合は`AdjustBridge.unregister()`を呼び出します - -これらの手順を行うと、アクティビティは以下のように記述されます。 - -```java -public class MainActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - WebView webView = (WebView) findViewById(R.id.webView); - webView.getSettings().setJavaScriptEnabled(true); - webView.setWebChromeClient(new WebChromeClient()); - webView.setWebViewClient(new WebViewClient()); - - AdjustBridge.registerAndGetInstance(getApplication(),webview); - try { - webView.loadUrl("file:///android_asset/AdjustExample-WebView.html"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void onDestroy() { - AdjustBridge.unregister(); - - super.onDestroy(); - } -} -``` - -この手順が完了すると、アプリに Adjust ブリッジが追加されます。JavaScript ブリッジは、Adjust のネイティブAndroid SDK と、WebViewにロードされるページの間での通信が可能となります。 - -HTMLファイルに、アセットのルートフォルダにある Adjust JavaScript をインポートしてください。HTML ファイルが同じ場所にある場合は、以下のような形でインポートできます: - -```html - - - - -``` - -JavaScript ファイルにリファレンスを追加したら、 HTML ファイル内でそれを使って Adjust SDK を初期化します: - -```js -let yourAppToken = '{YourAppToken}'; -let environment = AdjustConfig.EnvironmentSandbox; -let adjustConfig = new AdjustConfig(yourAppToken, environment); - -Adjust.onCreate(adjustConfig); -``` - -`{YourAppToken}`をアプリトークンに差し替えてください。トークンは[管理画面]で確認できます。 - -次に、まだテスト(Sandbox)を行っているか本番用モード(Production)にしているかに応じて、`environment`を対応する値に設定します: - -```js -let environment = AdjustConfig.EnvironmentSandbox; -let environment = AdjustConfig.EnvironmentProduction; -``` - -**重要:** アプリのテスト中は(その場合に限り)、値を`AdjustConfig.EnvironmentSandbox`に設定してください。アプリをストアに申請する前に、対象環境が`AdjustConfig.EnvironmentProduction`と設定されていることを確認してください。開発やテストを再開する場合は、値を`AdjustConfig.EnvironmentSandbox`に戻してください。 - -Adjustはこの環境設定を使用して、本番用の計測数値とテスト端末からのテスト計測を区別してレポート画面に表示します。この値の設定は常にご注意ください。 - -### セッショントラッキング - -**注意**:この手順は**非常に重要**です。**必ずアプリに正しく実装されていることを確認**してください。この実装を行うことにより、アプリ内のAdjust SDKで適切なセッション計測が可能になります。 - -#### APIレベルが14以降 - -- `ActivityLifecycleCallbacks`インターフェースを実装したプライベートクラスを追加します。このインターフェースを利用できなければ、そのアプリのAndroid APIレベルは14未満を対象としています。アクティビティをそれぞれ手動でアップデートする必要がありますので、こちらの[ガイド](#qs-session-tracking-api-9)を参照してください。以前に`Adjust.onResume`および`Adjust.onPause`のコールを使っていた場合、これらを削除する必要があります。 -- `onActivityResumed(Activity activity)`メソッドを編集して、`Adjust.onResume()`のコールを追加します。 -onActivityPaused(Activity activity)`メソッドを編集して、`Adjust.onPause()`のコールを追加します。 -- Adjust SDKの設定で、`onCreate()`メソッドを追加します。作成した`ActivityLifecycleCallbacks`のコールと、作成した`registerActivityLifecycleCallbacks`クラスのインスタンスを追加してください。 - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - - registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); - } - - private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks { - @Override - public void onActivityResumed(Activity activity) { - Adjust.onResume(); - } - - @Override - public void onActivityPaused(Activity activity) { - Adjust.onPause(); - } - - //... - } - } - ``` - -#### レベル9から13のAPI - -Gradleの`minSdkVersion`が`9`から`13`の場合、`14`以降にアップデートすると、今後の連携の手順が容易になります。Android公式[管理画面][android-dashboard]にて、最新バージョン関する情報をご確認ください。 - -セッショントラッキングを正しく行うためには、Acticityの開始または停止ごとにAdjust SDKの該当メソッドをコールする必要があります。この設定を行わないと、SDKはセッション開始やセッション終了を見落とす可能性があります。適切にセッションをトラッキングするには、**すべてのアクティビティに対して**以下の作業を行なってください。 - -- アクティビティの`onResume`中に`Adjust.onResume()`をコールしてください。必要に応じてメソッドを作成してください。 -- アクティビティの`onPause`中に`Adjust.onPause()`をコールしてください。必要に応じてメソッドを作成してください。 - -これらの手順を行うと、アクティビティは以下のように記述されます。 - -```java -import com.adjust.sdk.Adjust; - -public class YourActivity extends Activity { - protected void onResume() { - super.onResume(); - Adjust.onResume(); - } - protected void onPause() { - super.onPause(); - Adjust.onPause(); - } -} -``` - -これと同じ手順をアプリの**すべてのアクティビティ**に行なってください。後ほど新しいアクティビティを作成する場合、この手順を忘れないでください。コーディングスタイルの違いによって、すべてのアクティビティに対する共通のスーパークラスにこれを実装するという方法もあります。 - -### SDKシグネチャー - -アカウントマネージャーがAdjust SDKシグネチャーを有効化する必要があります。この機能を使用する場合は、Adjustのサポート(support@adjust.com)までお問い合わせください。 - -すでにアカウントでSDKシグネチャーが有効になっており、Adjust管理画面のアプリシークレット(App Secret)にアクセスできる場合は、以下の方法を使用してアプリにSDKシグネチャーを実装してください。 - -アプリシークレットは、設定するインスタンスで`setAppSecret`を呼び出して登録されます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); -config.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAppSecret(secretId,info1, info2, info3, info4); -Adjust.onCreate(adjustConfig); -``` -
- -### Adjustログの取得 - -Configインスタンスの`setLogLevel`に設定するパラメーターを変更することによって、記録するログのレベルを調節できます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -config.setLogLevel(LogLevel.VERBOSE); // enable all logs -config.setLogLevel(LogLevel.DEBUG); // disable verbose logs -config.setLogLevel(LogLevel.INFO); // disable debug logs (default) -config.setLogLevel(LogLevel.WARN); // disable info logs -config.setLogLevel(LogLevel.ERROR); // disable warning logs -config.setLogLevel(LogLevel.ASSERT); // disable error logs -config.setLogLevel(LogLevel.SUPRESS); // disable all logs -``` -
-Web View SDK -
- -```js -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // enable all logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug); // disable verbose logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo); // disable debug logs (default) -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn); // disable info logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelError); // disable warning logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert); // disable error logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); // disable all logs -``` -
- -すべてのログの出力を無効にする場合、ログレベルをsuppressに設定する他に、configオブジェクトのコンストラクタを使用してください (抑制されたログレベルがサポートされるべきかどうかを判定するboolean値が得られます)。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); -config.setLogLevel(LogLevel.SUPRESS); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment, true); -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); -Adjust.onCreate(adjustConfig); -``` -
- -### アプリのビルド - -Androidアプリをビルドして実行します。`LogCat`viewerにて`tag:Adjust`フィルターを設定し、他のすべてのログを非表示にすることができます。アプリが起動された後、`Install tracked`のログが出力されるはずです。 - -## ディープリンク - -### ディープリンク - -URLからアプリへのディープリンクを使ったAdjustトラッカーURLをご利用の場合、ディープリンクURLとその内容の情報を得ることが可能です。すでにアプリをインストールしている状態でそのURLを訪れる(スタンダードディープリンク)ユーザーもいれば、まだインストールしていないユーザーが開く(ディファードディープリンク)場合もあります。スタンダードディープリンクの場合、Androidのプラットフォームにはディープリンクの内容を取得できる仕組みがあります。ディファードディープリンクに対してはAndroidプラットフォームはサポートしていませんので、Adjust SDKがディープリンクの内容を取得するメカニズムを提供します。 - -### スタンダードディープリンク - -アプリをインストール済みのユーザーが`deep_link`パラメーターのついたAdjustのトラッカーURLをクリックした後にそのアプリを起動させたい場合は、アプリのディープリンクを有効化してください。**ユニークスキーム名**を選択し、トラッカーがクリックされてアプリが開いた時に起動させたいactivityを指定することで有効化できます。これは`AndroidManifest.xml`内で設定できます。マニフェストファルの該当のactivity定義に`intent-filter`セクションを追加し、該当のスキーム名に`android:scheme`プロパティを指定してください。 - -```xml - - - - - - - - - - - - - - -``` - -トラッカーURLのクリック後にアプリを起動させるには、AdjustトラッカーURLの`deep_link`パラメーターにあるスキーム名を指定する必要があります。ディープリンクに情報を追加していないトラッカーURLは次のようになります。 - -``` -https://app.adjust.com/abc123?deep_link=adjustExample%3A%2F%2F -``` - -`deep_link`パラメーターの値は**URLエンコードされる必要があります**。 - -トラッカーURLをクリック後、アプリが上記の設定をされていれば、アプリは`MainActivity`インテントの通りに起動します。`MainActivity`クラス内で`deep_link`パラメーターの内容が自動的に提供されます。届けられたこの情報はエンコード**されていません**が、URL内ではエンコードされています。 - -`AndroidManifest.xml`ファイルのactivityの`android:launchMode`設定によっては、`deep_link`パラメーターの内容情報はアクティビティファイルの適切な箇所に届けられます。`android:launchMode`のとり得る値について詳しくはAndroid[公式資料][android-launch-modes]をご確認ください。 - -指定のアクティビティに`Intent`オブジェクトを介してディープリンクの内容情報を送ることができる場所は2か所あります。activityの`onCreate`メソッドか`onNewIntent`メソッドのいずれかです。アプリが起動してこれらのどちらかのメソッドが呼ばれると、クリックURL中の`deep_link`パラメーター内の実際に渡されたディープリンクを取得することができます。この情報はロジックを追加する際に使うことができます。 - -これらのメソッドからディープリンク情報を抽出する方法は以下の通りです。 - -```java -@Override -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - // data.toString()-> This is your deep_link parameter value. -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - // data.toString()-> This is your deep_link parameter value. -} -``` - -### ディファードディープリンク - -ユーザーが`deep_link`パラメーターのついたトラッカーURLをクリックし、アプリ未インストールの場合はディファードディープリンクが作動します。クリックしたユーザーはアプリストアにリダイレクトされます。アプリをダウンロードし初回起動したタイミングで、`deep_link`パラメーターの内容がアプリに送信されます。 - -Adjust SDKはデフォルトでディファードディープリンクを開きます。追加設定の必要はありません。 - -#### ディファードディープリンクのコールバック - -コールバック関数を用いて、SDKがディファードディープリンクを開くかどうかを決めることができます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Evaluate the deeplink to be launched. -config.setOnDeeplinkResponseListener(newOnDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - // ... - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; - } - } -}); - -Adjust.onCreate(config); -``` - -Adjust SDKがサーバーからディープリンク情報を受信すると、リスナ内のディープリンク内容の情報を送信しますので、`boolean`値を返してください。この値はAdjust SDKがディープリンクから指定したスキーム名へアクティビティを起動させたいかどうかで決定してください。スキーム名の指定はスタンダードディープリンクと同様です。 - -`true`を返すと、[スタンダードディープリンク](#dl-standard)の章で説明したものと同様に起動します。SDKにアクティビティをスタートさせたくない場合、リスナから`false`を返してください。ディープリンクの内容に基づいてアプリの次の挙動を決定してください。 -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setDeferredDeeplinkCallback(function(deeplink) {}); - -Adjust.onCreate(adjustConfig); -``` - -このディファードディープリンクのシナリオでは、Configオブジェクトにもう1つの設定を追加できます。Adjust SDK がディファードディープリンクに関する情報を入手すると、SDK で URL を開くかどうかを選択できます。このオプションについては、Configオブジェクトで`setOpenDeferredDeeplink`メソッドをコールして設定します: - -```js -// ... - -function deferredDeeplinkCallback(deeplink) {} - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setOpenDeferredDeeplink(true); -adjustConfig.setDeferredDeeplinkCallback(deferredDeeplinkCallback); - -Adjust.start(adjustConfig); - -``` - -コールバックを設定しない場合、**Adjust SDK はデフォルトで常にURLを立ち上げようとする**ことにご注意ください。 -
- -### ディープリンクを介したリアトリビューション - -Adjustはディープリンクを使ったリエンゲージメントキャンペーンをサポートしています。詳しくは[公式資料][reattribution-with-deeplinks]をご覧ください。 - -この機能をご利用の場合は、ユーザーが正しくリアトリビューションされるために、Adjust SDKへのコールを追加してください。 - -アプリでディープリンクの内容データを受信したら、`Adjust.appWillOpenUrl(Uri, Context)`メソッドへのコールを追加してください。このコールによって、Adjust SDKはディープリンクの中に新たなアトリビューションが存在するかを調べ、あった場合はAdjustサーバーにこれを送信します。ディープリンクのついたAdjustトラッカーURLのクリックによってユーザーがリアトリビュートされる場合、[アトリビューションコールバック](#af-attribution-callback)がこのユーザーの新しいアトリビューションデータで呼ばれます。 - -`Adjust.appWillOpenUrl(Uri, Context)`のコールは下記のようになります。 - -```java -@Override -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -**注**: Android SDK v4.14.0より、`Adjust.appWillOpenUrl(Uri)`メソッドは**deprecated(推奨されていません)** と表示されます。代わりに`Adjust.appWillOpenUrl(Uri,Context)`メソッドを使用してください。 - -**Web viewに関する注意**:このコールは、web viewから関数`Adjust.appWillOpenUrl`をJavascript でこのように作成することもできます: - -```js -Adjust.appWillOpenUrl(deeplinkUrl); -``` - -### リンクのresolution (解析と変換 - -Emailサービスプロバイダー(ESP)独自のカスタムトラッキングリンク経由でディープリンクを使用したり、クリックを計測する必要がある場合は、`AdjustLinkResolution`クラスの`resolveLink`メソッドを使用してリンクをresolve(解析し、変換すること)します。これにより、アプリでディープリンクが開かれた時に、メール計測キャンペーンとのインタラクションを記録できます。 - -`resolveLink`メソッドでは、以下のパラメーターが使用できます。 - -- `url` - アプリを起動したディープリンク -- `resolveUrlSuffixArray` - リンクの解析が必要な、設定済みキャンペーンのカスタムドメイン -- `adjustLinkResolutionCallback` - 最終的なURLを含むコールバック - -受信したリンクが`resolveUrlSuffixArray`で指定されたドメインのいずれにも属さない場合、コールバックはディープリンクURLをそのまま転送します。リンクが指定されたドメインのいずれかを含む場合、SDKはリンクの解析を試み、`callback`パラメーターにディープリンクを返します。返されたディープリンクは、`Adjust.appWillOpenUrl`メソッドを使ってAdjust SDKでリアトリビュートすることも可能です。 - -> **注**: URLの解析と変換が行われると、SDKは自動的に最大10のリダイレクトをフォローします。さらに、SDKはフォローした最新のURLを`callback` URLとして返します。つまり、フォローするリダイレクトが10個を超える場合は**10番目のリダイレクトURL**が返されます。 - -**例** - -```java -AdjustLinkResolution.resolveLink(url, - new String[]{"example.com"}, - new AdjustLinkResolution.AdjustLinkResolutionCallback() { - @Override - public void resolvedLinkCallback(Uri resolvedLink) { - Adjust.appWillOpenUrl(resolvedLink, getApplicationContext()); - } -}); -``` - -### イベントトラッキング - -### イベントトラッキング - -Adjustを使ってアプリ内のイベントをトラッキングすることができます。ここではあるボタンのタップを毎回トラックするケースを想定して説明します。[管理画面][dashboard]にてイベントトークンを作成します。そのイベントトークンは仮に`abc123`とします。タップをトラックするため、ボタンの`onClick`メソッドに以下のような記述を追加します。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` -
- -### 収益のトラッキング - -広告へのタップはもちろん、アプリ内購入の発生時もトラッキングが可能です。例えば、1回のタップで1ユーロセントの報酬と仮定すると、報酬イベントを以下のようにトラッキングできます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01,"EUR"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01,'EUR'); -Adjust.trackEvent(adjustEvent); -``` -
- -これはコールバックパラメーターと紐付けることができます。 - -通貨トークンを設定する場合、Adjustは自動的に収益を任意の報酬に変換します。詳しくは[通貨の変換][currency-conversion]をご覧ください。 - -アプリ内購入をトラッキングする際は、支払いが終了し、アイテムが購入された後に`trackEvent`をコールするようにしてください。実際に発生しなかった収益イベントをトラッキングしてしまうのを防ぐためです。 - -収益とイベントトラッキングについては[イベントトラッキングガイド][event-tracking]もご参照ください。 - -### 収益の重複排除 - -オプションとしてオーダーIDを追加することにより、収益イベントが重複してトラッキングされるのを防ぐことができます。これを実行すると、10個前までのオーダーIDが記憶され、収益イベントに紐づけられたオーダーIDが重複している場合、そのイベントを排除します。これは、アプリ内購入の計測に特に有効です。以下の例をご参照ください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01,"EUR"); -adjustEvent.setOrderId("{OrderId}"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01,'EUR'); -adjustEvent.setOrderId('{OrderId}'); -Adjust.trackEvent(event); -``` -
- -### アプリ内購入認証 - -Adjustのサーバーサイドのレシート認証ツール、[購入認証(Purchase Verification)][android-purchase-verification]を使ってアプリ内で行われたアプリ内収益の妥当性を調べる際は、 Android purchase SDKをご利用ください。詳しくはこちらをご覧ください。 - -## カスタムパラメーター - -### カスタムパラメーター - -Adjust SDKがデフォルトで収集するローデータに加えて、Adjust SDKを使用してカスタム値(ユーザーID、製品IDなど)を必要な数だけトラッキングし、イベントまたはセッションに追加できます。カスタムパラメーターはローデータとして転送されます。Adjust管理画面には**表示されません**。 - -Adjust SDK が標準仕様で取得するパラメーター(IDFAなど)に加え、Adjust SDK を使ってカスタム値(クライアント様が保有するユーザー ID、商品 ID など)をイベントまたはセッションに追加することができます。カスタムパラメーターは、コールバック経由でのみ送信が可能で、Adjust管理画面のレポートには表示されません。社内と外部パートナー双方の利用目的で値をトラッキングする場合は(例えば商品 ID など)、リアルタイムコールバックとパートナーパラメーターの両方にてトラッキングすることを推奨します。 - - -### イベントパラメーター - -### イベントコールバックパラメーター - -[管理画面]でイベントにコールバックURLを登録することができます。イベントがトラッキングされるたびにそのURLにGETリクエストが送信されます。トラッキングする前にイベントで`addCallbackParameter`をコールすることによって、イベントにコールバックパラメーターを追加できます。AdjustはそれらのパラメーターをコールバックURLに追加します。 - -例えば、コールバックURLに `http://www.example.com/callback`と登録した場合、次のようにイベントをトラッキングします。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addCallbackParameter("key","value"); -adjustEvent.addCallbackParameter("foo","bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addCallbackParameter('key','value'); -adjustEvent.addCallbackParameter('foo','bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -この場合、Adjustは以下のGETリクエストを送信します。 - -``` -http://www.example.com/callback?key=value&foo=bar -``` - -Adjustはさまざまなパラメーターをサポートしています。例えば`{gps_adid}`はパラメーター値として利用できます。コールバック内で、このプレースホルダーは該当デバイスのGoogle Play Service IDに置き換えられます。独自に設定されたパラメーターには何も格納されませんが、コールバックに追加されます。イベントにコールバックを登録していない場合、Adjustがこれらのパラメーターを読むことはありません。 - -URLコールバックについて詳しくは[コールバックガイド][callbacks-guide]をご覧ください。利用可能な値のリストもこちらで参照してください。 - -### イベントパートナーパラメーター - -Adjustの管理画面上で連携が有効化されているネットワークパートナーに送信するパラメーターを設定することができます。 - -これは上記のコールバックパラメーターと同様に機能しますが、イベントインスタンスの`addPartnerParameter`メソッドをコールすることにより追加されます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addPartnerParameter("key","value"); -adjustEvent.addPartnerParameter("foo","bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addPartnerParameter('key','value'); -adjustEvent.addPartnerParameter('foo','bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -スペシャルパートナーとの連携方法の詳細については、[スペシャルパートナーガイド スペシャルパートナー][integrated-partners]をご覧ください。 - -### イベントコールバックID - -トラッキングしたいイベントにカスタムIDを追加できます。このIDはイベントをトラッキングし、成功か失敗かの通知を受け取けとれるようコールバックを登録することができます。イベントインスタンスに`setCallbackId`メソッドをコールしてこのIDを設定してください: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setCallbackId("Your-Custom-Id"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setCallbackId('Your-Custom-Id'); -Adjust.trackEvent(adjustEvent); -``` -
- -### セッションパラメーター - -いくつかのパラメーターは、Adjust SDKの**イベント**ごと、**セッション**ごとに送信するために保存されます。このいずれかのパラメーターを追加すると、これらはローカルに保存されるため、毎回追加する必要はありません。同じパラメーターを再度追加しても何も起こりません。 - -これらのセッションパラメーターはAdjust SDKが起動する前にコールすることができます。インストール時にパラメーターを送信したい場合は、Adjust SDKの初回起動を[遅らせる](#delay-start)ことができます。ただし、必要なパラメーターの値を得られるのは起動後となります。 - -### セッションコールバックパラメーター - -[イベント](#event-callback-parameters)で設定された同じコールバックパラメーターを、 Adjust SDKのイベントごとまたはセッションごとに送信するために保存することもできます。 - -セッションコールバックパラメーターのインターフェイスとイベントコールバックパラメーターは似ています。イベントにキーと値を追加する代わりに、Adjustの`Adjust.addSessionCallbackParameter(String key, String value)`へのコールで追加されます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustEvent.addCallbackParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` -
- -セッションコールバックパラメーターは、イベントに追加されたコールバックパラメーターとマージされます。イベントに追加されたコールバックパラメーターは、セッションコールバックパラメーターより優先されます。イベントに追加されたコールバックパラメーターがセッションから追加されたパラメーターと同じキーを持っている場合、イベントに追加されたコールバックパラメーターの値が優先されます。 - -`Adjust.removeSessionCallbackParameter(String key)`メソッドに指定のキーを渡すことで、特定のセッションパートナーパラメーターを削除することができます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent.addCallbackParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionCallbackParameter('foo'); -``` -
- -セッションコールバックパラメーターからすべてのキーと値を削除したい場合は、`Adjust.resetSessionCallbackParameters()`メソッドを使ってリセットすることができます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.resetSessionCallbackParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionCallbackParameters(); -``` -
- -### セッションパートナーパラメーター - -Adjust SDKのイベントごとやセッションごとに送信される[セッションコールバックパラメーター](#session-callback-parameters)があるように、セッションパートナーパラメーターも用意されています。 - -これらはAdjustのネットワークパートナーに送信されます。Adjust[管理画面]のパートナー設定で有効化された連携に利用されます。 - -セッションパートナーパラメーターのインターフェイスとイベントパートナーパラメーターは似ています。イベントにキーと値を追加する代わりに、`Adjust.addSessionPartnerParameter(String key, String value)`へのコールで追加されます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustEvent.addCallbackParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionPartnerParameter('foo', 'bar'); -``` -
- -セッションパートナーパラメーターはイベントに追加されたパートナーパラメーターとマージされます。イベントに追加されたパートナーパラメーターは、セッションパートナーパラメーターより優先されます。イベントに追加されたパートナーパラメーターがセッションから追加されたパラメーターと同じキーを持っている場合、イベントに追加されたパートナーパラメーターの値が優先されます。 - -`Adjust.removeSessionPartnerParameter(String key)`メソッドに指定のキーを渡すことで、特定のセッションパートナーパラメーターを削除することができます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.removeSessionPartnerParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionPartnerParameter('foo'); -``` -
- -セッションパートナーパラメーターからすべてのキーと値を削除したい場合は、`Adjust.resetSessionPartnerParameters()`メソッドを使ってリセットすることができます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.resetSessionPartnerParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionPartnerParameters(); -``` -
- -### ディレイスタート - -Adjust SDKの初回起動を遅らせると、ユニークID(会員ID)などのセッションパラメーターを取得してインストール時に送信できるようになります。 - -Configインスタンスの`setDelayStart`メソッドで、ディレイタイムを秒単位で設定できます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
-Web View SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
- -この場合、Adjust SDKは最初のインストールセッションと生成されるイベントを5.5秒間は送信しません。設定された時間が過ぎるまで、もしくは`Adjust.sendFirstPackages()`がコールされるまで、セッションパラメーターはすべてディレイインストールセッションとイベントに追加され、Adjust SDKは通常通り再開します。 - -**Adjust SDKのディレイスタートは最大で10秒です**。 - - -## 追加機能 - -プロジェクトにAdjust SDKを連携させると、以下の機能をご利用できるようになります。 - -### Pushトークン (uninstall tracking) - -Pushトークンは、オーディエンスビルダーやコールバックに使用されます。また、アンインストールや再インストールのトラッキングにも必要です。 - -Push通知のトークンを送信する場合は、トークンを取得したら(あるいはその値が変更される度に)、Adjustに以下のコールを追加してください: - - - - - - - - - - - - - - -
-Native SDK -
- -```java -Adjust.setPushToken(pushNotificationsToken, context); -``` - -シグネチャーに`context`を追加しアップデートすると、SDKはより多くのシナリオに沿ってPushトークンを送信することができます。上記のメソッドを使用することを推奨します。 - -しかし、`context`が追加されない場合でも、Adjustは引き続き、同じメソッドを使用する過去のシグネチャーをサポートします。 - -
-Web View SDK -
- -```js -Adjust.setPushToken(pushNotificationsToken); -``` -
- -### アトリビューションコールバック - -トラッカーのアトリビューション変化の通知を受けるために、リスナーを登録することができます。アトリビューションには複数の流入元が紐づく可能性があるため、この情報は同時に送ることができません。 - -[アトリビューションデータに関するポリシー][attribution-data]を必ずご確認ください。 - -Configインスタンスで、SDKをスタートする前に以下のアトリビューションコールバックを追加してください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -config.setOnAttributionChangedListener(newOnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) {} -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function attributionCallback(attribution) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAttributionCallback(attributionCallback); -Adjust.onCreate(adjustConfig); -``` -
- -リスナーはSDKが最後のアトリビューションデータを取得した時に呼ばれます。リスナーの機能で`attribution`パラメーターを確認することができます。このパラメーターのプロパティの概要は以下のとおりです。 - -- `trackerToken`最新アトリビューションのトラッカートークン -- `trackerName`最新アトリビューションのトラッカー名 -- `network`最新アトリビューションの流入元名 -- `campaign`最新アトリビューションのキャンペーン名 -- `adgroup`最新アトリビューションのアドグループ名 -- `creative`最新アトリビューションのクリエイティブ名 -- `clickLabel`最新アトリビューションのクリックラベル -- `adid`AdjustユニークID(Adjust Device ID) -- `costType`コストタイプの文字列 -- `costAmount`コストの金額 -- `costCurrency` コスト通貨の文字列 - -**注**:コストデータ - `costType`、`costAmount`および`costCurrency`は、`setNeedsCost`メソッドを呼び出して`AdjustConfig`で設定された場合にのみ利用可能です。設定されていない場合、あるいは設定されていてもアトリビューションの一部でない場合は、これらのフィールドは`null`の値を持ちます。この機能はSDK v4.25.0以降のみ利用可能です。 - -### サブスクリプション計測 - -**注**:この機能はネイティブのSDK v4.22.0以降のみ利用可能です。 - -Play Storeのサブスクリプションをトラッキングし、それぞれの有効性をAdjust SDKで確認できます。サブスクリプションの購入が完了したら、次のようにAdjust SDKを呼び出します。 - - - - - - - - -
-Native App SDK -
- -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` -
- -Subscription tracking parameters: - -- [price](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros) -- [currency](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode) -- [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku) -- [orderId](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid) -- [signature](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsignature) -- [purchaseToken](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetoken) -- [purchaseTime](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetime) - -イベント計測と同様に、コールバックやパートナーのパラメーターをサブスクリプションオブジェクトに付与できます。 - -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -// コールバックパラメーターの追加 -subscription.addCallbackParameter("key","value"); -subscription.addCallbackParameter("foo","bar"); - -// パートナーパラメーターの追加 -subscription.addPartnerParameter("key","value"); -subscription.addPartnerParameter("foo","bar"); - -Adjust.trackPlayStoreSubscription(subscription); -``` - -### 広告収益のトラッキング - -**注**:この機能はネイティブのSDK v4.18.0以降のみ利用可能です。 - -Adjust SDKを利用して、以下のメソッドを呼び出し広告収益情報を計測することができます。 - - - - - - - - -
-Native App SDK -
- -```java -Adjust.trackAdRevenue(source, payload); -``` -
- -Adjust SDKにパスするメソッドの引数は以下の通りです。 - -- `source` - 広告収益情報のソースを指定する`String`オブジェクト -- `payload` - `広告収益のJSONを格納する`JSONObject`オブジェクト - -現在、弊社は以下の`source`パラメータの値のみ対応しています。 - -- `AD_REVENUE_MOPUB` - メディエーションプラットフォームのMoPubを示します。(詳細は、[統合ガイド][sdk2sdk-mopub]を参照ください) - -### イベントとセッションのコールバック - -イベントとセッションの双方もしくはどちらかをトラッキングし、成功か失敗かの通知を受け取れるようリスナーを登録することができます。リスナーには4種類あります。それらは、トラッキングに成功したイベント、トラッキングに失敗したイベント、トラッキングに成功したセッション、トラッキングに失敗したイベントです。Configオブジェクトを生成すると、リスナーをいくつでも追加することができます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Set event success tracking delegate. -config.setOnEventTrackingSucceededListener(newOnEventTrackingSucceededListener() { - @Override - public void onFinishedEventTrackingSucceeded(AdjustEventSuccess eventSuccessResponseData) { - // ... - } -}); - -// Set event failure tracking delegate. -config.setOnEventTrackingFailedListener(newOnEventTrackingFailedListener() { - @Override - public void onFinishedEventTrackingFailed(AdjustEventFailure eventFailureResponseData) { - // ... - } -}); - -// Set session success tracking delegate. -config.setOnSessionTrackingSucceededListener(newOnSessionTrackingSucceededListener() { - @Override - public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess sessionSuccessResponseData) { - // ... - } -}); - -// Set session failure tracking delegate. -config.setOnSessionTrackingFailedListener(newOnSessionTrackingFailedListener() { - @Override - public void onFinishedSessionTrackingFailed(AdjustSessionFailure sessionFailureResponseData) { - // ... - } -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function eventSuccessCallback(eventSuccessResponseData) {} -function eventFailureCallback(eventFailureResponseData) {} -function sessionSuccessCallback(sessionSuccessResponseData) {} -function sessionFailureCallback(sessionFailureResponseData) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setEventSuccessCallback(eventSuccessCallback); -adjustConfig.setEventFailureCallback(eventFailureCallback); -adjustConfig.setSessionSuccessCallback(sessionSuccessCallback); -adjustConfig.setSessionFailureCallback(sessionFailureCallback); -Adjust.onCreate(adjustConfig); -``` -
- -リスナー関数はSDKがサーバーにパッケージ送信を試みた後で呼ばれます。リスナー関数内でリスナー用のレスポンスデータオブジェクトを確認することができます。レスポンスデータのプロパティの概要は以下の通りです。 - -- `message` サーバーからのメッセージまたはSDKのエラーログ -- `timestamp`サーバーからのタイムスタンプ -- `adid`Adjustから提供されるユニークデバイスID -- `jsonResponse`サーバーからのレスポンスのJSONオブジェクト - -どちらのイベントレスポンスデータオブジェクトも以下を含みます。 - -- `eventToken`トラッキングされたパッケージがイベントだった場合、そのイベントトークン -- `callbackId`イベントオブジェクトにカスタム設定されたコールバックID - -失敗したイベントとセッションは以下を含みます。 - -- `willRetry`後にパッケージ再送を試みる予定であるかどうかを示すboolean - -### ユーザーアトリビューション - -[アトリビューションコールバック](#af-attribution-callback)で説明したとおり、アトリビューション情報に変更がある度に、このコールバックが起動されます。`Adjust` インスタンスの以下のメソッドをコールすることで、必要な時にいつでもユーザーの最新のアトリビューション情報にアクセスすることができます: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustAttribution attribution = Adjust.getAttribution(); -``` -
-Web View SDK -
- -```js -let attribution = Adjust.getAttribution(); -``` -
- -**注意**: このコールは、Adjust SDK v4.11.0**以上**で使用が可能です。 - -**注意**: 最新のアトリビューション情報は、Adjustがバックエンドで行うアプリインストールのトラッキングが完了し、アトリビューションコールバックがトリガーされた後にのみ利用が可能となります。SDKが初期化され、アトリビューションコールバックがトリガーされる前には、ユーザーのアトリビューション値にアクセスすることが**できません**。 - -### デバイスID - -Adjust SDK を使って、デバイス ID を取得することもできます。 - -### Google Play 開発者サービスの広告ID(gps_adid) - -Google Analyticsなどの一部のサービスでは、レポートの重複を防ぐためにデバイスIDとクライアントIDを連携させることが求められます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -Google 広告IDは、バックグラウンドでのスレッドでしか読み込みできないという制約があります。コンテキストのある`getGoogleAdId`関数と`OnDeviceIdsRead`インスタンスをコールすると、あらゆる条件で取得できるようになります。 - -```java -Adjust.getGoogleAdId(this, new OnDeviceIdsRead() { - @Override - public void onGoogleAdIdRead(String googleAdId) {} -}); -``` -
-Web View SDK -
- -デバイスの Google 広告デバイス ID を取得する際には、Google 広告 ID を引数として受け取る`Adjust.getGoogleAdId`に対して、以下のようなコールバック機能を渡す必要があります。 - -```js -Adjust.getGoogleAdId(function(googleAdId) { - // ... -}); -``` -
- -### Amazonの広告ID (fire_adid) - -Amazonの広告 ID を取得する必要がある場合は、`Adjust`インスタンスで、以下のメソッドを呼び出します: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -String amazonAdId = Adjust.getAmazonAdId(context); -``` -
-Web View SDK -
- -```js -let amazonAdId = Adjust.getAmazonAdId(); -``` -
- -### AdjustのデバイスID (adid) - -アプリがインストールされている各デバイスに対して、Adjust は、バックエンドでユニークな **Adjust デバイス ID (adid)** を生成します。この ID を取得するためには、`Adjust`インスタンスで、以下のメソッドを呼び出してください: - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -String adid = Adjust.getAdid(); -``` -
-Web View SDK -
- -```js -let adid = Adjust.getAdid(); -``` -
- -**注意**: このコールは、Adjust SDK v4.11.0**以降**で使用が可能です。 - -**注意**:**adid**に関する情報は、Adjustがバックエンドで行うアプリインストールのトラッキングが完了後のみ利用可能となります。SDKが初期化されてアプリインストールのトラッキングが完了しないと、**adid**値にアクセスすることは**できません**。 - -### プリインストールのトラッカー - -Adjust SDKは、出荷直後のスマートフォンにプリインストールされたアプリの初回起動を計測することが可能です。Adjustでは、システムペイロードを使用するソリューションと、デフォルトトラッカーを使用するソリューションの2つを提供しています。 - -通常は、システムペイロードのソリューションを推奨します。ただし、特定の状況ではトラッカーの利用が必要な場合があります。Adjustのプリインストールパートナーとパートナーとの統合については[ヘルプセンター](https://help.adjust.com/ja/article/pre-install-tracking)をご覧ください。どちらのソリューションを実装すればよいか不明な場合は、integration@adjust.comまでお問い合わせください。 - -#### システムペイロードを使用 - -このソリューションは**SDK v4.23.0以上**でサポートされています。 - -configオブジェクトを作成した後、パラメーターtrueを指定して`setPreinstallTrackingEnabled`を呼び出すことによって、プリインストールアプリを認識するためのAdjust SDKを有効にします。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
- -#### デフォルトトラッカーを使用 - -- [管理画面]上で新しいトラッカーを作成してください。 -- App Delegateを開き、Configのデフォルトトラッカーを設定してください。 - - - - - - - - - - - - - - -
- Native App SDK -
- - ```java - AdjustConfig adjustConfig = new AdjustConfig(appToken, environment); - ``` -
- Web View SDK -
- - ```js - adjustConfig.setDefaultTracker('{TrackerToken}'); - ``` -
- -- `{TrackerToken}`をステップ2で作成したトラッカートークンに差し替えてください。管理画面には`http://app.adjust.com/を`含むトラッカーURLが表示されます。ソースコード内にはこのURLすべてではなく、6文字のトークンを抜き出して指定してください。 - -- アプリをビルドしてください。LogCatで下記のような行が表示されるはずです。 - - ``` - Default tracker: 'abc123' - ``` - -### オフラインモード - -Adjustのサーバーへの送信を一時停止し、保持されているトラッキングデータを後から送信するためにAdjust SDKをオフラインモードにすることができます。オフラインモード中はすべての情報がファイルに保存されるため、イベントを多く発生させすぎないようにご注意ください。 - -`true`パラメーターで`setOfflineMode` を呼び出すと、オフラインモードを有効にできます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.setOfflineMode(true); -``` -
-Web View SDK -
- -```js -Adjust.setOfflineMode(true); -``` -
- -反対に、`false`パラメーターで`setOfflineMode`を呼び出すと、オフラインモードを解除できます。Adjust SDKがオンラインモードに戻った時、保存されていた情報は正しいタイムスタンプでAdjustのサーバーに送られます。 - -トラッキングの無効化とは異なり、この設定はセッション間で**記憶されません**。オフラインモード時にアプリを終了しても、次に起動した時にはオンラインモードとしてアプリが起動します。 - - -### トラッキングの無効化 - -`setEnabled`にパラメーター`false`を渡すことで、AdjustSDKが行うデバイスのアクティビティのトラッキングをすべて無効にすることができます。**この設定はセッション間で記憶されます**。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.setEnabled(false); -``` -
-Web View SDK -
- -```js -Adjust.setEnabled(false); -``` -
- -Adjust SDKが現在有効化されているかどうかは、`isEnabled`関数を呼び出すことで確認できます。また、`setEnabled`関数に`true`を渡せば、Adjust SDKを有効化することができます。 - -### イベントバッファリング - -イベントトラッキングを大量に行っている場合は、ネットワークリクエストを遅らせて1分毎にまとめて送信したほうがいい場合があります。その場合は、Configインスタンスでイベントバッファリングを有効にしてください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setEventBufferingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setEventBufferingEnabled(true); -``` -
- -### バックグラウンドでのトラッキング - -デフォルトでは、アプリがバックグラウンドにある間、Adjust SDKはネットワークリクエストの送信を停止します。この設定はConfigインスタンスで変更できます。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setSendInBackground(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setSendInBackground(true); -``` -
- -### GDPR消去する権利(忘れられる権利) - -EUの一般データ保護規制(GDPR)第17条に基づいて、ユーザーが「忘れられる権利(right to be forgotten)」を行使した場合は、Adjustに通知することができます。次のメソッドを呼び出して、ユーザーの申請をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.gdprForgetMe(context); -``` -
-Web View SDK -
- -```js -```Adjust.gdprForgetMe(); -``` -
- -この情報を受け取ると、Adjustは該当ユーザーのデータを消去し、Adjust SDKはユーザーのトラッキングを停止します。以降、そのデバイスからのリクエストはAdjustに送信されません。 - -この変更はテストを行なっている場合でも恒久的で、元の設定に戻すことは**できない**ことをご留意ください。 - -## サードパーティーとの共有 - -ユーザーがサードパーティーとのデータ共有を無効化、有効化、あるいは再有効化する情報をAdjustに送信することができます。 - -### サードパーティーとの共有を無効にする - -次のメソッドを呼び出して、ユーザーの選択(データ共有を無効にする)をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -この情報を受け取ると、Adjustは特定のユーザーに関してパートナーとのデータ共有をブロックし、Adjust SDKは通常通り機能します。 - -## サードパーティーとの共有を無効にする - -次のメソッドを呼び出して、データ共有あるいはデータ共有の変更に関するユーザーの選択をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -この情報を受け取ると、Adjustは特定のユーザーに関してパートナーとのデータ共有設定を変更し、Adjust SDKは通常通り機能します。 - -次のメソッドを呼び出して、詳細なオプションをAdjustバックエンドに送信するようAdjust SDKに指示してください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -### ユーザー同意の計測 - -Adjust管理画面で同意有効期間とユーザーデータ保持期間を含むデータプライバシー設定を有効化あるいは無効化するには、以下のメソッドを実装してください。 - -次のメソッドを呼び出して、データプライバシー設定をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.trackMeasurementConsent(true); -``` -
-Web View SDK -
- -```js -Adjust.trackMeasurementConsent(true); -``` -
- -この情報を受け取ると、Adjustは同意による計測を有効化、あるいは無効化します。Adjust SDKは通常通り機能します。 - -## テストとトラブルシューティング - -### "Session failed (Ignoring too frequent session. ...)"というエラーが出る - -このエラーはインストールのテストの際に起こりえます。アンインストール後に再インストールするだけでは新規インストールとして動作しません。SDKがローカルで統計したセッションデータを失ったとサーバーは判断してエラーメッセージを無視し、その端末に関する有効なデータのみが与えられます。 - -この仕様はテスト中には厄介かもしれませんが、サンドボックスと本番用の挙動をできる限り近づけるために必要です。 - -アプリに対して、編集者レベル(または管理人権限)のアクセス権を持っている場合には、どんなデバイスに対するアプリのセッションデータについても、[テストコンソール][testing-console]を使ってAdjust管理画面から直接リセットすることができます。 - -端末に関する記録が消去されると、テスティングコンソールは`Forgot device`と返します。もしその端末の記録がすでに消去されていたり、値が不正だった場合は、そのリンクは`Advertising ID not found`と返します。 - -端末に関する記録を消去しても、GDPR 忘れられる権利のコールを元に戻すことはできません。 - -現在ご契約のパッケージでアクセスが可能の場合は、[開発者用API][dev-api]で設定確認と端末記録の消去を行うことができます。 - -### ブロードキャストレシーバーがインストールリファラーを受信していない - -[ガイド](#qs-gps-intent)に従って設定を済ませていれば、ブロードキャストレシーバーはAdjustのSDKとサーバーにインストールを送信するよう設定されているはずです。 - -手動でテスト用インストールリファラーを作動させることで確認できます。`com.your.appid`にアプリIDを入力し、Android Studioの[adb](http://developer.android.com/tools/help/adb.html)ツールで以下のコマンドを実行してください。 - -``` -adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver --es "referrer" "adjust_reftag%3Dabc1234%26tracking_id%3D123456789%26utm_source%3Dnetwork%26utm_medium%3Dbanner%26utm_campaign%3Dcampaign" -``` - -`INSTALL_REFERRER`インテントに対してすでに別のブロードキャストリファラーを使っている状態でこの[ガイド][referrer]の設定をした場合、`com.adjust.sdk.AdjustReferrerReceiver`にブロードキャストレシーバーを入力してください。 - -`-n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver`パラメーターを削除することもできます。削除すると、デバイスに入っているすべてのアプリが`INSTALL_REFERRER`インテントを受信します。 - -ログレベルを`verbose`に設定していれば、リファラが読み込まれると以下のログが表示されるはずです。 - -``` -V/Adjust: Referrer to parse (adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign) from reftag -``` - -SDKのパッケージハンドラーに追加されるクリックパッケージは以下のような形です。 - -``` -V/Adjust: Path: /sdk_click - ClientSdk: android4.6.0 - Parameters: - app_token abc123abc123 - click_time yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - created_at yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - environment sandbox - gps_adid 12345678-0abc-de12-3456-7890abcdef12 - needs_attribution_data 1 - referrer adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign - reftag abc1234 - source reftag - tracking_enabled 1 -``` - -アプリの起動前にこのテストを行う場合、パッケージの送信は表示されません。パッケージはアプリの起動後に送信されます。 - -**重要:** この機能をテストをするために`adb`ツールを利用することは推奨**していません**。すべてのリファラーコンテンツを`adb`でテストするためには(`&`で分けられた複数のパラメータがある場合)、ブロードキャストレシーバーで受信するためにコンテンツをエンコードすることが必要です。もしエンコードをしないと、`adb`はリファラーを最初の`&`サインで切り、誤ったコンテンツをブロードキャストレシーバーに伝えます。 - -アプリがどのようにエンコードされていないリファラーを受信しているかを確認したい場合は、Adjustのサンプルアプリを利用して、`MainActivity.java`ファイルの`onFireIntentClick`メソッドのインテント内に送信されたコンテンツを変更してください:file: - -```java -public void onFireIntentClick(View v) { - Intent intent = new Intent("com.android.vending.INSTALL_REFERRER"); - intent.setPackage("com.adjust.examples"); - intent.putExtra("referrer", "utm_source=test&utm_medium=test&utm_term=test&utm_content=test&utm_campaign=test"); - sendBroadcast(intent); -} -``` - -自分の選んだコンテンツで`putExtra`2番目のパラメーターを自由に変更してください。 - -### アプリ起動時にイベントを始動したい - -このタイミングでイベントを始動しても、期待どおりの動作をしない可能生があります。理由はこちらです。 - -直感的には分かりにくいですが、グローバル`Application`クラスの`onCreate`メソッドはアプリ起動時だけでなく、アプリによってシステムやイベントが作動する時にも呼ばれます。 - -Adjust SDKはこの場合の初期化についてサポートしています。この機能はアプリが実際に起動した時でなく、アクティビティがスタートした時、たとえばユーザーがアプリを起動させた時に起こります。 - -これらのコールはアプリがユーザーの操作以外の要因で起動した場合にも、Adjust SDKを起動しイベントを送信します。これはアプリの外部要因にもよります。 - -このように、アプリ起動時のイベントの作動はインストールとセッションの数を正確にトラッキングできません。 - -インストール後にイベントを作動させたい場合は、[アトリビューション変更時用のリスナー](#attribution_changed_listener)をご利用ください。 - -アプリ起動時にイベントを作動させたい場合は、スタートするアクティビティの`onCreate`メソッドをご使用ください。 - -[dashboard]: http://adjust.com/ja -[adjust.com]: http://adjust.com/ja - -[en-readme]: ../../README.md -[zh-readme]: ../chinese/README.md -[ja-readme]: ../japanese/README.md -[ko-readme]: ../korean/README.md - -[example-java]: ../../Adjust/example-app-java -[example-kotlin]: ../../Adjust/example-app-kotlin -[example-keyboard]: ../../Adjust/example-app-keyboard -[example-tv]: ../../Adjust/example-app-tv -[example-webbridge]: ../../Adjust/example-app-webbridge - -[maven]: http://maven.org -[referrer]: ../../doc/japanese/misc/multiple-receivers.md -[releases]: https://github.com/adjust/android_sdk/releases -[google-ad-id]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en -[event-tracking]: https://docs.adjust.com/ja/event-tracking -[callbacks-guide]: https://docs.adjust.com/ja/callbacks -[new-referrer-api]: https://developer.android.com/google/play/installreferrer/library.html -[integrated-partners]: https://help.adjust.com/ja/integrated-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[android-dashboard]: http://developer.android.com/about/dashboards/index.html -[currency-conversion]: https://docs.adjust.com/ja/event-tracking/#tracking-purchases-in-different-currencies -[android-application]: http://developer.android.com/reference/android/app/Application.html -[android-launch-modes]: https://developer.android.com/guide/topics/manifest/activity-element.html -[google-play-services]: http://developer.android.com/google/play-services/setup.html -[reattribution-with-deeplinks]: https://docs.adjust.com/ja/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[android-purchase-verification]: https://github.com/adjust/android_purchase_sdk -[testing-console]: https://docs.adjust.com/ja/testing-console/#how-to-clear-your-advertising-id-from-adjust-between-tests -[dev-api]: https://docs.adjust.com/en/adjust-for-developers/ - -[sdk2sdk-mopub]: ../../doc/japanese/sdk-to-sdk/mopub.md - -[en-helpcenter]: https://help.adjust.com/en/developer/android-sdk-documentation -[zh-helpcenter]: https://help.adjust.com/zh/developer/android-sdk-documentation -[ja-helpcenter]: https://help.adjust.com/ja/developer/android-sdk-documentation -[ko-helpcenter]: https://help.adjust.com/ko/developer/android-sdk-documentation - -## ライセンス - -Adjust SDKはMITライセンスを適用しています。 - -Copyright (c) 2012-2021 Adjust GmbH, http://www.adjust.com - -以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル(以下「ソフトウェア」)の複製を取得するすべての人に対し、 ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの複製を使用、複写、変更、結合、掲載、頒布、サブライセンス、 および/または販売する権利、およびソフトウェアを提供する相手に同じことを許可する権利も無制限に含まれます。 - -上記の著作権表示および本許諾表示を、ソフトウェアのすべての複製または重要な部分に記載するものとします。 - -ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。 ここでいう保証とは、商品性、特定の目的への適合性、および権利非侵害についての保証も含みますが、それに限定されるものではありません。 作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、 あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。 diff --git a/doc/japanese/migration/migrate.md b/doc/japanese/migration/migrate.md deleted file mode 100644 index a43b21366..000000000 --- a/doc/japanese/migration/migrate.md +++ /dev/null @@ -1,239 +0,0 @@ -## Android用adjust SDKのv3.6.2からv4.31.0への移行 - -### アプリケーションクラス - -adjust SDKの初期化方法が大きく変わりました。今後はマニフェストファイルでなく -グローバルAndroid[Application][android_application]クラスをご使用ください。 - -まだご利用されていない場合は、[Readme][basic-setup]に記載の手順に従って統合を進めてください。 - -adjust SDKの設定方法も大きく変わりました。初期設定はすべて新しいconfigオブジェクトで行わるようになります。 -`Application`クラスの`onCreate`メゾッドで以下の作業を行ってください。 - -1. configオブジェクト`AdjustConfig`を作成し、アプリトークン、環境と`this`を指定してください。 -2. 任意の設定を加えてください。 -3. configオブジェクトで`Adjust.onCreate`を呼び出し、SDKをローンチしてください。 - - -移行前のマニフェストファイルの設定および移行後の`Application`クラスでの設定がどのように行われるか例を示します。 - -##### 移行前 - -```xml - - - -``` - -##### 移行後 - -```java -import com.adjust.sdk.Adjust; -import com.adjust.sdk.AdjustConfig; - -public class YourApplicationClass extends Application { - @Override - public void onCreate() { - super.onCreate(); - // configure Adjust - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - config.setLogLevel(LogLevel.INFO); // if not configured, INFO is used by default - Adjust.onCreate(config); - } -} -``` - -### イベントトラッキング - -トラッキングされる前に設定することのできるイベントオブジェクトを導入しました。 -導入前後で設定がどのように行われるか例を示します。 - -##### 導入前 - -```java -Map parameters = new HashMap(); -parameters.put("key", "value"); -parameters.put("foo", "bar"); -Adjust.trackEvent("abc123", parameters); -``` - -##### 導入後 - -```java -AdjustEvent event = new AdjustEvent("abc123"); -event.addCallbackParameter("key", "value"); -event.addCallbackParameter("foo", "bar"); -Adjust.trackEvent(event); -``` - -### 収益トラッキング - -収益は通常のイベントとして扱えるようになりました。報酬と通過をトラッキングするよう設定するだけです。 -イベントトークンなしでは収益のトラッキングはできなくなりましたので、ご注意ください。 -ダッシュボードでイベントトークンを追加作成する必要がある場合があります。 - -*注意* 金額のフォーマットがセント単位から通過単位に変わりました。 -現在の収益トラッキングの金額は通過単位に調整されているはずです。(100で割った値になります) - -##### 変更前 - -```java -Adjust.trackRevenue(1.0, "abc123"); -``` - -##### 変更後 - -```java -AdjustEvent event = new AdjustEvent("abc123"); -event.setRevenue(0.01, "EUR"); -Adjust.trackEvent(event); -``` - -## v2.1.xから移行する場合の追加手順 - -メインクラスの名前を`com.adeven.adjustio.AdjustIo`から`com.adjust.sdk.Adjust`に変更しました。 -すべてのadjust SDKのコールを更新するには、次のステップに進んでください。 - -1. `Package Explorer`から旧`AdjustIo`プロジェクトを右クリックし、`Delete`を選択してください。 - `Delete project contents on disk`にチェックを入れ、`OK`をクリックしてください。 - -2. Eclipseメニューから`Search → File...`と進み、`File Search`タブを選んでください。 - 検索欄に`AdjustIo`と入力し、`Case sensitive`にチェックを入れてください。 - ファイル名のパターンが`*`で、スコープが`Workspace`になっていることをご確認ください。 - - ![][search] - -3. `Replace...`をクリックし、置換欄に`Adjust`を入力して`Preview >`をクリックしてください。 - javaファイル中のすべてのadjustコールとマニフェストファイル中のすべてのadjustの設定が置換されるはずです。 - プレビューで変更を確認いただいた上、`OK`をクリックしてください。 - - ![][replace] - -4. 同様に、`ReferrerReceiver`のパッケージ名を更新できるよう、 - すべてのマニフェストファイルで`adeven.adjustio`を`adjust.sdk`に置換してください。 - -5. バージョン3.6.2をダウンロードし、`Adjust`フォルダから新しいAndroidプロジェクトを作成してください。 - - ![][import] - -6. アプリのAndroidプロパティを開き、新しい`Adjust`ライブラリが選択されていることを確認してください。 - -7. `Package Explorer`からアプリを右クリックし、`Source → Organize Imports`を選択してください。 - -8. プロジェクトをビルドし、問題なく差し替えられたことを確認してください。 - -adjust SDK v3.4.0はデリゲート通知を追加しました。詳細は[README]をご確認ください。 - - -## v2.0.xから移行する場合の追加手順 - -`AndroidManifest.xml`にadjustの設定を加えてください。 -以下の`meta-data`タグを`application`タグの中に追加してください。 - -```xml - - - -``` - -![][settings] - -`{YourAppToken}`にアプリトークンを記入してください。これは[dashboard]でご確認いただけます。 - -ログのレベルは`AdjustLogLevel`でグローバルに設定できます。 -値には以下の種類があります。 - -- `verbose` - すべてのログを有効にする -- `debug` - より詳細なログを記録する -- `info` - デフォルト -- `warn` - infoのログを無効にする -- `error` - warningも無効にする -- `assert` - errorも無効にする - -テスト用か本番用かによって、`AdjustEnvironment`のパラメータは以下のいずれかに設定する必要があります。 - -- `sandbox` - for testing -- `production` - before publishing - -**重要** この値はテスト中のみ`sandbox`に設定してください。 -アプリを提出する前に`production`になっていることを必ず確認してください。 -再度開発やテストをする際は`sandbox`に戻してください。 - -この変数は実際のトラフィックとテスト端末からのテストのトラフィックを区別するために利用されます。 -正しく計測するために、この値の設定には常に注意してください。収益のトラッキングの際には特に重要です。 - -## v2.0.xから移行する場合の追加手順 - -1. すべてのアクティビティは`onResume`メソッドで`Adjust.onResume`をコールする必要があります。 - これらのすべてのコールから`appToken`パラメータを削除してください。 - すると、この関数は以下のようになるはずです。 - - ```java - protected void onResume() { - super.onResume(); - Adjust.onResume(this); - } - ``` - -2. `Adjust.setLogLevel`へのコールをすべて削除してください。 - -## v1.xから移行する場合の追加手順 - -3. 初期化にはもう`Adjust.appDidLaunch()`メソッドを使いません。 - ローンチアクティビティの`onCreate`メソッドからこのコールを削除してください。 - -4. 代わりに、セッションのトラッキングには、アクティビティが終了したり停止するたびに - 新しいadjustメソッドをコールする必要があります。これをしなければ、 - SDKはセッションの開始や終了を検知できなくなる場合があります。 - 正しく設定するために、**すべての**アクティビティで以下の作業を行ってください。 - - - アクティビティのソースファイルを開いてください。 - - ファイル最上部に`import`の記述を加えてください。 - - アクティビティの`onResume`メソッドで`Adjust.onResume`をコールしてください。 - 必要であればこのメソッドを作成してください。 - - アクティビティの`orPause`メソッドで`Adjust.onPause`をコールしてください。 - 必要であればこのメソッドを作成してください。 - - この手順を終えると、アクティビティは以下のようになっているはずです。 - - ```java - import com.adjust.sdk.Adjust; - // ... - public class YourActivity extends Activity { - protected void onResume() { - super.onResume(); - Adjust.onResume(this); - } - protected void onPause() { - super.onPause(); - Adjust.onPause(); - } - // ... - } - ``` - - ![][activity] - - この作業はアプリの**すべての**アクティビティにて行われる必要があります。 - 今後新しいアクティビティを作成する際に、これを加えることを忘れないようご注意ください。 - コーディング方法によりますが、すべてのアクティビティ共通のスーパークラスで実装したほうが良い場合もあります。 - -5. The `amount` parameter of the `trackRevenue` methods is now of type - `double`, so you can drop the `f` suffixes in number literals (`12.3f` - becomes `12.3`). -5. `trackRevenue`メソッドの`amount`パラメータは`double`型になりました。 - 末尾の`f`を外してください(たとえば、`12.3f`は`12.3`になります)。 - -[README]: ../README.md -[dashboard]: http://adjust.com -[search]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/search.png -[replace]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/replace.png -[import]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/import2.png -[activity]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/activity4.png -[settings]: https://raw.github.com/adjust/adjust_sdk/master/Resources/android/settings.png -[android_application]: http://developer.android.com/reference/android/app/Application.html -[application_name]: http://developer.android.com/guide/topics/manifest/application-element.html#nm -[basic-setup]: https://github.com/adjust/android_sdk/tree/master#basic-setup - diff --git a/doc/japanese/misc/eclipse.md b/doc/japanese/misc/eclipse.md deleted file mode 100644 index f1b2d6dc2..000000000 --- a/doc/japanese/misc/eclipse.md +++ /dev/null @@ -1,66 +0,0 @@ -## Eclipseを使ったadjustとの連携 - -SDKバージョン4.0.0以降、adjustではAndroid Studioでの開発をお勧めしています。 -Eclipseを使ってadjust SDKを連携するには、以下の手順に従ってください。 - -## 基本的なインストール - -EclipseプロジェクトでコンパイルしたJarをリンクしてadjust SDKを連携させる方法が最も簡単です。 - -### 1. Jarの取得 - -[リリースページ][releases]から最新のJarを入手してください。もしくは、[Mavenレポジトリ][maven]から -[`com.adjust.sdk`][maven_search]を検索してダウンロードしてください。 - -### 2. プロジェクトへadjustライブラリを追加 - -Jarファイルをダウンロードしたら、プロジェクトの`libs`フォルダにドラッグしてください。 -これでadjust SDKがアプリで利用できるようになります。 - -### 3. Google Playサービスの追加 - -2014年8月1日以降、Google Playストア内のアプリはデバイスの特定のために[Google広告ID][google_ad_id]を -使うことが必須とされています。adjust SDKでGoogle広告IDを使うためには、 -[Google Playサービス][google_play_services]を連携させる必要があります。 -Google Playサービスの連携がお済みでない場合は、以下の手順に進んでください。 - -1. 以下のライブラリのプロジェクトをコピーし、 - - ``` - /extras/google/google_play_services/libproject/google-play-services_lib/ - ``` - - Androidプロジェクトの開発に使っている場所にペーストしてください。 - -2. Eclipseワークスペースにライブラリプロジェクトをインポートしてください。 - `File > Import`と進み、`Android > Existing Android Code into Workspace`を選択、 - ライブラリプロジェクトのコピーをインポートしてください。 - -3. アプリプロジェクト内で、Google Playサービスのライブラリプロジェクトへの参照を加えてください。 - 詳しくは[Referencing a Library Project for Eclipse][eclipse_library]をご確認ください。 - - 必ず開発用のワークスペースにコピーしたライブラリを参照してください。 - Android SDKディレクトリから直接ライブラリを参照しないでくささい。 - -4. Google Playサービスのライブラリをアプリプロジェクトにdependencyとして追加したら、 - アプリのマニフェストファイルを開き、以下のタグを[][application]エレメントの子要素として - 追加してください。 - - - ```xml - - ``` - -### 4. 以降の手順 - -adjustの[ガイド][guide_permissions]の`5. パーミッションの追加`項目より設定を進めてください。 - -[releases]: https://github.com/adjust/adjust_android_sdk/releases -[google_ad_id]: https://developer.android.com/google/play-services/id.html -[maven]: http://maven.org -[maven_search]: http://search.maven.org/#search%7Cga%7C1%7Ccom.adjust.sdk -[application]: http://developer.android.com/guide/topics/manifest/application-element.html -[eclipse_library]: http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject -[guide_permissions]: https://github.com/adjust/android_sdk#5-add-permissions -[google_play_services]: http://developer.android.com/google/play-services/setup.html diff --git a/doc/japanese/misc/fb-pixel.md b/doc/japanese/misc/fb-pixel.md deleted file mode 100644 index f88d15674..000000000 --- a/doc/japanese/misc/fb-pixel.md +++ /dev/null @@ -1,128 +0,0 @@ -## Facebook Pixelの統合 - - -[Facebook Pixel](https://www.facebook.com/business/help/952192354843755) はFacebookが提供するウェブサイト専用の分析ツールです。以前は、アプリ内のweb viewでPixelイベントをトラッキングするのにFacebook SDKを利用できませんでした。[FB SDK](https://developers.facebook.com/docs/analytics) v4.34のリリース以降はトラッキングが可能になり、[Hybrid Mobile App Events](https://developers.facebook.com/docs/app-events/hybrid-app-events) を使用して、Facebook PixelイベントをFacebook アプリイベントに変換します。 - -また、FB SDKを統合しなくても、Adjust SDKを使用してアプリ内のweb viewでFacebook Pixelを利用できるようになりました。 - -## Facebookの統合 - -### アプリサンプル - -[`example-fbpixel` ディレクトリ][example-fbpixel]にあるアプリサンプルを見ると、Adjustのweb view SDKを使用してどのようにFacebook Pixelイベントをトラッキングできるかがわかります。 - -### FacebookアプリID - -FB SDKを統合する必要はありませんが、Adjust SDKがFacebook Pixelを統合するために、一部FB SDKと同じ統合手順に従う必要があります。 - -まず[FB SDK Android SDKガイド](https://developers.facebook.com/docs/android/getting-started/#app_id) に記載の通り、対象のFacebookアプリIDをアプリに追加する必要があります。 -統合手順は上記リンクガイドに記載がありますが、以下にも転載致します。 - -- `strings.xml` ファイルを開けます. パスの例: `/app/src/main/res/values/strings.xml`. -- 名前`facebook_app_id`と対象のFacebook App IDに新しい文字列を追加します。 -- `AndroidManifest.xml`を開きます。 -- `uses-permission` エレメントを以下のマニフェストに追加します。 - - - ```xml - - ``` - -- `meta-data`エレメントを`application`エレメントに追加します。 - -```xml - - ... - - ... - - ``` - -### Facebook Pixelの設定 - -Facebook Pixelの統合方法については、Facebookのガイドに従ってください。Javascriptコードは以下のように記述する必要があります。 - -```js - - -... - -``` - -この後、[Hybrid Mobile App Eventsガイド](https://developers.facebook.com/docs/app-events/hybrid-app-events) の`Update Your Pixel`セクションに記載の通り、Facebook Pixelのコードを以下のように変更するだけです。 - - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - - -**注意**:最初に`'init'`メソッドを呼び出し、直後に`'set'`メソッドを呼び出すことが**非常に重要**です。HTMLのウェブページに貼り付けるFacebookが提供する(上記に示すような)スクリプトスニペットには、`'init'`メソッドの呼び出しの直後にページビューイベントの`'track'`メソッドが含まれています。このページビューイベントを正しくトラッキングするには、両者の間に必ず`'set'`メソッドを呼び出してください。 - -## Adjustの統合 - -### Facebook SDK Javascriptインターフェイスの登録 - - -[Android web view SDK](web_views_ja.md) アプリの統合ガイドを参照ください。登録のセクションで、Adjustブリッジのデフォルトのインスタンスを取得します(以下参照)。 - -```java -AdjustBridge.registerAndGetInstance(getApplication(), webview); -``` - -save the return instance, as `adjustBridgeInstance`, for example, and then add the following line: - -```java -adjustBridgeInstance.registerFacebookSDKJSInterface(); -``` - -### Event名の設定 - -Adjust web bridge SDKは、Facebook PixelイベントをAdjustイベントに変換します。 - -このため、Facebook Pixel設定の`fbq('track', 'PageView');`をコピーペーストで追加し、Adjust SDKを開始してFacebook Pixelイベントをトラッキングする ***前*** に、Facebook Pixelsを特定のAdjustイベントにマッピングするか、デフォルトのAdjustイベントトークンを設定する必要があります。 - -Facebook PixelイベントをAdjustイベントにマッピングするには、Adjust SDKを初期化する前に`adjustConfig`インスタンスの`addFbPixelMapping(fbEventNameKey, adjEventTokenValue)`を呼び出します。マッピングの例は以下の通りです。 - - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -注意:これは、以下のFacebook Pixelイベントをトラッキングする際の`fbq('track', 'Search', ...);`および`fbq('track', 'Purchase', ...);`にそれぞれ対応します。残念ながら、Javascriptでトラッキングされるイベント名とFB SDKで使用されるイベント名との間のすべてのマッピングスキームにはアクセスできません。 - -参考として、以下はAdjustがこれまで確認したイベント名の情報になります。 - -| Pixelイベント名 | 対応するFacebookアプリのイベント名 -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - - -これは完全なリストではない可能性があります。また、Facebookが現在のリストに追加や更新を加える可能性もあります。テスト中は、Adjustログで以下のような警告を確認してください。 - -``` -There is not a default event token configured or a mapping found for event named: 'fb_mobile_search'. It won't be tracked as an adjust event -``` - -``` -イベント名'fb_mobile_search'について、設定されたデフォルトイベントトークンが存在しないか、マッピングが見つかりません。Adjustイベントとしてトラッキングできません。 -``` - -また、マッピングを設定しない場合でもデフォルトのAdjustイベントの使用は可能です。Adjust SDKを初期化する前に、`adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);`を呼び出してください。 - - -[example-fbpixel]: ../../Adjust/example-app-fbpixel diff --git a/doc/japanese/misc/multi-process-app.md b/doc/japanese/misc/multi-process-app.md deleted file mode 100644 index 8d1e48bdf..000000000 --- a/doc/japanese/misc/multi-process-app.md +++ /dev/null @@ -1,61 +0,0 @@ -# マルチプロセスアプリとadjustの連携 - -Androidアプリは1つもしくはそれ以上のプロセスで構成されます。サービスやアクティビティをメインプロセス以外のプロセスで実行することもできます。 -プロセス内に ```android:process``` プロパティを設定するか、Androidマニフェストファイルでアクティビティの定義を記入し、これを実装してください。 - -```xml - - -``` - -```xml - - -``` - -このようなサービスやアクティビティを定義すると、メインプロセスでないプロセスでこれらを実行させることになります。 - -デフォルトでは、メインプロセスの名称はアプリのパッケージ名と同じになっています。アプリのパッケージ名が```com.example.myapp```の場合、メインプロセスの名前も同じです。この場合、```YourActivity```と```YourService```は```com.example.myapp:YourProcessName```という名前のプロセスで実行されます。 - -adjust SDKは1つのアプリ内での複数のプロセスからのトラッキングを__現在サポートしていません__。アプリで複数のプロセスをお使いの場合、 -```AdjustConfig```オブジェクトにメインプロセスの名前を設定してください。 - -```java -String appToken = "{YourAppToken}"; -String environment = AdjustConfig.ENVIRONMENT_SANDBOX; // or AdjustConfig.ENVIRONMENT_PRODUCTION -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -config.setProcessName("com.example.myapp"); - -Adjust.onCreate(config); -``` - -Androidマニフェストファイルで```application```の```android:process```プロパティを変更すると、メインプロセスの名称を変えることができます。 - -```xml - - -``` - -メインプロセスの名称をこのように記述した場合、```AdjustConfig```オブジェクトでメインプロセスの名前を次のように設定してください。 - -```java -config.setProcessName("com.example.myapp:YourMainProcessName"); -``` - -これでメインプロセス名をadjust SDKに知らせることができ、SDKはその他のプロセスを一切初期化しません。他のプロセスからSDKを使おうと試みた場合、次のlogメッセージが表示されます。 - -``` -05-06 17:15:06.885 8743-8743/com.example.myapp:YourProcessName I/Adjust﹕ Skipping initialization in background process (com.example.myapp:YourProcessName) -``` - -```AdjustConfig```オブジェクトでメインプロセス名を設定せずに複数のプロセスでSDKをコールしようとすると、Androidの異なるプロセス間ではメモリ領域をシェアしませんので、SDKの様々なインスタンスを初期化することになります。これは予測できない結果につながる恐れがありますので、複数のプロセスをご使用の場合は常にメインプロセス名を設定するか、アプリ内で2つ以上のプロセスでadjust SDKを使わないようにご注意ください。 diff --git a/doc/japanese/misc/multiple-receivers.md b/doc/japanese/misc/multiple-receivers.md deleted file mode 100644 index e1b9ec878..000000000 --- a/doc/japanese/misc/multiple-receivers.md +++ /dev/null @@ -1,30 +0,0 @@ -## 複数のブロードキャストレシーバーへのサポート - -アプリ内にインテント `INSTALL_REFERRER` に対するブロードキャストレシーバーを複数のサービス(Google Analyticsなど)に登録する必要がある場合は、 -サポート対象となる他のすべてのレシーバーにコールする、独自の `BroadcastReceiver` を実装する必要があります。マニフェストファイルに、独自のブロードキャストレシーバーを設定している場合(以下のような内容になります): - -```xml - - - - - -``` - -Adjustのブロードキャストレシーバー(およびその情報を必要する他のサービス)に対して、インテントをこのように作成してください: - -```java -public class InstallReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - // Adjust receiver. - new AdjustReferrerReceiver().onReceive(context, intent); - // Google Analytics receiver. - new CampaignTrackingReceiver().onReceive(context,intent); - // And any other receiver which needs the intent. - } -} -``` diff --git a/doc/japanese/misc/pre-install-tracker-tool.md b/doc/japanese/misc/pre-install-tracker-tool.md deleted file mode 100644 index 464e62028..000000000 --- a/doc/japanese/misc/pre-install-tracker-tool.md +++ /dev/null @@ -1,155 +0,0 @@ -# Adjustストア&プレインストールトラッカーツール - -Adjustストア&プレインストールトラッカーツール(`adjust-dtt`)は、プレインストールのadjustトラッカー情報をAPKファイルに挿入できるRubyコマンドラインツールです。この情報は後からadjust SDKに読み込まれ、特定のadjustトラッカーとプレインストールされたアプリのユーザーとを結びつけることができます。 - -`adjust-dtt`ツールを使用するには、LinuxまたはMac OS Xマシン上で以下の3つのツールがインストールされている必要があります。 - -1. `ruby` – `adjust-dtt`ツールの実行に使われます -2. `apktool` – APKファイルの展開や再圧縮に使われます -3. `jarsigner` – APKファイルの署名に使われます - -RubyはMac OS Xではデフォルトでインストールされています。Linuxをお使いの場合でこれがデフォルトでインストールされていなければ、こちらを参考にインストールしてください。https://www.ruby-lang.org/en/documentation/installation/ - -apktoolのインストール方法はこちらでご確認いただけます。 https://ibotpeaches.github.io/Apktool/install/ - -Mac OS Xに`brew`パッケージマネジャー(http://brew.sh/)を設定済みでしたら、以下のコマンドでapktoolをインストールできます。 - -``` -brew install apktool -``` - -もしくは、Java Development Kit (JDK)の中に`jarsigner`が含まれており、これも開発マシンにインストールされている必要があります。たとえば、SDKバージョン1.8がMac OS Xにインストールされていれば、以下の場所に`jarsigner`があるはずです。 - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/ -``` - -JDKの中には`bin`フォルダが含まれており、これは例えば上記と同じパスにインストールされた場合、以下の場所にあります。 - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ -``` - -このフォルダ内に`jarsigner`ツールがあり、これは`adjust-dtt`ツールを使用するのに必要です。 - -`adjust-dtt`ツールは`apktool`と`jarsigner`の両方のツールのパスが`PATH`変数に追加されていることを想定しています。これらが追加されていない場合、`PATH`変数にこれらのツールを含むフォルダを加える必要があります。 - -**注意** 公式インストールガイドに従って、または`brew`を使って`apktool`を追加すると、そのパスは自動的に`PATH`変数に追加されますので、ターミナル上でどこからでも`apktool`を実行することができるようになります。しかし別の方法で`apktool`を追加し、その置き場所が`PATH`変数に含まれていない場合、それを含むフォルダを`PATH`変数に追加する必要があります。 - -ここで`apktool`(1)と`jarsigner`(2)の場所を以下のように仮定します。 - -1. /User/dummy/some/random/folder/ -2. /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ - -これらの場所を`PATH`変数に追加するには、`.bash_profile`ファイルを編集してください。これは通常`$HOME`ディレクトリのルートにあるはずです。 - -``` -$HOME/.bash_profile -``` - -任意のエディタでこのファイルを開き、末尾に以下の行を加えてください。 - -``` -export PATH="/Users/dummy/some/random/folder:/Library/Java/JavaVirtualMachines/jdk 1.8.0_102.jdk/Contents/Home/bin:$PATH" -``` - -`apktool`が`PATH`に自動的に追加されている場合は、そのパスを`PATH`変数に追加する必要はありません。上の行の代わりに、以下の行を追加してください。 - -``` -export PATH="/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin: $PATH" -``` - -変更を保存し、以下のコマンドを実行して変更を反映させてください。 - -``` -source $HOME/.bash_profile -``` - -**注意** このガイドは`bash` shellの使用を前提としています。`zsh`など他のshellをご利用の場合は、そのshellの設定に合わせて上記の手順を行ってください。 - -これで`adjust-dtt`ツールの使用に必要な設定が済みました。 - -配布される予定のAPKは署名されています。APKの"署名なし"バージョンを生成していた場合でも、Android Studioはデフォルトで入っているデバッグ署名用のキーストアを使って署名をします。これは多くの場合以下の場所にあります。 - -``` -$HOME/.android/debug.keystore -``` - -Android Studioから署名されたAPKをエクスポートする場合は、カスタム署名用のキーストアファイルで署名をします。 - -`adjust-dtt`ツールを使うには、デフォルトのデバッグ署名用キーストアかカスタムキーストアのいずれかにアクセスできる必要があります。`apktool`はAPKの展開に使われた後、APKからすべての署名を完全に消去しますので、APKが再圧縮されても編集や署名は復活しません。そのため、Android端末に転送し端末上で使えるようにするためには、`jarsigner`ツールを使い署名情報を渡してAPKに署名をし直す必要があります。 - -すべての設定が済めば、あとはプレインストールのアプリとそのトークンのためのデフォルトとして使うトラッカーをダッシュボード上で生成するのみです。 - -プレインストールトラッカーの設定には、`adjust-config.yaml`コンフィグファイルを生成し、アプリを公開したいストアごとの設定を記入する必要があります。 - -下記に、**store_1**、**store_2**、**store_3**と仮定した3つのストア用にAPKファイルを作成する場合の`adjust-config.yaml`ファイルの例を示します。 - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: -store_1: -default_tracker: abc123 -store_2: -default_tracker: abc456 -store_3: -default_tracker: abc789 -``` - -以下のパラメータを設定できます。 - -1. `apk_path` = Full path to your APK file (global and per store) -2. `keystore_path` = Full path to your keystore file used for APK signing (global and per store) -3. `keystore_pass` = Your keystore signing password (global and per store) -4. `keystore_alias` = Your keystore alias (global and per store) -5. `default_tracker` = Your pre-installed adjust tracker token (per store only) - -上の4つのパラメータは、すべてのストアで共通して設定したい場合、ルートでグローバルに定義することができます。グローバルにパラメータを設定し、さらにストアでも同じパラメータを設定した場合、ストアに設定されたパラメータがAPKの生成に使われます。configファイルは以下のようになります。 - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: -store_1: -default_tracker: abc123 -keystore_path: /Users/uerceg/Desktop/apk/differentkeystore.jks -keystore_pass: differentkeystorepass -keystore_alias: differentkeystorealias -store_2: -default_tracker: abc456 -store_3: -default_tracker: abc789 -``` - -この場合、`adjust-dtt`ツールは`store_1`用にAPKを生成する際には`differentkeystore.jks`と`differentkeystorepass`と`differentkeystorealias`を使います。**stores**パラメータはルートに置く必要があり、その中で必要な数だけストアを定義することができます。ストアごとに変更されたAPKファイルが生成されます。 - -`adjust-config.yaml`ファイルが正しく設定されたら、`adjust-dtt`ツールを以下のように実行してください。 - -``` -adjust-dtt adjust-config.yaml -``` - -**注意** `adjust-dtt`ツールを実行できない場合、実行権限があることをご確認ください。権限がなければ、以下のコマンドを実行してください。 - -``` -chmod +x adjust-dtt -``` - -これを実行したら、もう一度`adjust-dtt`ツールを実行してみてください。 - -`adjust-dtt`ツールを実行すると、以下が起こります。 - -1. アプリのAPKファイルが展開され、APKの名称をもつフォルダがAPKファイルが置かれているフォルダに生成されます。 -2. デフォルトのトラッカー情報を含む`adjust_config.properties`ファイルがassetsフォルダを探します。 -3. assetsフォルダもしくは`adjust_config.properties`ファイルがない場合、それらは自動的に生成され、`default_tracker`パラメータとして渡されるトラッカーがconfigファイルに書き込まれます。 -4. APK内にすでに`adjust_config.properties`ファイルがあり、しかしデフォルトトラッカーの値が書き込まれていない場合、`default_tracker`パラメータの値がファイルに書き込まれます。configファイルがすでにデフォルトトラッカーの値を持っている場合、その亜大はコマンドに渡された値を比較され、これらが一致しない場合はコマンドに渡されたほうの値が使われます。 -5. APKが再圧縮されます。 -6. `keystore_path`、`keystore_pass`、`keystore_alias`パラメータの値として渡された情報をもとにAPKが署名されます。 -7. これで終わりです。生成されたAPKはオリジナルと同じ名前の末尾に`_[store_name]`が付与された名前がついています。上記の例では、それぞれ`example-release_store_1.apk`、`example- release_store_2.apk`、`example-release_store_3.apk`の名前で3つのAPKファイルが生成されます。配布前にご自由に名称を変更してください。 - -ツールについてご質問があれば、お気軽に support@adjust.com までご連絡ください。 diff --git a/doc/japanese/plugins/criteo.md b/doc/japanese/plugins/criteo.md deleted file mode 100644 index 2838651d7..000000000 --- a/doc/japanese/plugins/criteo.md +++ /dev/null @@ -1,197 +0,0 @@ -## Criteoプラグイン - -adjust SDKとCriteoプラグインのdependencyを追加してください。 - -``` -compile 'com.adjust.sdk:adjust-android-criteo:4.7.0' -``` - -もしくは、以下の手順でadjustとCriteoを統合できます。 - -1. `plugin/Criteo`フォルダを[releases page](https://github.com/adjust/android_sdk/releases)からダウンロードアーカイブに置いてください。 - -2. Android Studio上で`adjust`モジュールを開き、`plugin`パッケージフォルダを - `adjust/java/com/adjust/sdk`に置いてください。 - -3. ダウンロードした`plugin/Criteo/com/adjust/sdk/plugin`から`AdjustCriteo.java`と - `CriteoProduct.java`ファイルをドラッグし、`adjust`プロジェクトの`plugin`フォルダに入れてください。 - -下記の例のように、Criteoの各イベントを統合できます。 - -### リスティング - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{viewListingEventToken}"); - -List productIds = Arrays.asList("productId1", "productId2", "productId3"); - -AdjustCriteo.injectViewListingIntoEvent(event, productIds, "customerId1"); - -Adjust.trackEvent(event); -``` - -### プロダクト - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{viewProductEventToken}"); - -AdjustCriteo.injectViewProductIntoEvent(event, "productId1", "customerId1"); - -Adjust.trackEvent(event); -``` - -### カート - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{cartEventToken}"); - -CriteoProduct product1 = new CriteoProduct(100, 1, "productId1"); -CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2"); -CriteoProduct product3 = new CriteoProduct(50, 2, "productId3"); - -List products = Arrays.asList(product1, product2, product3); - -AdjustCriteo.injectCartIntoEvent(event, products, "customerId1"); - -Adjust.trackEvent(event); -``` - -### トランザクションの確認 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{transactionConfirmedEventToken}"); - -CriteoProduct product1 = new CriteoProduct(100, 1, "productId1"); -CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2"); -CriteoProduct product3 = new CriteoProduct(50, 2, "productId3"); - -List products = Arrays.asList(product1, product2, product3); - -AdjustCriteo.injectTransactionConfirmedIntoEvent(event, products, "transactionId", "customerId1"); - -Adjust.trackEvent(event); -``` - -### ユーザーのレベル - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{userLevelEventToken}"); - -AdjustCriteo.injectUserLevelIntoEvent(event, 1, "customerId1"); - -Adjust.trackEvent(event); -``` - -### ユーザーのステータス - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{userStatusEventToken}"); - -AdjustCriteo.injectUserStatusIntoEvent(event, "uiStatusValue", "customerId1"); - -Adjust.trackEvent(event); -``` - -### Achievement Unlocked - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{achievementUnlockedEventToken}"); - -AdjustCriteo.injectAchievementUnlockedIntoEvent(event, "AchievementUnlocked", "customerId1"); - -Adjust.trackEvent(event); -``` - -### カスタムイベント - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{customEventEventToken}"); - -AdjustCriteo.injectCustomEventIntoEvent(event, "uiDataValue", "customerId1"); - -Adjust.trackEvent(event); -``` - -### カスタムイベント 2 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{customEvent2EventToken}"); - -AdjustCriteo.injectCustomEvent2IntoEvent(event, "uiData2Value", 3, "customerId1"); - -Adjust.trackEvent(event); -``` - -### ハッシュEmail - -`injectHashedEmailIntoCriteoEvents`メソッドを使って、各Criteoメソッドにハッシュ化されたEmailアドレスを付与することができます。 -ハッシュ化されたEmailアドレスはアプリの一ライフサイクル中にCriteoの各メソッドに送信されますので、アプリが再起動された時に再びセットされる必要があります。 -`injectHashedEmailIntoCriteoEvents`を`null`に設定することで、ハッシュEmailを削除することができます。 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectHashedEmailIntoCriteoEvents("8455938a1db5c475a87d76edacb6284e"); -``` - -### 検索日 - -`injectViewSearchDatesIntoCriteoEvent`メソッドを使って、各Criteoメソッドにチェックインの日付とチェックアウトの日付を付与することができます。これらの日付はアプリの一ライフサイクル中にCriteoの各メソッドに送信されますので、アプリが再起動された時に再びセットされる必要があります。 - -`injectViewSearchDatesIntoCriteoEvents`を`null`に設定することで、これらの検索日を削除することができます。 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectViewSearchDatesIntoCriteoEvents("2015-01-01", "2015-01-07"); -``` - -### パートナーID - -`injectPartnerIdIntoCriteoEvent`を使って、各CriteoメソッドにパートナーIDを付与することができます。このIDはアプリの一ライフサイクル中にCriteoの各メソッドに送信されますので、アプリが再起動された時に再びセットされる必要があります。 -`injectPartnerIdIntoCriteoEvent`を`null`に設定することで、パートナーIDを削除することができます。 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectPartnerIdIntoCriteoEvents("{CriteoPartnerId}"); -``` - -### ディープリンクの送信 - -ディープリンクを受け取るアクティビティでそれぞれ、onCreate メソッドに以下のコールを追加してください。 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - Intent intent = getIntent(); - Uri data = intent.getData(); - - AdjustEvent event = new AdjustEvent("{deeplinkEventToken}"); - AdjustCriteo.injectDeeplinkIntoEvent(event, data); - Adjust.trackEvent(event); - - //... -} -``` diff --git a/doc/japanese/plugins/oaid.md b/doc/japanese/plugins/oaid.md deleted file mode 100644 index f69099274..000000000 --- a/doc/japanese/plugins/oaid.md +++ /dev/null @@ -1,59 +0,0 @@ -## OAIDプラグイン - -MSA (Mobile Security Alliance) は、中国で製造される全ての端末が、広告IDであるOAIDを提供するよう推奨しています。OAIDを利用することで、Google Play Servicesが提供されていない市場でも、Android端末の流入元を計測することが可能です。 - -OAIDプラグインをAdjustのAndroid SDKに追加することで、デフォルトで取得する他のデバイスIDに加えて、端末のOAID値を読み取ることができるようになります。MSA SDKを使用している全ての端末、またはHuaweiの端末でHSM(Huawei Mobile Service)を使用している場合にOAIDの読み取りが可能です。 - -始めに、公式の[Android SDK README][readme] をご一読いただき、Adjust SDKがアプリに正常に実装されていることを確認してください。 - -Adjust SDKがOAID値を収集し計測するための設定手順は、以下のとおりです。HuaweiデバイスのOAIDを読み取る目的のためだけにプラグインを使用する場合は、「アプリにMSA SDKを追加する」のステップを省略できます。 - -### OAIDプラグインをアプリに追加する - -Mavenを使用している場合は、以下のOAIDプラグイン dependencyを、既存のAdjust SDKのdependencyの隣にあるbuild.gradle` file に追加します: - -``` -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.adjust.sdk:adjust-android-oaid:4.31.0' -``` - -Adjust OAIDプラグインを JARファイルとして追加することもできます。JARファイルは、[releases page][releases] からダウンロードすることができます。 - -### アプリにMSA SDKを追加する - -注:Huawei端末からOAIDを読み取る場合は、MSA SDKを追加する必要はありません。この場合、OAIDプラグインはHuawei Mobile Service(バージョン2.6.2以降)を使用します。 - -OAIDプラグインによりMSA SDKでOAID値を読み取ることができるようにするには、MSA SDK(AARファイル)をプロジェクトのlibsディレクトリにコピーし、dependencyを設定します。また、supplierconfig.jsonをプロジェクトのassetsディレクトリにコピーする必要があります。 - -MSA SDKと詳細な手順については[こちら](msasdk)をご覧ください。 - - -### Proguardの設定 - -Proguardを使用し、かつ Google Playストアでアプリを公開しない場合には、Google Play Servicesに関連する全てのルールを削除し、[SDK README][readme proguard]でリファラーライブラリをインストールすることができます。 - -以下のような `com.adjust.sdk`パッケージルールを使用します: - -``` --keep public class com.adjust.sdk.**{ *; } -``` - -### プラグインを使用する - -OAID値を読み取る際には、SDKを開始する前に `AdjustOaid.readOaid()`を呼び出します。 - -```java -AdjustOaid.readOaid(); - -// ... - -Adjust.onCreate(config); -``` - -SDKがOAID値を読み取らないようにするためには、 `AdjustOaid.doNotReadOaid()`を呼び出します。 - - -[readme]: ../../japanese/README.md -[releases]: https://github.com/adjust/android_sdk/releases -[readme proguard]: ../../japanese/README.md#qs-proguard -[msasdk]: http://www.msa-alliance.cn/col.jsp?id=120 diff --git a/doc/japanese/plugins/sociomantic.md b/doc/japanese/plugins/sociomantic.md deleted file mode 100644 index 322ad314c..000000000 --- a/doc/japanese/plugins/sociomantic.md +++ /dev/null @@ -1,463 +0,0 @@ -## Sociomanticプラグイン - -Sociomanticプラグインを連携させるには、adjust SDKとSociomanticプラグインのDependencyを追加してください。 - -``` -compile 'com.adjust.sdk:adjust-android-sociomantic:4.11.0' -``` - -もしくは、次の手順に従ってSociomanticをAdjustに連携させてください。 - -1. `plugin/Sociomantic`フォルダを[releases page](https://github.com/adjust/android_sdk/releases)からダウンロードアーカイブに置いてください。 - -2. Android Studio上で`adjust`モジュールを開き、`plugin`パッケージフォルダを`adjust/java/com/adjust/sdk`に置いてください。 - -3. ダウンロードした`plugin/Sociomantic/com/adjust/sdk/plugin`フォルダから`AdjustSociomantic.java`ファイルをドラッグし、`adjust`プロジェクトの`plugin`フォルダに入れてください。 - -4. これで、ディクショナリのプロパティ名としてお使いの定数と同様に、Sociomanticのイベントメソッドを使えるようになります。 - - ```java - 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; - ``` - -5. Sociomanticの送信の前に、下記のようなパートナーIDを設定してください。 - - ```java - import com.adjust.sdk.plugin.AdjustSociomantic; - - AdjustSociomantic.injectPartnerIdInSociomanticEvents("{sociomanticPartnerId}"); - ``` - -6. これで個々のSociomanticイベントを連携できます。例は以下をご参照ください。 - -### カスタマーイベント - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(HOMEPAGE_TOKEN); -Map customerData = new HashMap<>(); -customerData.put(AdjustSociomantic.SCMCustomerAgeGroup, "0"); - -AdjustSociomantic.injectCustomerDataIntoEvent(event, customerData); - -Adjust.trackEvent(event); -``` - -### ホームページ閲覧 - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(HOMEPAGE_TOKEN); - -Adjust.trackEvent(event); -``` - -### リスティング閲覧 - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(LISTING_TOKEN); -List 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); -``` - -### プロダクト閲覧 - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(PRODUCT_VIEW_TOKEN); -Map product = new HashMap<>(); -List 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必須*プロダクト名特殊文字を含めず、UFT-8でエンコードしてください。HTMLマークアップは使えません。
SCMSalePrice必須*小数値でのセール価格(例 2.99)小数点にはドットをお使いください。ドットやカンマなどの3桁区切りは入れないでください。
SCMAmount必須*小数値の通常価格 (例 3.99)小数点にはドットをお使いください。ドットやカンマなどの3桁区切りは入れないでください。
SCMCurrency必須*ISO 4217 formatにおける通貨コード (例 EUR)トラッキングコード例で確認できます。
SCMProductURL>必須*プロダクトURL (ディープリンク)機能しているディープリンクを入れてください。できればGoogleアナリティクス、HURRA、Eulerianなどのトラッキングパラメータをつけないでください。。必ず http:// をつけたディープリンクをお使いください。
SCMProductImageURL必須*プロダクトの画像URL適切な大きさの画像をご用意ください。広告内に任意で表示されるがそうの大きさは最低200x200pxで、同じアスペクト比である必要があります。
SCMBrand必須*プロダクトのブランド上記SCMProductNameと同様、特殊文字を含めず、UFT-8でエンコードしてください。HTMLマークアップは使えません。
SCMDescription任意プロダクトの短い説明上記SCMProductNameと同様、特殊文字を含めず、UFT-8でエンコードしてください。HTMLマークアップは使えません。
SCMTimestamp任意プロダクトが利用可能になるまでのタイムスタンプ (GMT時間で入力してください)ユーザーが検索した日付を入れてください。NSTimeIntervalをNSNumberに入れ子してください。(例を参照)
SCMValidityTimestamp任意プロダクトが利用可能になるまでのタイムスタンプ (GMT時間で入力してください)プロダクトが利用可能になるまでのunixのタイムスタンプを入れてください。常に利用可能なプロダクトは0を入れてください。ユーザーが検索した日付を入れてください。NSTimeIntervalをNSNumberに入れ子してください。(上記SCMTimestampと同様)
SCMQuantity任意プロダクトの在庫数必ずSociomanticの担当者にご相談の上、この欄に入力してください。
SCMScore任意プロダクトの優先度スコア (0 から 10.0 までの数値)必ずSociomanticの担当者にご相談の上、この欄に入力してください。
- -\*任意。フィード上で確認できれば入力してください。 - -設定についてご質問があれば、Sociomanticの技術アカウントマネージャーまでご連絡ください。 - -### カート - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(BASKET_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMCurrency, "EUR"); -product1.put(AdjustSociomantic.SCMQuantity, 1); - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); - -AdjustSociomantic.injectCartIntoEvent(event, products); - -Adjust.trackEvent(event); -``` - -*カートのレポートに利用できるプロダクトパラメータ* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
パラメータ名条件説明備考
SCMProductID必須プロダクトIDカラーやサイズなどのバリエーションのサブIDは含めないでください。
SCMAmount任意小数値での販売価格 (例 2.99)小数点にはドットをお使いください。ドットやカンマなどの3桁区切りは入れないでください。個数が2以上であっても、1商品あたりの価格を入れてください。
SCMCurrency任意ISO 4217 formatにおける通貨コード (例 EUR)トラッキングコード例で確認できます。
SCMQuantity任意選択したプロダクトの個数整数値を入れてください。
- -### 未確認トランザクション - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); - -AdjustSociomantic.injectTransactionIntoEvent(event, "123456", products); - -Adjust.trackEvent(event); -``` - -パラメータがあれば - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); - -Map parameters = new HashMap<>(); -parameters.put(AdjustSociomantic.SCMCurrency, "EUR"); -parameters.put(AdjustSociomantic.SCMAmount, 42); - -AdjustSociomantic.injectTransactionIntoEvent(event, "123456", products, parameters); - -Adjust.trackEvent(event); -``` - -### 確認済みトランザクション - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); - -AdjustSociomantic.injectConfirmedTransactionIntoEvent(event, "123456", products); - -Adjust.trackEvent(event); -``` - -パラメータがあれば - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(SALE_TOKEN); -Map product1 = new HashMap<>(); -product1.put(AdjustSociomantic.SCMProductID, "1"); -product1.put(AdjustSociomantic.SCMAmount, 42); -product1.put(AdjustSociomantic.SCMQuantity, 1); - - -Map product2 = new HashMap<>(); -product2.put(AdjustSociomantic.SCMProductID, "2"); - -String product3 = "3"; - -List products = Arrays.asList(product1, product2, product3); - -Map parameters = new HashMap<>(); -parameters.put(AdjustSociomantic.SCMCurrency, "EUR"); -parameters.put(AdjustSociomantic.SCMAmount, 42); - -AdjustSociomantic.injectConfirmedTransactionIntoEvent(event, "123456", products, parameters); - -Adjust.trackEvent(event); -``` - -*トランザクションのレポートに利用できるカートパラメータ* - -カートパラメータをご参照ください。 - -*トランザクションのレポートに利用できるトランザクションパラメータ* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
パラメータ名条件説明備考
SCMAmount任意小数値の販売価格 (例 2.99)小数点にはドットをお使いください。ドットやカンマなどの3桁区切りは入れないでください。個数が2以上であっても、1商品あたりの価格を入れてください。
SCMCurrency任意ISO 4217 formatにおける通貨コード (例 EUR)トラッキングコード例で確認できます。
SCMQuantity任意選択したプロダクトの個数整数値を入れてください。
- -### リードイベント - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(LEAD_TOKEN); - -AdjustSociomantic.injectLeadIntoEvent(event, "123456"); - -Adjust.trackEvent(event); -``` - -リードが確認済みであれば - -```java -import com.adjust.sdk.plugin.AdjustSociomantic; - -AdjustEvent event = new AdjustEvent(LEAD_TOKEN); - -AdjustSociomantic.injectLeadIntoEvent(event, "123456", Boolean.TRUE); - -Adjust.trackEvent(event); -``` diff --git a/doc/japanese/plugins/trademob.md b/doc/japanese/plugins/trademob.md deleted file mode 100644 index 9e18370e6..000000000 --- a/doc/japanese/plugins/trademob.md +++ /dev/null @@ -1,96 +0,0 @@ -## Trademobプラグイン - -Adjust SDKとTrademobプラグインのdependencyを追加してください。 - -``` -compile 'com.adjust.sdk:adjust-android-trademob:4.11.3' -``` - -Or integrate adjust with Trademob events by following these steps: -もしくは、以下の手順でAdjustとTrademobイベントを連携できます。 - -1. `plugin/Trademob`フォルダを[releases page](https://github.com/adjust/android_sdk/releases)からダウンロードアーカイブに置いてください。 - -2. Android Studio上で`adjust`モジュールを開き、`plugin`パッケージフォルダを`adjust/java/com/adjust/sdk`に置いてください。 - -3. ダウンロードした`plugin/Trademob/com/adjust/sdk/plugin`フォルダから`AdjustTrademob.java`と`TrademobItem.java`ファイルをドラッグし、`adjust`プロジェクトの`plugin`フォルダに入れてください。 - -プラグインに関するご質問は、`eugenio.warglien@trademob.com`までご連絡ください。 - -これで下記の例のようにTrademobイベントを利用できます。 - -### リストを見る - -```java -import com.adjust.sdk.plugin.AdjustTrademob; - -AdjustEvent event = new AdjustEvent("{viewListingEventToken}"); - -List items = Arrays.asList("itemId1", "itemId2", "itemId3"); - -Map metadata = new HashMap<>(); -metadata.put("info1", "value1"); -metadata.put("info2", "value2"); - -AdjustTrademob.injectViewListingIntoEvent(event, items, metadata); - -Adjust.trackEvent(event); -``` - -### 商品を見る - -```java -import com.adjust.sdk.plugin.AdjustTrademob; - -AdjustEvent event = new AdjustEvent("{viewItemEventToken}"); - -Map metadata = new HashMap<>(); -metadata.put("info1", "value1"); -metadata.put("info2", "value2"); - -AdjustTrademob.injectViewItemIntoEvent(event, "itemId1", metadata); - -Adjust.trackEvent(event); -``` - -### 買い物かごに追加 - -```java -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 items = Arrays.asList(itemId1, itemId2, itemId3); - -AdjustTrademob.injectAddToBasketIntoEvent(event, items, null); - -Adjust.trackEvent(event); -``` - -### チェックアウト - -```java -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 items = Arrays.asList(itemId1, itemId2, itemId3); - -Map metadata = new HashMap<>(); -metadata.put("info1", "value1"); -metadata.put("info2", "value2"); - -AdjustTrademob.injectCheckoutIntoEvent(event, items, metadata); - -Adjust.trackEvent(event); -``` diff --git a/doc/japanese/sdk-to-sdk/admob.md b/doc/japanese/sdk-to-sdk/admob.md deleted file mode 100644 index 5e0e110da..000000000 --- a/doc/japanese/sdk-to-sdk/admob.md +++ /dev/null @@ -1,30 +0,0 @@ -# AdMobの広告収益をAdjust SDKで計測 - -[Adjust Android SDK README][android-readme] - -この機能に必須のSDKバージョン: - -- **Adjust SDK v4.28.0** - -Admob SDKで広告収益を計測する場合は、AdjustのSDK間連携の機能を使用することで、この情報をAdjustバックエンドに渡すことができます。これを行うには、記録する情報を含むAdjust広告収益オブジェクトを作成し、そのオブジェクトを`trackAdRevenue`メソッドに渡す必要があります。 - -> 注:Admobによる広告収益計測についてご質問がありましたら、担当のアカウントマネージャー、または[support@adjust.com](mailto:support@adjust.com)までお問い合わせください。 - -### サンプル - -```java -rewardedAd = new RewardedAd(this, AD_UNIT_ID); -// set paid event listener -rewardedAd.setOnPaidEventListener(new OnPaidEventListener() { - @Override - public void onPaidEvent(AdValue adValue) { - // ... - // send ad revenue info to Adjust - AdjustAdRevenue adRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_ADMOB); - adRevenue.setRevenue(adValue.getValueMicros() / 1000000, adValue.getCurrencyCode()); - Adjust.trackAdRevenue(adRevenue); - } -} -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/japanese/README.md diff --git a/doc/japanese/sdk-to-sdk/applovin-max.md b/doc/japanese/sdk-to-sdk/applovin-max.md deleted file mode 100644 index 57c1de434..000000000 --- a/doc/japanese/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,29 +0,0 @@ -# AppLovin MAXの広告収益をAdjust SDKで計測 - -[Adjust Android SDK README][android-readme] - -この機能に必須のSDKバージョン: - -- **Adjust SDK v4.28.0** - -AppLovin MAX SDKで広告収益を計測する場合は、AdjustのSDK間連携の機能を使用することで、この情報をAdjustバックエンドに渡すことができます。これを行うには、ソースに`AD_REVENUE_APPLOVIN_MAX`を指定して`trackAdRevenue`を呼び出します。 - -> 注:AppLovin MAXによる広告収益計測についてご質問がありましたら、担当のアカウントマネージャー、または[support@adjust.com](mailto:support@adjust.com)までお問い合わせください。 - -### サンプル - -```java -@Override -public void onAdRevenuePaid(final MaxAd ad) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue( AdjustConfig.AD_REVENUE_APPLOVIN_MAX); - adjustAdRevenue.setRevenue(ad.getRevenue(),"USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.getNetworkName()); - adjustAdRevenue.setAdRevenueUnit(ad.getAdUnitId()); - adjustAdRevenue.setAdRevenuePlacement(ad.getPlacement()); - - Adjust.trackAdRevenue(adjustAdRevenue); -} - -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/japanese/README.md diff --git a/doc/japanese/sdk-to-sdk/ironsource.md b/doc/japanese/sdk-to-sdk/ironsource.md deleted file mode 100644 index 96094f58c..000000000 --- a/doc/japanese/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# ironSourceの広告収益をAdjust SDKで計測 - -[Adjust Android SDK README][android-readme] - -この機能に必須のSDKバージョン: - -- **Adjust SDK v4.28.0** - -ironSource SDKで広告収益を計測する場合は、AdjustのSDK間連携の機能を使用することで、この情報をAdjustバックエンドに渡すことができます。これを行うには、ソースに`AD_REVENUE_IRONSOURCE`を指定して`trackAdRevenue`を呼び出します。 - -> 注:ironSourceによる広告収益計測についてご質問がありましたら、担当のアカウントマネージャー、または[support@adjust.com](mailto:support@adjust.com)までお問い合わせください。 - -### サンプル - -```java -public void onImpressionSuccess (ImpressionData impressionData) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_IRONSOURCE); - adjustAdRevenue.setRevenue(impressionData.getRevenue(),"USD"); - // optional fields - adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdNetwork()); - adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnit()); - adjustAdRevenue.setAdRevenuePlacement(impressionData.getPlacement()); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/japanese/README.md diff --git a/doc/japanese/sdk-to-sdk/mixpanel.md b/doc/japanese/sdk-to-sdk/mixpanel.md deleted file mode 100644 index 165cdf2c8..000000000 --- a/doc/japanese/sdk-to-sdk/mixpanel.md +++ /dev/null @@ -1,59 +0,0 @@ -##adjustとMixpanel SDKの連携 - -Mixpanel APIは共通のプロパティを`super properties`としてすべてのアクティビティで送信できるよう登録できます。 -詳しくは[Mixpanelのページ][mixpanel_android]でご確認いただけます。 -Mixpanelのトラッキングされるすべてのイベントとadjustを連携させるには、 -アトリビューションデータを受け取った後に`super properties`を設定する必要があります。 -Android SDKガイドの[リスナ][listener]の項目を参考に実装してください。 -Mixpanel APIを使うためのデリゲート関数は次のようになります。 - -```java -public class YourApplicationClass extends Application { - @Override - public void onCreate() { - super.onCreate(); - // configure Adjust - String appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - - config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) { - MixpanelAPI mixpanel = MixpanelAPI.getInstance(context, MIXPANEL_TOKEN); - - // The adjust properties will be sent - // with all future track calls. - JSONObject props = new JSONObject(); - - insertJsonProperty(props, "[Adjust]Network", attribution.network); - - insertJsonProperty(props, "[Adjust]Campaign", attribution.campaign); - - insertJsonProperty(props, "[Adjust]Adgroup", attribution.adgroup); - - insertJsonProperty(props, "[Adjust]Creative", attribution.creative); - - if (props.length() > 0) - mixpanel.registerSuperProperties(props); - } - - private void insertJsonProperty(JSONObject props, String name, String value) { - try { - if (value != null) { - props.put(name, value); - } - } catch(JSONException e) { } - } - }); - - Adjust.onCreate(config); - } -} -``` - -このインターフェイスを実装する前に、[データの取り扱い][attribution_data]についてご確認ください。 - -[mixpanel_android]: https://mixpanel.com/help/reference/android#superproperties -[attribution_data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[listener]: https://github.com/adjust/android_sdk/tree/master#13-set-listener-for-delegate-notifications diff --git a/doc/japanese/sdk-to-sdk/mopub.md b/doc/japanese/sdk-to-sdk/mopub.md deleted file mode 100644 index 03287a258..000000000 --- a/doc/japanese/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,24 +0,0 @@ -## MoPubの広告収益をAdjust SDKで計測 - -[Adjust Android SDK README][android-readme] - -[MoPub Android documentation][mopub-docs] - -本機能には以下のSDKバージョンとそれ以降のバージョンが必須となります: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -MoPub SDKの`onImpression`コールバックメソッドの実装内で、以下のようにAdjust SDKの`trackAdRevenue`メソッドを呼び出す必要があります。 - -```java -public void onImpression(@NonNull final String adUnitId, @Nullable final ImpressionData impressionData) { - // インプレッションデータのJSONをAdjust SDKにパスします。 - Adjust.trackAdRevenue(AdjustConfig.AD_REVENUE_MOPUB, impressionData.getJsonRepresentation()); -} -``` - -MoPub連携による広告収益計測についてご質問がございましたら、担当のアカウントマネージャーもしくはsupport@adjust.comまでお問い合わせください。 - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[android-readme]: ../../japanese/README.md diff --git a/doc/korean/README.md b/doc/korean/README.md deleted file mode 100644 index 12fc3dcf3..000000000 --- a/doc/korean/README.md +++ /dev/null @@ -1,2297 +0,0 @@ -**본 가이드는 만료되었습니다.** - -본 README 파일은 얼마 후 만료될 예정입니다. 당사 헬프 센터에서 SDK 문서를 열람하실 수 있습니다. - -* [English][en-helpcenter] -* [中文][zh-helpcenter] -* [日本語][ja-helpcenter] -* [한국어][ko-helpcenter] - -## 요약 - -Adjust™의 Android SDK에 관한 문서입니다. Adjust™에 대한 자세한 정보는 [adjust.com]에서 확인하십시오. - - -제공되는 언어: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## 목차 - - -### 빠른 시작 - - * [앱 예시](#qs-example-apps) - * [시작하기](#qs-getting-started) - * [프로젝트에 SDK 추가](#qs-add-sdk) - * [Google Play 서비스 추가](#qs-gps) - * [권한 추가](#qs-permissions) - * [Proguard 설정](#qs-proguard) - * [설치 리퍼러](#qs-install-referrer) - * [Google Play 리퍼러 API](#qs-gpr-api) - * [Google Play Store intent](#qs-gps-intent) - * [Huawei 리퍼러 API](#qs-huawei-referrer-api) - * [앱에 SDK 연동](#qs-integrate-sdk) - * [기본 설정](#qs-basic-setup) - * [네이티브 앱 SDK](#qs-basic-setup-native) - * [웹뷰 SDK](#qs-basic-setup-web) - * [세션 트래킹](#qs-session-tracking) - * [API 레벨 14 및 이상](#qs-session-tracking-api-14) - * [API 레벨 9~13](#qs-session-tracking-api-9) - * [SDK 서명](#qs-sdk-signature) - * [Adjust 로깅(logging)](#qs-adjust-logging) - * [앱 빌드하기](#qs-build-the-app) - -## 딥링크 - - * [딥링크 개요](#dl) - * [표준 딥링크 시나리오](#dl-standard) - * [디퍼드 딥링크 시나리오](#dl-deferred) - * [딥링크를 통한 리어트리뷰션](#dl-reattribution) - * [링크 해석](#link-resolution) - -### 이벤트 추적 - - * [이벤트 추적](#et-tracking) - * [매출 추적](#et-revenue) - * [매출 중복 제거](#et-revenue-deduplication) - * [인앱 구매 검증](#et-purchase-verification) - -### 커스텀 파라미터 - - * [커스텀 파라미터 개요](#cp) - * [이벤트 파트너 파라미터](#cp-event-partner-parameters) - * [이벤트 콜백 파라미터](#cp-event-callback-parameters) - * [이벤트 파트너 파라미터](#cp-event-partner-parameters) - * [이벤트 콜백 식별자](#cp-event-callback-id) - * [세션 파라미터](#cp-session-parameters) - * [세션 콜백 파라미터](#cp-session-callback-parameters) - * [세션 파트너 파라미터](#cp-session-partner-parameters) - * [지연 시작](#cp-delay-start) - -### 부가 기능 - - * [푸시 토큰(삭제 트래킹)](#af-push-token) - * [어트리뷰션 콜백](#af-attribution-callback) - * [광고 매출 트래킹](#af-ad-revenue) - * [구독 트래킹](#af-subscriptions) - * [세션 및 이벤트 콜백](#af-session-event-callbacks) - * [유저 어트리뷰션](#af-user-attribution) - * [기기 ID](#af-device-ids) - * [Google Play 서비스 광고 식별자](#af-gps-adid) - * [Amazon 광고 식별자](#af-amazon-adid) - * [Adjust 기기 식별자](#af-adid) - * [사전 설치 앱](#af-preinstalled-apps) - * [오프라인 모드](#af-offline-mode) - * [트래킹 비활성화](#af-disable-tracking) - * [이벤트 버퍼링](#af-event-buffering) - * [백그라운드 트래킹](#af-background-tracking) - * [GDPR 잊혀질 권리(Right to be Forgotten)](#af-gdpr-forget-me) - * [서드파티 공유](#af-third-party-sharing) - * [서드파티 공유 비활성화](#af-disable-third-party-sharing) - * [Enable third-party sharing](#af-enable-third-party-sharing) - * [Consent measurement](#af-measurement-consent) - -### 테스트 및 문제 해결 - - * ["세션 실패(너무 빈번한 세션 거부 )" 오류가 발생한 경우](#tt-session-failed) - * [브로드캐스트 리시버가 설치 리퍼러를 포착하는지 확인하고 싶은 경우](#tt-broadcast-receiver) - * [앱 실행 시 이벤트 트리거 가능 여부](#tt-event-at-launch) - -### 라이센스 - - -## 빠른 시작 - -### 예시 앱 - -[`example-app-java`][example-java], [`example-app-kotlin`][example-kotlin],[`example-app-keyboard`][example-keyboard] 디렉터리에는 Android 예시 앱이 있으며, [`example-webbridge` directory][example-webbridge] 안에는 웹뷰를 사용하는 예시 앱, [`example-app-tv`][example-tv] 디렉터리 안에는 Android TV 예시 앱이 있습니다. Android 프로젝트를 열어 Adjust SDK가 어떻게 연동될 수 있는지 예시를 확인할 수 있습니다. - -### 시작하기 - -다음은 Android 앱에 Adjust SDK를 연동하는 데 필요한 최소한의 단계입니다. 본 설명에서는 Android 앱 개발에 Android 스튜디오를 사용하고 있다고 가정하겠습니다. Adjust SDK 연동에 필요한 Android API의 최소 지원 레벨은 **9 (Gingerbread)** 입니다. - -### 프로젝트에 SDK 추가하기 - -Maven을 사용하는 경우, 다음을 `build.gradle` 파일에 추가하시기 바랍니다. - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -앱의 웹뷰 안에서 Adjust SDK를 사용하고자 하는 경우, 다음의 추가적인 dependency를 추가하시기 바랍니다. - -```gradle -implementation 'com.adjust.sdk:adjust-android-webbridge:4.31.0' -``` - -**참고**: 웹뷰 확장에 필요한 Android API의 최소 지원 레벨은 17(Jelley Bean)입니다. - -Adjust SDK와 웹뷰 확장을 JAR 파일로 추가할 수도 있습니다. 이는 Adjust의 [releases page][releases]에서 다운로드하실 수 있습니다. - -### Google Play Services 추가하기 - -2014년 8월 1일 이후부터 Google Play Store의 모든 앱은 고유 기기 식별을 위해 반드시 [Google Advertising ID][google-ad-id]를 사용해야 합니다. Adjust SDK에서 Google 광고 ID를 활성화하려면, [Google Play Services][google-play-services]를 반드시 연동해야 합니다. 이 과정을 아직 완료하지 않았다면, Google Play Services 라이브러리에 dependency를 추가하시기 바랍니다. 이는 앱의 `build.gradle` 파일의 `dependencies` 블록에 다음의 dependency를 추가하면 됩니다. - -```gradle -implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' -``` - -**참고**: Adjust SDK는 Google Play Services 라이브러리의 `play-services-analytics`의 그 어떤 버전과도 연결되어있지 않습니다. 라이브러리에서 최신 버전을 사용하거나 필요한 버전을 사용하시기 바랍니다. - -### 권한 추가하기 - -Adjust SDK는 다음의 권한을 필요로합니다. 아직 다음의 권한이 보이지 않는다면 이를 `AndroidManifest.xml` 파일에 추가하시기 바랍니다. - -```xml - - -``` - -**Google Play Store를 타게팅하지 않는 경우**, 다음의 권한을 반드시 추가해야 합니다. - -```xml - -``` - -#### Google 광고 ID 수집을 위해 권한 추가하기 - -Android 12 이상(API 레벨 31)을 타겟팅 하는 경우, 기기의 광고 ID를 읽기 위해 `com.google.android.gms.AD_ID` 권한을 추가해야 합니다. 다음의 라인을 `AndroidManifest.xml`에 추가하여 권한을 활성화합니다. - -```xml - -``` - -자세한 정보는 [Google의 `AdvertisingIdClient.Info` 문서](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)를 참조하시기 바랍니다. - -### Proguard 설정 - -Proguard를 사용하는 경우, Proguard 파일에 다음 줄을 추가하세요. - -``` --keep class com.adjust.sdk.** { *; } --keep class com.google.android.gms.common.ConnectionResult { - int SUCCESS; -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { - com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); -} --keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { - java.lang.String getId(); - boolean isLimitAdTrackingEnabled(); -} --keep public class com.android.installreferrer.** { *; } -``` - -**Google Play Store**에 앱을 게시하지 않는 경우, 다음의 `com.adjust.sdk` 패키지 규칙을 사용하시기 바랍니다. - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### 설치 리퍼러 - -앱 설치를 소스에 올바르게 어트리뷰션하기 위해 Adjust는 **설치 리퍼러**에 관한 정보가 필요합니다. 이는 2가지 방식으로 가능합니다: **Google Play 리퍼러 API***를 사용하거나 **Google Play Store 인텐트**를 브로드캐스트 리시버로 수집. - -**중요**: Google은 보다 안전하고 신뢰할 수 있는 방식으로 설치 리퍼러를 획득할 수 있도록 지원하고, 클릭 주입에 대응할 수 있도록 하기 위해 Google Play 리퍼러 API를 도입했습니다. Adjust는 앱에서 이를 반드시 지원하기를 **강력히 권고드립니다**. Google Play 스토어 인텐트는 상대적으로 덜 안전한 설치 리퍼러 획득 방식입니다. 당분간은 새로운 Google Play 리퍼러 API와 함께 사용 가능하지만, 향후 지원이 중단될 예정입니다. - -#### Google Play 리퍼러 API - -앱에서 Google Play 리퍼러 API를 지원하려면 [프로젝트에 SDK 추가하기](#qs-add-sdk) 부분을 참조하여 올바르게 수행하고, 다음의 줄을 `build.gradle` 파일에 추가하시기 바랍니다. - -``` -implementation 'com.android.installreferrer:installreferrer:2.2' -``` - -[Proguard 설정](#qs-proguard)의 설명을 올바르게 수행하시기 바랍니다. 언급된 모든 규칙을 비롯하여 특히 본 기능을 위해 필요한 규칙을 추가했는지 확인하시기 바랍니다. - -``` --keep public class com.android.installreferrer.** { *; } -``` - -**Adjust SDK v4.12.0 이상 버전**을 사용 중인 경우 이 기능이 지원됩니다. - -#### Google Play Store 인텐트 - -**참고**: Google은 [발표](https://android-developers.googleblog.com/2019/11/still-using-installbroadcast-switch-to.html)를 통해 2021년 3월 1일자로 리퍼러 정보 전달에 사용되는 `INSTALL_REFERRER` 인텐트 사용에 대한 지원을 중단한다고 발표했습니다. 만약 리퍼러 정보를 얻기 위해 해당 방식을 사용하고 있다면, [Google Play 리퍼러 API](#qs-gpr-api) 방식으로 전환하시기 바랍니다. - -브로드캐스트 리시버를 통해 Google Play Store `INSTALL_REFERRER` 인텐트를 캡쳐할 수 있습니다. `INSTALL_REFERRER` 인텐트를 수신하기 위한 목적으로 **자체 브로드캐스트 리시버를 사용하고 있지 않은 경우**, `AndroidManifest.xml` 내 `application` 태그에 다음의 `receiver` 태그를 추가하시기 바랍니다. - -```xml - - - - - -``` - -Adjust는 본 브로드캐스트 리시버를 사용하여 설치 리퍼러를 조회하고 백엔드로 전송합니다. - -`INSTALL_REFERRER` 인텐트에 다른 브로드캐스트 리시버를 사용하고 있다면, Adjust 브로드캐스트 리시버에 메시지를 적절하게 보낼 수 있도록 본 [리퍼러 가이드]를 참조하시기 바랍니다. - -#### Huawei 리퍼러 API - -Adjust SDK 4.21.1 버전부터는 Huawei 앱 갤러리 버전이 10.4 이상인 Huawei 기기에 설치 추적을 지원합니다. Huawei 리퍼러 API를 사용하기 위해 추가적인 연동 단계를 수행하지 않아도 됩니다. - -### 앱에 SDK 연동하기 - -우선 기본 세션 트래킹 설정에 관해 다루도록 하겠습니다. - -### 기본 설정 - -네이티브 앱에 SDK를 연동하는 경우 [네티이브 앱 SDK](#qs-basic-setup-native)를 참조하시기 바랍니다. 웹뷰 내 사용을 위해 SDK를 연동하는 경우 아래의 [웹뷰 SDK](#qs-basic-setup-web)를 참조하시기 바랍니다. - -#### 네이티브 앱 SDK - -Adjust는 SDK 초기화를 위해 글로벌 Android [어플리케이션][android-application] 클래스를 사용하는 것을 추천합니다. 앱에 아직 없다면 다음의 단계를 수행하시기 바랍니다: - -- `Application`을 확장하는 클래스를 생성합니다. -- `AndroidManifest.xml` 파일을 열고, `` 요소를 찾습니다. -- `android:name` 어트리뷰션을 추가하고, 신규 어플리케이션 클래스의 이름으로 설정합니다. - - Adjust의 예시 앱에서는 `GlobalApplication`라고 명명된 `Application` 클래스를 사용합니다. 이에 따라 매니페스트 파일을 다음과 같이 구성합니다. - ```xml - - - ``` - -- `Application` 클래스에서, `onCreate` 메서드를 찾거나 생성합니다. 다음의 코드를 추가하여 Adjust SDK를 초기화합니다. - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - string appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - } - } - ``` - -'{YourAppToken}'을 사용 중인 앱 토큰으로 교체한 다음, [Dashboard]에서 결과를 확인해 보세요. - -이후 `environment`를 샌드박스나 기타 프로덕션 모드로 설정해야 합니다. - -```java -String environment = AdjustConfig.ENVIRONMENT_SANDBOX; -String environment = AdjustConfig.ENVIRONMENT_PRODUCTION; -``` - -**중요:** 이 값은 앱을 테스트하는 상황에서만`AdjustConfig.ENVIRONMENT_SANDBOX`로 설정해야 합니다. 앱을 퍼블리시하기 전, 환경을 `AdjustConfig.ENVIRONMENT_PRODUCTION`으로 설정하시기 바랍니다. 앱 개발 및 테스트를 새로 시작하는 경우, 환경을 다시 `AdjustConfig.ENVIRONMENT_SANDBOX`로 설정하시기 바랍니다. - -Adjust는 테스트 기기로 인해 발생하는 테스트 트래픽과 실제 트래픽을 구분하기 위해 이와 같이 각기 다른 환경을 사용하므로, 반드시 상황에 알맞은 환경을 설정하시기 바랍니다. - -#### 웹뷰 SDK - -`WebView` 객체에 대한 레퍼런스를 획득한 이후: - -- `webView.getSettings().setJavaScriptEnabled(true)`를 호출하여 웹뷰에서 자바스크립트를 활성화합니다. -- `AdjustBridgeInstance`의 기본값 인스턴스를 시작합니다. 이는 `AdjustBridge.registerAndGetInstance(getApplication(), webview)`를 호출하면 됩니다. -- 이는 또한 Adjust 브릿지를 자바스크립트 인터페이스로서 웹뷰에 등록하게 됩니다. -- 필요한 경우 `AdjustBridge.setWebView()`를 호출하여 새로운 `WebView`를 설정합니다. -- `AdjustBridge.unregister()`를 호출하여 `AdjustBridgeInstance`와 `WebView`의 등록을 취소합니다. - -위 단계를 모두 완료하면 액티비티는 다음과 같아야 합니다. - -```java -public class MainActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) \{ - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - WebView webView = (WebView) findViewById(R.id.webView); - webView.getSettings().setJavaScriptEnabled(true); - webView.setWebChromeClient(new WebChromeClient()); - webView.setWebViewClient(new WebViewClient()); - - AdjustBridge.registerAndGetInstance(getApplication(), webview); - try { - webView.loadUrl("file:///android_asset/AdjustExample-WebView.html"); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override - protected void onDestroy() { - AdjustBridge.unregister(); - - super.onDestroy(); - } -} -``` - -본 단계를 완료하면 Adjust 브릿지가 앱에 성공적으로 추가됩니다. 이제 Javascript 브릿지가 활성화되어 Adjust의 네티이브 Android SDK와 페이지 간에 커뮤니케이션이 가능하며, 이는 웹뷰에 로딩됩니다. - -asset 폴더에 있는 Adjust Javascript트 파일을 HTML 파일에 가져오시기 바랍니다. HTML 파일도 해당 폴더에 있는 경우 다음과 같이 가져오시기 바랍니다. - -```html - - - - -``` - -Javascript 파일에 레퍼런스를 추가한 뒤, HTML 파일에서 이를 사용하여 Adjust SDK를 초기화하시기 바랍니다. - -```js -let yourAppToken = '{YourAppToken}'; -let environment = AdjustConfig.EnvironmentSandbox; -let adjustConfig = new AdjustConfig(yourAppToken, environment); - -Adjust.onCreate(adjustConfig); -``` - -'{YourAppToken}'을 사용 중인 앱 토큰으로 교체한 다음, [Dashboard]에서 결과를 확인해 보세요. - -이후 현재 상황이 테스트 상황인지 프로덕션 모드인지에 따라 `environment`를 이에 상응하는 값으로 설정합니다. - -```js -let environment = AdjustConfig.EnvironmentSandbox; -let environment = AdjustConfig.EnvironmentProduction; -``` - -**중요:** 앱을 테스트하는 경우에만 값을 `AdjustConfig.EnvironmentSandbox`로 설정하시기 바랍니다. 앱을 게시하기 전, 환경을 `AdjustConfig.EnvironmentProduction`로 설정하시기 바랍니다. 앱 개발 및 테스트를 새로 시작한다면 `AdjustConfig.EnvironmentSandbox`로 다시 설정하시기 바랍니다. - -테스트 기기로 인해 발생하는 테스트 트래픽과 실제 트래픽을 구분하기 위해 다른 환경모드를 사용하고 있음으로, 상황에 알맞은 설정을 적용하시기 바랍니다. - -### 세션 트래킹 - -**중요**: 본 단계는 **매우 중요합니다**. **앱에서 다음의 사항을 올바르게 수행**하시기 바랍니다. 본 단계를 올바르게 완료해야만 Adjust SDK가 앱에서의 세션을 트래킹할 수 있습니다. - -#### API 레벨 14 이상 - -- `ActivityLifecycleCallbacks` 인터페이스를 시행하는 비공개 클래스를 추가합니다. 본 인터페이스에 액세스할 수 없다면 앱이 타게팅하는 Android API 레벨이 14 이하인 것입니다. 다음의 [설명](#qs-session-tracking-api-9)을 참조하여 각 액티비티를 수동으로 업데이트하시기 바랍니다. `Adjust.onResume`와 `Adjust.onPause` 콜이 앱의 액티비티에 각각 있다면, 이를 삭제해야 합니다. -- `onActivityResumed(Activity activity)` 메서드를 수정하고, `Adjust.onResume()`에 콜을 추가합니다. 그리고 -`onActivityPaused(Activity activity)` 메서드를 수정하고, `Adjust.onPause()`에 콜을 추가합니다. -- `onCreate()` 메서드를 Adjust SDK에 추가하고, `registerActivityLifecycleCallbacks`를 생성된 `ActivityLifecycleCallbacks` 클래스의 인스턴스와 전송합니다. - - ```java - import com.adjust.sdk.Adjust; - import com.adjust.sdk.AdjustConfig; - - public class GlobalApplication extends Application { - @Override - public void onCreate() { - super.onCreate(); - - string appToken = "{YourAppToken}"; - String environment = AdjustConfig.ENVIRONMENT_SANDBOX; - AdjustConfig config = new AdjustConfig(this, appToken, environment); - Adjust.onCreate(config); - - registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); - } - - private static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks { - @Override - public void onActivityResumed(Activity activity) { - Adjust.onResume(); - } - - @Override - public void onActivityPaused(Activity activity) { - Adjust.onPause(); - } - - //... - } - } - ``` - -#### API 9~13 레벨 - -gradle의 앱 `minSdkVersion`이 `9`에서 `13` 사이인 경우 연동 과정의 간소화를 위해 이를 최소 `14`로 업데이트하시기 바랍니다. 공식 Android [대시보드][android-dashboard]에서 주요 버전의 최신 시장 점유율 정보를 확인하시기 바랍니다. - -세션 트래킹을 적절하게 수행하기 위해, 액티비티가 재개되거나 중단된 경우 Adjust SDK 메서드가 호출됩니다. (이렇게 하지 않으면 SDK가 세션 시작과 종료를 놓칠 수 있음.) 이를 위해 앱의 **각 액티비티마다** 다음의 단계를 수행하시기 바랍니다. - -- 액티비티의 `onResume` 메서드에서 `Adjust.onResume()`를 호출합니다. 필요한 경우 본 메서드를 생성합니다. -- 액티비티의 `onPause` 메서드에서 `Adjust.onPause()`를 호출합니다. 필요한 경우 본 메서드를 생성합니다. - -위 단계를 모두 완료하면 액티비티는 다음과 같아야 합니다. - -```java -import com.adjust.sdk.Adjust; - -public class YourActivity extends Activity { - protected void onResume() { - super.onResume(); - Adjust.onResume(); - } - protected void onPause() { - super.onPause(); - Adjust.onPause(); - } -} -``` - -앱에서 **각 액티비티에 대하여** 위 단계를 반복하시기 바랍니다. 새로운 액티비티 생성 시, 위 단계를 반드시 반복하시기 바랍니다. 코딩 스타일에 따라, 모든 액티비티에 대해 공통 슈퍼클래스에서 본 단계를 이행할 수도 있습니다. - -### SDK 서명 - -계정 관리자는 애드저스트 SDK 서명을 활성화해야 합니다. 이 기능의 사용에 관심이 있는 경우 Adjust 고객 지원팀(support@adjust.com)에 문의하시기 바랍니다. - -SDK 서명이 이미 계정에서 활성화되어 있으며 Adjust 대시보드의 App Secret에 액세스할 수 있는 경우, 아래 방법을 사용하여 SDK 서명을 앱에 연동하세요. - -앱 시크릿은 설정 인스턴스에서 `setAppSecret`를 호출하여 설정됩니다. - - - - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); -config.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAppSecret(secretId, info1, info2, info3, info4); -Adjust.onCreate(adjustConfig); -``` -
- -### Adjust 로그 - -다음 파라미터 중 하나를 통해 config 인스턴스에서 `setLogLevel`을 호출하여 테스트하는 동안 조회할 로그의 양을 늘리거나 줄일 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -config.setLogLevel(LogLevel.VERBOSE); // enable all logs -config.setLogLevel(LogLevel.DEBUG); // disable verbose logs -config.setLogLevel(LogLevel.INFO); // disable debug logs (default) -config.setLogLevel(LogLevel.WARN); // disable info logs -config.setLogLevel(LogLevel.ERROR); // disable warning logs -config.setLogLevel(LogLevel.ASSERT); // disable error logs -config.setLogLevel(LogLevel.SUPRESS); // disable all logs -``` -
-Web View SDK -
- -```js -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // enable all logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug); // disable verbose logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo); // disable debug logs (default) -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn); // disable info logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelError); // disable warning logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert); // disable error logs -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); // disable all logs -``` -
- -로그 출력을 모두 비활성화하려면, 로그 레벨을 'suppress'로 설정하고, config 객체에 생성자를 사용하시기 바랍니다. (그러면 suppress 로그 수준의 지원 여부를 나타내는 부울 자료 파라미터가 열립니다.) - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment, true); -config.setLogLevel(LogLevel.SUPRESS); -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment, true); -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress); -Adjust.onCreate(adjustConfig); -``` -
- -### 앱 빌드하기 - -Android 앱을 빌드하고 실행합니다. `LogCat` 뷰어에서 필터를 `tag:Adjust`로 설정하여 그 외 모든 로그를 숨깁니다. 앱이 실행된 이후 다음의 Adjust 로그가 나타나야 합니다:`Install tracked` - -## 딥링크 - -### 딥링크 개요 - -Adjust 트래커 URL에 딥링크를 활성화한 경우, 딥링크 URL과 그 콘텐츠에 대한 정보를 받아볼 수 있습니다. 유저는 앱이 기기에 설치되었거나(표준 딥링크 시나리오) 앱이 설치되지 않은 경우(디퍼드 딥링크 시나리오)에 관계없이 URL과 모두 상호작용할 수 있습니다. 표준 딥링크 시나리오에서 Android 플랫폼은 딥링크 콘텐츠에 관한 정보를 수신할 수 있는 가능성을 네이티브로 제공합니다. Android 플랫폼은 디퍼드 딥링크 시나리오를 자동으로 지원하지 않습니다. 이 경우, Adjust SDK는 딥링크 콘텐츠의 정보를 얻기 위해 필요한 메커니즘을 제공합니다. - -### 표준 딥링크 시나리오 - -이미 앱을 설치한 유저에 대하여 `deep_link` 파라미터가 포함된 Adjust 트래커 URL과 인게이지한 이후 앱이 실행되게 하고 싶다면, 앱에서 딥링크를 활성화하시기 바랍니다. 이는 원하는 **고유의 스킴 이름***을 선택하여 수행할 수 있습니다. `AndroidManifest.xml` 파일에서 유저가 트래커 URL을 클릭한 이후 앱이 열릴 때 실행시키고 싶은 활동에 이를 부여합니다. 매니페스트 파일에 `intent-filter` 섹션을 원하는 활동 정의에 추가하고, 원하는 스킴 이름과 함께 `android:scheme` 속성 값을 부여합니다. - -```xml - - - - - - - - - - - - - - -``` - -트래커 URL이 클릭 된 이후 앱이 실행되도록 하고 싶다면, Adjust 트래커 URL의 `deep_link` 파라미터에서 부여한 스킴 이름을 사용합니다. 딥링크에 별도의 정보가 추가되지 않은 트래커 URL은 아래와 같이 나타납니다. - -``` -https://app.adjust.com/abc123?deep_link=adjustExample%3A%2F%2F -``` - -URL에서 `deep_link` 파라미터를 **반드시 url 인코딩**해야 한다는 점을 기억하시기 바랍니다. - -앱이 위와 같이 설정되고 나면 유저가 트래커 URL을 클릭할 때 앱이 `MainActivity` 인텐트와 함께 실행되게 됩니다. `MainActivity` 클래스에서는 자동으로 `deep_link` 파라미터 콘텐츠에 관한 정보를 수신할 수 있습니다. 콘텐츠를 수신하고 나면 이는 (URL에서는 인코딩되었을지라도) 인코딩되지 **않습니다**. - -`AndroidManifest.xml` 파일 내에서의 `android:launchMode` 활동 설정은 활동 파일 내에서 `deep_link` 파라미터의 콘텐츠 전송 위치를 결정할 것입니다. `android:launchMode` 속성의 가능한 값에 대한 자세한 정보는 Android의 [공식 문서][android-launch-modes]를 참조하시기 바랍니다. - -원하는 활동 내의 딥링크 콘텐츠 정보는 `Intent` 객체를 통해 `onCreate` 또는 `onNewIntent` 메서드로 전달됩니다. 앱을 실행하고 이러한 메서드 중 하나를 트리거하면, 클릭 URL 안의 `deep_link` 파라미터에서 전송된 실제 딥링크를 수신할 수 있습니다. 이 정보를 사용하여 앱에서 추가적인 로직을 수행할 수 있습니다. - -딥링크 콘텐츠는 위의 두 가지 메서드 중 하나를 사용하여 다음과 같이 내보내기 할 수 있습니다. - -```java -@Override -protected void onCreate(Bundle savedInstanceState) \{ - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - // data.toString() -> deep_link 파라미터 값입니다. -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - // data.toString() -> deep_link 파라미터 값입니다. -} -``` - -### 디퍼드 딥링크 시나리오 - -디퍼드 딥링크 시나리오는 유저가 `deep_link` 파라미터를 포함한 Adjust의 트래커 URL을 클릭하였으나 클릭한 시점에 기기에 앱이 설치되어있지 않은 경우에 발생합니다. 이 경우 유저가 URL을 클릭하면 앱을 설치할 수 있도록 Play Store로 리디렉션됩니다. 앱을 최초 실행 시 `deep_link` 파라미터 콘텐츠가 앱으로 전달됩니다. - -Adjust SDK는 기본값 설정에 따라 디퍼드 딥링크를 엽니다. 따라서 별도의 설정이 필요 없습니다. - -#### 디퍼드 딥링크 콜백 - -Adjust SDk가 디퍼드 딥링크를 여는 것을 통제하고 싶다면 config 객체에서 콜백 메서드를 사용할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Evaluate the deeplink to be launched. -config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() { - @Override - public boolean launchReceivedDeeplink(Uri deeplink) { - // ... - if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) { - return true; - } else { - return false; - } - } -}); - -Adjust.onCreate(config); -``` - -Adjust SDK가 백엔드로부터 딥링크 정보를 수신하면, SDK는 이 내용을 수신기를 통해 전송하고 사용자로부터 `boolean` 값을 반환받을 것을 기대합니다. 반환 값은 Adjust SDK가 딥링크에서 스킴 이름이 부여된 활동을 실행해야 할지 말아야 할지에 대한 사용자의 결정을 보여줍니다. (표준 딥링크 시나리오와 유사) - -즉, 반환 값이 `true`인 경우 Adjust는 해당 활동을 실행하고, [표준 딥링크 시나리오](#dl-standard) 챕터에서 명시된 시나리오를 트리거합니다. SDK가 해당 활동을 실행하는 것을 원하지 않는다면 수신기에서 `false` 값을 반환하고, (딥링크 콘텐츠에 따라) 앱에서 다음에 무엇을 해야 할지 결정하시기 바랍니다. -
-Web View SDK -
- -```js -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setDeferredDeeplinkCallback(function (deeplink) {}); - -Adjust.onCreate(adjustConfig); -``` - -이 디퍼드 딥링크 시나리오에서는 cofig 객체에서 설정할 수 있는 추가적인 설정이 있습니다. Adjust SDK가 디퍼드 딥링크 정보를 획득하면, SDK가 이 URL을 열도록 할지 선택할 수 있습니다. cofig 객체에서 `setOpenDeferredDeeplink` 메서드를 호출하여 이 옵션을 설정할 수 있습니다. - -```js -// ... - -function deferredDeeplinkCallback(deeplink) {} - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setOpenDeferredDeeplink(true); -adjustConfig.setDeferredDeeplinkCallback(deferredDeeplinkCallback); - -Adjust.start(adjustConfig); - -``` - -콜백을 설정하지 않으면 **Adjust는 기본값 설정에 따라 항상 URL 실행을 시도할 것입니다.** -
- -### 딥링크를 통한 리어트리뷰션 - -Adjust는 딥링크를 통해 리인게이지먼트 캠페인을 집행할 수 있도록 지원합니다. 자세한 정보는 Adjust의 [공식 문서][reattribution-with-deeplinks]를 참조하시기 바랍니다. - -이 기능을 사용하려면, 앱에서 Adjust SDK로 추가적인 콜을 수행하여 Adjust가 적절하게 유저를 리어트리뷰션할 수 있도록 해야 합니다. - -앱에서 딥링크 콘텐츠를 수신했으면 `Adjust.appWillOpenUrl(Uri, Context)` 메서드에 콜을 추가합니다. 이 콜을 수행함으로써 Adjust SDK는 Adjust 백엔드로 정보를 전송하여 딥링크 내에 새로운 어트리뷰션 정보가 있는지 확인할 수 있습니다. 딥링크 콘텐츠를 포함하는 Adjust 트래커 URL의 클릭에 유저가 리어트리뷰션된 경우, 앱에서는 해당 유저에 대해 새로운 어트리뷰션 정보와 함께 [어트리뷰션 콜백](#af-attribution-callback)이 트리거 됩니다. - -`Adjust.appWillOpenUrl(Uri, Context)`는 다음과 같이 나타납니다. - -```java -@Override -protected void onCreate(Bundle savedInstanceState) \{ - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -```java -@Override -protected void onNewIntent(Intent intent) { - super.onNewIntent(intent); - - Uri data = intent.getData(); - Adjust.appWillOpenUrl(data, getApplicationContext()); -} -``` - -**참고**: `Adjust.appWillOpenUrl(Uri)` 메서드는 Android SDK v4.14.0부터 **지원 중단**되었습니다. 따라서, `Adjust.appWillOpenUrl(Uri, Context)` 메서드를 대신 사용하시기 바랍니다. - -**웹뷰 참고**: 웹뷰에서도 본 콜을 자바스크립트의 `Adjust.appWillOpenUrl` 기능을 통해 다음과 같이 수행할 수 있습니다. - -```js -Adjust.appWillOpenUrl(deeplinkUrl); -``` - -### 링크 해석 - -이메일 서비스 제공자(ESP)로부터의 딥링크를 제공하고 커스텀 트래킹 링크를 통해 클릭을 트래킹해야 하는 경우, `AdjustLinkResolution` 클래스의 `resolveLink` 메서드를 사용하여 링크를 해석할 수 있습니다. 이를 통해 딥링크가 앱에서 열렸을 때 이메일 트래킹 캠페인과의 교류를 기록할 수 있습니다. - -`resolveLink` 메서드는 다음의 파라미터를 사용합니다: - -- `url` - 앱을 연 딥링크 -- `resolveUrlSuffixArray` - 해석되어야 하는 구성된 캠페인의 커스텀 도메인 -- `adjustLinkResolutionCallback` - 최종 URL을 포함하는 콜백. - -수신한 링크가 `resolveUrlSuffixArray`에 명시된 도메인에 속하지 않는 경우, 해당 콜백은 딥링크 URL을 그대로 전달합니다. 링크가 명시된 도메인을 포함하는 경우, SDK는 링크 해석 시도하고, `callback` 파라미터로 결과 딥링크를 반환합니다. 반환된 딥링크는 또한 Adjust SDK에서 `Adjust.appWillOpenUrl` 메서드를 사용하여 리어트리뷰션될 수 있습니다. - -> **참고**: SDK는 URL 해석을 시도할 때 자동으로 최대 10개의 리다이렉트를 따르게 됩니다. SDK는 `callback` URL의 가장 마지막 URL을 반환하는데, 이는 따라야 할 리다이렉트가 10개 이상인 경우 **10번 째 리다이렉트 URL이** 반환됨을 의미합니다. - -**예시** - -```java -AdjustLinkResolution.resolveLink(url, - new String[]{"example.com"}, - new AdjustLinkResolution.AdjustLinkResolutionCallback() { - @Override - public void resolvedLinkCallback(Uri resolvedLink) { - Adjust.appWillOpenUrl(resolvedLink, getApplicationContext()); - } -}); -``` - -## 이벤트 추적 - -### 이벤트 트래킹 - -Adjust를 사용하여 앱의 모든 이벤트를 트래킹할 수 있습니다. 버튼을 탭하는 행동을 모두 트래킹하고 싶으시다면, [대시보드]에서 새로운 이벤트 토큰을 생성해야 합니다. 이벤트 토큰이 abc123`이라고 가정해 보겠습니다. 버튼의 `onClick` 메서드에 다음의 라인을 추가하여 클릭을 트래킹할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` -
- -### 매출 트래킹 - -유저가 광고를 탭하거나 인앱 구매를 통해 매출을 창출할 수 있는 경우, 이벤트를 통해 해당 매출을 트래킹할 수 있습니다. 광고를 한번 누르는 행위에 €0.01의 매출 금액이 발생한다고 가정해 보겠습니다. 매출 이벤트를 다음과 같이 추적할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01, 'EUR'); -Adjust.trackEvent(adjustEvent); -``` -
- -이는 콜백 파라미터와도 함께 사용할 수 있습니다. - -사용자가 통화 토큰을 설정하면, Adjust는 사용자의 선택에 따라 발생 매출을 선택한 보고 매출로 자동 전환합니다. 자세한 [통화 변환][currency-conversion] 정보는 여기에서 확인하시기 바랍니다. - -인앱 결제를 트래킹하려는 경우, 구매가 완료되고 아이템이 결제되었을 때만 `trackEvent`를 호출하시기 바랍니다. 이렇게 하면 실제로 발생하지 않은 매출을 추적하는 것을 방지할 수 있습니다. - -매출과 이벤트 트래킹에 대한 자세한 정보는 Adjust의 [이벤트 트래킹 가이드][event-tracking]를 참조하시기 바랍니다. - -### 매출 중복 제거 - -중복되는 매출 트래킹하는 것을 방지하기 위해 주문 ID를 선택적으로 추가할 수 있습니다. 마지막 10개의 주문 ID가 보관되며, 중복되는 주문 ID가 있는 매출 이벤트는 건너뛰게 됩니다. 이러한 방식은 인앱 결제 추적에 특히 유용합니다. 아래 예시를 참조하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setRevenue(0.01, "EUR"); -adjustEvent.setOrderId("{OrderId}"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setRevenue(0.01, 'EUR'); -adjustEvent.setOrderId('{OrderId}'); -Adjust.trackEvent(event); -``` -
- -### 인앱 결제 검증 - -서버측 영수증 검증 도구인 [Adjust의 결제 검증][android-purchase-verification]을 사용하여 앱에서 이루어진 인앱 결제를 검증할 수 있습니다. 링크를 클릭하여 자세한 내용을 확인하시기 바랍니다. - -## 맞춤 파라미터 - -### 맞춤 파라미터 개요 - -Adjust SDK가 기본적으로 수집하는 데이터 포인트 외에도 Adjust SDK를 사용하여 이벤트나 세션에 필요한 만큼의 맞춤 값을 추적하고 추가할 수 있습니다(사용자 ID, 제품 ID 등). 맞춤 파라미터는 원시 데이터로만 제공되며 Adjust 대시보드에 표시되지 **않습니다**. - -개인 내부용으로 수집하는 값의 경우 **콜백 파라미터**를 사용하고, 외부 파트너와 공유하는 값은 **파트너 파라미터**를 사용해야 합니다. 만약에 내부와 외부 모두를 위해 값(예: 구매 ID)이 트래킹되는 경우, 콜백과 파트너 파라미터 모두를 사용하여 트래킹하는 것을 권고합니다. - - -### 이벤트 파라미터 - -### 이벤트 콜백 파라미터 - -[대시보드]에서 이벤트를 위한 콜백 URL을 등록할 수 있습니다. Adjust는 이벤트가 트래킹될 때마다 해당 URL에 GET 요청을 보냅니다. 이벤트를 트래킹하기 전에 이벤트에서 'addCallbackParameter'를 호출하여 해당 이벤트에 콜백 파라미터를 추가 할 수 있습니다. 이후 Adjust는 해당 파라미터를 사용자의 콜백 URL에 추가합니다. - -예를 들어, 사용자가 이벤트를 위해 `http://www.example.com/callback` URL을 등록했으며 다음과 같은 이벤트를 추적한다고 가정해 보겠습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addCallbackParameter("key", "value"); -adjustEvent.addCallbackParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addCallbackParameter('key', 'value'); -adjustEvent.addCallbackParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -이 경우, Adjust가 이벤트를 추적하여 다음으로 요청을 전송합니다. - -``` -http://www.example.com/callback?key=value&foo=bar -``` - -Adjust는 파라미터 값으로 사용될 수 있는 `{gps_adid}` 등 다양한 플레이스홀더를 지원합니다. 결과 콜백에서 Adjust는 `{gps_adid}` 플레이스홀더를 현재 기기의 Google Play Services ID로 교체합니다. Adjust는 사용자의 맞춤 파라미터를 저장하지 않으며, 콜백에 **추가**만 합니다. 이벤트 콜백을 등록하지 않으면 Adjust가 맞춤 파라미터를 읽을 수 없습니다. - -Adjust [콜백 가이드][callbacks-guide]에서 URL 콜백에 대해 자세히 알아보시기 바랍니다. - -### 이벤트 파트너 파라미터 - -Adjust 대시보드에서 파라미터가 활성화되면, 이를 네트워크 파트너에게 전송할 수 있습니다. - -이는 위에서 설명된 콜백 파라미터와 같은 원리로 작동됩니다. 이벤트 인스턴스에 `addPartnerParameter` 메서드를 호출하여 추가할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.addPartnerParameter("key", "value"); -adjustEvent.addPartnerParameter("foo", "bar"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addPartnerParameter('key', 'value'); -adjustEvent.addPartnerParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` -
- -[특별 파트너 가이드][special-partners]에서 특별 파트너와 연동 방법에 대한 자세한 내용을 알아보실 수 있습니다. - -### 이벤트 콜백 ID - -트래킹하고자 하는 각 이벤트에 맞춤 문자열 ID를 추가할 수도 있습니다. 이 ID는 이후에 이벤트 성공 및/또는 이벤트 실패 콜백에서 보고되며, 이를 통해 성공적으로 트래킹된 이벤트와 그렇지 않은 이벤트를 확인할 수 있습니다. 이벤트 인스턴스에 `setCallbackId` 메서드를 호출하여 이 ID를 설정할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -adjustEvent.setCallbackId("Your-Custom-Id"); -Adjust.trackEvent(adjustEvent); -``` -
-Web View SDK -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -adjustEvent.setCallbackId('Your-Custom-Id'); -Adjust.trackEvent(adjustEvent); -``` -
- -### 세션 파라미터 - -세션 파라미터는 로컬에 저장되며, Adjust SDK의 모든 **이벤트**와 **세션**에 전송됩니다. 이러한 파라미터를 추가할 때마다 Adjust가 해당 파라미터를 저장하므로, 다시 추가할 필요가 없습니다. 동일한 파라미터를 다시 추가해도 아무 일도 일어나지 않습니다. - -이러한 세션 파라미터는 설치 중에도 전송될 수 있도록 Adjust SDK가 실행되기 전에 호출될 수 있습니다. 설치 시에 파라미터를 전송해야 하지만, 필요한 값을 실행 이후에만 확보할 수 있는 경우, 이러한 동작이 가능하게 하려면 Adjust SDK의 첫 실행을 지연시키면 됩니다. - -### 세션 콜백 파라미터 - -Adjust SDK의 모든 이벤트 또는 세션에서 전송될 [이벤트](#event-callback-parameters)를 위해 모든 콜백 파라미터를 저장할 수 있습니다. - -세션 콜백 파라미터의 인터페이스는 이벤트 콜백 파라미터와 유사합니다. 이벤트에 키와 값을 추가하는 대신, `Adjust.addSessionCallbackParameter(String key, String value)`메서드로의 호출을 통해 추가하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.addSessionCallbackParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` -
- -세션 콜백 파라미터는 이벤트에 추가한 콜백 파라미터와 병합됩니다. 이벤트에 추가된 콜백 파라미터는 세션 콜백 파라미터를 우선합니다. 즉, 세션에서 추가된 것과 동일한 키로 콜백 파라미터를 이벤트에 추가하면 이벤트에 추가된 콜백 파라미터의 값이 우선시됩니다. - -원하는 키를 `Adjust.removeSessionCallbackParameter(String key)` 메서드에 전달하여 특정 세션 콜백 파라미터를 삭제할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.removeSessionCallbackParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionCallbackParameter('foo'); -``` -
- -세션 콜백 파라미터의 모든 키와 이에 상응하는 값을 삭제하고 싶다면 `Adjust.resetSessionCallbackParameters()` 메서드를 통해 리셋할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.resetSessionCallbackParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionCallbackParameters(); -``` -
- -### 세션 파트너 파라미터 - -[세션 콜백 파라미터](#session-callback-parameters)가 Adjust SDK의 모든 이벤트 및 세션에서 전송되는 것과 마찬가지로, 세션 파트너 파라미터도 있습니다. - -이러한 세션 파트너 파라미터는 Adjust [대시보드]에서 연동이 활성화된 모든 네트워크 파트너에 전송됩니다. - -세션 파트너 파라미터 인터페이스는 이벤트 파트너 파라미터 인터페이스와 유사합니다. 이벤트에 키와 값을 추가하는 대신에, `Adjust.addSessionPartnerParameter(String key, String value)` 메서드를 호출하여 추가할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.addSessionPartnerParameter("foo", "bar"); -``` -
-Web View SDK -
- -```js -Adjust.addSessionPartnerParameter('foo','bar'); -``` -
- -세션 파트너 파라미터는 이벤트에 추가된 파트너 파라미터와 병합됩니다. 이벤트에 추가된 파트너 파라미터는 세션 파트너 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 파트너 파라미터를 이벤트에 추가하면, 이벤트에 추가된 파트너 파라미터의 값이 우선시됩니다. - -원하는 키를 `Adjust.removeSessionPartnerParameter(String key)`에 전달하여 특정 세션 파트너 파라미터를 제거할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.removeSessionPartnerParameter("foo"); -``` -
-Web View SDK -
- -```js -Adjust.removeSessionPartnerParameter('foo'); -``` -
- -세션 파트너 파라미터의 모든 키와 이에 상응하는 값을 삭제하고 싶다면 `Adjust.resetSessionPartnerParameters()` 메서드를 통해 리셋할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.resetSessionPartnerParameters(); -``` -
-Web View SDK -
- -```js -Adjust.resetSessionPartnerParameters(); -``` -
- -### 시작 지연 - -Adjust SDK의 시작을 지연시키면, 앱이 고유 ID와 같이 설치 시 전송될 세션 파라미터를 획득할 시간을 확보할 수 있습니다. - -Config 인스턴스의 `setDelayStart` 메서드로 초기 지연을 초 단위로 설정하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
-Web View SDK -
- -```java -adjustConfig.setDelayStart(5.5); -``` -
- -본 예는 Adjust SDK가 초기 설치 세션과 발생한 모든 이벤트를 전송하는 것을 5.5초 지연시킵니다. 지연 설정한 시간이 만료되면(또는 도중에 `Adjust.sendFirstPackages()`를 호출한 경우), 모든 세션 파라미터는 지연된 설치 세션과 이벤트에 추가되며, Adjust SDK가 다시 원래대로 작업을 재개합니다. - -**Adjust SDK의 최대 시작 지연 시간은 10초입니다.** - - -## 부가 기능 - -Adjust SDK를 프로젝트에 연동하면 다음의 기능을 활용할 수 있습니다. - -### 푸시 토큰(설치 삭제 트래킹) - -푸시 토큰은 Audience Builder 및 클라이언트 콜백에 사용되며 삭제 및 재설치 추적 기능에 필요합니다. - -푸시 알림 토큰을 Adjust에 전송하려면, 토큰을 획득한 이후(또는 값이 변경된 이후) 다음의 콜을 Adjust에 추가하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native SDK -
- -```java -Adjust.setPushToken(pushNotificationsToken, context); -``` - -`context`가 추가된 업데이트된 서명은 SDK가 더 다양한 시나리오에 대응할 수 있도록 하여 푸시 토큰이 전송되도록 보장할 수 있습니다. 따라서 위의 서명 메서드 사용을 권고합니다. - -그러나 Adjust는 `context`가 포함되지 않은 이전의 동일한 서명 메서드도 여전히 지원합니다. - -
-Web View SDK -
- -```js -Adjust.setPushToken(pushNotificationsToken); -``` -
- -### 어트리뷰션 콜백 - -수신기를 등록하여 트래커 어트리뷰션의 변경 사항에 대한 알림을 받을 수 있습니다. 어트리뷰션에 고려하는 소스가 다양하기 때문에 Adjust는 이 정보를 동시에 전송할 수 없습니다. - -자세한 정보는 Adjust의 [어트리뷰션 데이터 정책][attribution-data]을 확인하시기 바랍니다. - -SDK를 시작하기 전에 config 인스턴스와 함께 어트리뷰션 콜백을 추가하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -config.setOnAttributionChangedListener(new OnAttributionChangedListener() { - @Override - public void onAttributionChanged(AdjustAttribution attribution) {} -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function attributionCallback(attribution) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setAttributionCallback(attributionCallback); -Adjust.onCreate(adjustConfig); -``` -
- -수신기 함수는 SDK가 최종 어트리뷰션 데이터를 수신한 이후 호출됩니다. 수신기 함수 내에서 `attribution` 파라미터에 액세스할 수 있습니다. 그 속성에 대한 요약 정보는 다음과 같습니다. - -- `trackerToken`: 현재 어트리뷰션의 트래커 토큰 문자열 -- `trackerName`: 현재 어트리뷰션의 트래커 이름 문자열 -- `network`: 현재 어트리뷰션의 네트워크 그룹화 수준 문자열 -- `campaign`: 현재 어트리뷰션의 캠페인 그룹화 수준 문자열 -- `adgroup`: 현재 어트리뷰션의 광고 그룹 그룹화 수준 문자열 -- `creative`: 현재 어트리뷰션의 크리에이티브 그룹화 수준 문자열 -- `clickLabel`: 현재 어트리뷰션의 클릭 레이블 문자열 -- `adid`: Adjust의 기기 식별자 문자열 -- `costType`: 비용 유형 문자열 -- `costAmount`: 비용 금액 -- `costCurrency`: 비용 통화 문자열 - -**참고**: 비용 데이터인 `costType`와 `costAmount`, `costCurrency`는 `setNeedsCost` 메서드를 호출하여 `AdjustConfig`에서 설정된 경우에만 이용 가능합니다. 설정이 되지 않았거나 또는 설정이 되었으나 어트리뷰션의 일부가 아닌 경우에는 필드의 값이 `null`로 나타납니다. 본 기능은 DK v4.25.0 이상 버전에서만 이용 가능합니다. - -### 구독 트래킹 - -**참고**: 이 기능은 SDK 4.22.0 버전 이상에서만 사용할 수 있습니다. - -Adjust SDK에서 Play Store 구독을 트래킹하고 유효성을 검증할 수 있습니다. 구독이 결제되면 다음을 Adjust SDK로 호출하시기 바랍니다. - -
- - - - - - -
-Native App SDK -
- -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` -
- -구독 트래킹 파라미터: - -- [가격](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpriceamountmicros) -- [통화](https://developer.android.com/reference/com/android/billingclient/api/SkuDetails#getpricecurrencycode) -- [sku](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsku) -- [주문 ID](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getorderid) -- [서명](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getsignature) -- [구매 토큰](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetoken) -- [구매 시간](https://developer.android.com/reference/com/android/billingclient/api/Purchase#getpurchasetime) - -이벤트 추적과 마찬가지로 콜백 및 파트너 파라미터를 구독 객체에 연결할 수 있습니다. - -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -// add callback parameters -subscription.addCallbackParameter("key", "value"); -subscription.addCallbackParameter("foo", "bar"); - -// add partner parameters -subscription.addPartnerParameter("key", "value"); -subscription.addPartnerParameter("foo", "bar"); - -Adjust.trackPlayStoreSubscription(subscription); -``` - -### 광고 매출 트래킹 - -**참고**: 이 기능은 네이티브 SDK v4.18.0 이상에서만 사용할 수 있습니다. - -다음 메서드를 호출하여 Adjust SDK로 광고 매출 정보를 트래킹할 수 있습니다. - -
- - - - - - -
-Native App SDK -
- -```java -Adjust.trackAdRevenue(source, payload); -``` -
- -전달해야 하는 메서드 파라미터는 다음과 같습니다. - -- `source` - 광고 매출 정보의 소스를 나타내는 `String` 객체 -- `payload` - 광고 매출 JSON을 포함하는 `JSONObject` 객체 - -애드저스트는 현재 다음의 `source` 파라미터 값을 지원합니다. - -- `AD_REVENUE_MOPUB` - MoPub 미디에이션 플랫폼을 나타냄(자세한 정보는 [연동 가이드][sdk2sdk-mopub] 확인) - -### 세션 이벤트 콜백 - -이벤트나 세션이 트래킹될 때 수신기에 알림을 보내도록 설정할 수 있습니다. 수신기는 성공적인 이벤트를 트래킹하기 위한 수신기, 실패한 이벤트를 트래킹하기 위한 수신기, 성공한 세션을 트래킹하기 위한 수신기, 실패한 세션을 트래킹하기 위한 수신기로 총 4가지가 있습니다. config 객체를 생성한 이후 다음과 같이 필요한 만큼의 수신기를 추가하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustConfig config = new AdjustConfig(this, appToken, environment); - -// Set event success tracking delegate. -config.setOnEventTrackingSucceededListener(new OnEventTrackingSucceededListener() { - @Override - public void onFinishedEventTrackingSucceeded(AdjustEventSuccess eventSuccessResponseData) { - // ... - } -}); - -// Set event failure tracking delegate. -config.setOnEventTrackingFailedListener(new OnEventTrackingFailedListener() { - @Override - public void onFinishedEventTrackingFailed(AdjustEventFailure eventFailureResponseData) { - // ... - } -}); - -// Set session success tracking delegate. -config.setOnSessionTrackingSucceededListener(new OnSessionTrackingSucceededListener() { - @Override - public void onFinishedSessionTrackingSucceeded(AdjustSessionSuccess sessionSuccessResponseData) { - // ... - } -}); - -// Set session failure tracking delegate. -config.setOnSessionTrackingFailedListener(new OnSessionTrackingFailedListener() { - @Override - public void onFinishedSessionTrackingFailed(AdjustSessionFailure sessionFailureResponseData) { - // ... - } -}); - -Adjust.onCreate(config); -``` -
-Web View SDK -
- -```js -function eventSuccessCallback(eventSuccessResponseData) {} -function eventFailureCallback(eventFailureResponseData) {} -function sessionSuccessCallback(sessionSuccessResponseData) {} -function sessionFailureCallback(sessionFailureResponseData) {} - -// ... - -let adjustConfig = new AdjustConfig(yourAppToken, environment); -adjustConfig.setEventSuccessCallback(eventSuccessCallback); -adjustConfig.setEventFailureCallback(eventFailureCallback); -adjustConfig.setSessionSuccessCallback(sessionSuccessCallback); -adjustConfig.setSessionFailureCallback(sessionFailureCallback); -Adjust.onCreate(adjustConfig); -``` -
- -수신기 함수는 SDK가 서버로 패키지를 전송하려고 시도한 이후 호출됩니다. 수신기 내에서는 해당 수신기에 특화된 응답 데이터 객체에 액세스할 수 있습니다. 성공적인 세션 응답 데이터 객체 필드를 짧게 요약하면 다음과 같습니다. - -- `message`: 서버로부터의 메시지 문자열(또는 SDK에 의해 로그된 오류) -- `timestamp`: 서버로부터의 타임스탬프 문자열 -- `adid`: Adjust가 제공한 고유의 문자열 기기 식별자 -- `jsonResponse`: 서버로부터의 응답을 포함하는 JSON 객체 - -두 이벤트 응답 데이터 개체는 다음을 포함합니다. - -- `eventToken`: 이벤트 토큰 문자열(트래킹된 패키지가 이벤트인 경우) -- `callbackId`: 이벤트 객체에 설정된 맞춤 정의된 [콜백 ID](#cp-event-callback-id) 문자열 - -두 이벤트 및 세션 실패 개체는 다음을 포함합니다. - -- `willRetry`: 이후 해당 패키지의 재전송 시도 여부를 명시하는 부울 방식 - -### 유저 어트리뷰션 - -[어트리뷰션 콜백 세션](#af-attribution-callback)에서 설명된 바와 같이, 본 콜백은 어트리뷰션 정보가 바뀔 때마다 트리거됩니다. 필요할 때마다`Adjust` 인스턴스의 다음 메서드를 호출하여 유저의 현재 어트리뷰션 정보에 액세스할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustAttribution attribution = Adjust.getAttribution(); -``` -
-Web View SDK -
- -```js -let attribution = Adjust.getAttribution(); -``` -
- -**참고**: 본 호출은 Adjust SDK v4.11.0 이상 버전에서만 이용할 수 있습니다. - -**참고**: 현재 어트리뷰션 정보는 Adjust 백엔드에서 앱 설치를 트래킹하고, 어트리뷰션 콜백을 실행한 이후에만 이용 가능합니다. SDK가 초기화되고 어트리뷰션 콜백이 실행되기 전에는 유저의 어트리뷰션 값에 액세스할 수 **없습니다.** - -### 기기 ID - -Adjust SDK를 통해 기기 식별자를 획득할 수 있습니다. - -### Google Play Services 광고 ID - -특정 서비스(예: Google Analytics)는 중복 보고를 방지하기 위해 광고 및 클라이언트 ID 통합을 요청합니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -Google Advertising ID가 필요한 경우에는 제약이 있습니다. 이는 백그라운드 스레드에서만 읽을 수 있습니다. context를 포함한 `getGoogleAdId` 함수와 `OnDeviceIdsRead` 인스턴스를 호출하면, 어떤 상황에서든 작동할 것입니다. - -```java -Adjust.getGoogleAdId(this, new OnDeviceIdsRead() { - @Override - public void onGoogleAdIdRead(String googleAdId) {} -}); -``` -
-Web View SDK -
- -해당 기기의 Google Advertising 기기 식별자 정보를 얻으려면, `Adjust.getGoogleAdId`로 콜백 함수를 전송하여, 다음과 같이 인수에서 Google Advertising ID를 받도록 할 수 있습니다. - -```js -Adjust.getGoogleAdId(function(googleAdId) { - // ... -}); -``` -
- -### Amazon 광고 ID - -Amazon 광고 ID가 필요한 경우, 다음의 메서드를 `Adjust`에서 호출합니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -String amazonAdId = Adjust.getAmazonAdId(context); -``` -
-Web View SDK -
- -```js -let amazonAdId = Adjust.getAmazonAdId(); -``` -
- -### Adjust 기기 식별자 - -앱이 설치된 각 기기에 대해 Adjust의 백엔드는 고유한 **Adjust 기기 식별자(adid)** 를 생성합니다. 이 식별자를 획득하려면 다음의 메서드를 `Adjust` 인스턴스에서 호출하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -String adid = Adjust.getAdid(); -``` -
-Web View SDK -
- -```js -let adid = Adjust.getAdid(); -``` -
- -**참고**: 본 호출은 Adjust SDK v4.11.0 이상 버전에서만 이용할 수 있습니다. - -**참고**: **adid**에 관한 정보는 Adjust의 백엔드가 앱 설치를 트래킹한 이후에만 이용 가능합니다. 따라서 SDK가 초기화되고 앱 설치가 성공적으로 추적되기 전까지는 **adid** 값에 액세스할 수 **없습니다.** - -### 사전 설치된 앱 - -애드저스트 SDK를 사용하여 기기 제조 과정에서 앱이 사전 설치되었던 유저를 파악할 수 있습니다. 시스템 페이로드 또는 기본 트래커를 사용하는 두 가지 방법으로 사전 설치 여부를 확인할 수 있습니다. - -일반적으로 Adjust는 시스템 실 데이터 솔루션을 권고합니다. 그러나 트래커가 필요한 경우도 있습니다. Adjust의 사전설치 파트너와 연동에 관한 자세한 정보는 [Adjust 헬프 센터](https://help.adjust.com/ko/article/pre-install-tracking)에서 확인하시기 바랍니다. 어떠한 솔루션을 사용해야 할지 모르겠다면 integration@adjust.com으로 연락주시기 바랍니다. - -#### 시스템 실 데이터 사용 - -본 솔루션은 SDK **SDK v4.23.0 이상에서만** 지원됩니다. - -Adjust SDK가 사전 설치된 앱을 인식할 수 있도록 하려면, cofig 객체를 생성한 후 `true` 파라미터와 함께 `setPreinstallTrackingEnabled`를 호출하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setPreinstallTrackingEnabled(true); -``` -
- -#### 기본값 트래커 사용 - -- [대시보드]에서 새 트래커를 생성합니다. -- 앱 델리게이트를 열고 config의 기본 트래커를 설정합니다. - -
- - - - - - - - - - - - -
- Native App SDK -
- - ```java - adjustConfig.setDefaultTracker("{TrackerToken}"); - ``` -
- Web View SDK -
- - ```js - adjustConfig.setDefaultTracker('{TrackerToken}'); - ``` -
- -- {TrackerToken}을 1단계에서 생성한 트래커 토큰으로 교체합니다. 대시보드에는 트래커 URL이 표시됩니다(`http://app.adjust.com/` 포함). 소스 코드에서는 전체 URL이 아닌 6~7자의 토큰만 지정해야 합니다. - -- 앱을 빌드하고 실행합니다. LogCat에서 다음과 같은 라인이 나타나야 합니다. - - ``` - Default tracker: 'abc123' - ``` - -### 오프라인 모드 - -Adjust 서버에 대한 전송을 일시적으로 중지(트래킹된 데이터는 이후에 전송되도록 보유)하려면 Adjust SDK를 오프라인 모드로 설정할 수 있습니다. 오프라인 모드에서는 모든 정보가 파일로 저장됩니다. 오프라인 모드에서 너무 많은 이벤트를 트리거하지 않도록 주의해야 합니다. - -오프라인 모드를 활성화하려면 `setOfflineMode`를 호출하고 파라미터를 `true`로 설정합니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.setOfflineMode(true); -``` -
-Web View SDK -
- -```js -Adjust.setOfflineMode(true); -``` -
- -반대로`setOfflineMode`를 `false`와 호출하여 오프라인 모드를 취소할 수 있습니다. Adjust SDK가 다시 온라인 모드가 되면, 저장된 모든 정보가 정확한 시간 정보와 함께 Adjust 서버로 전송됩니다. - -트래킹 비활성화와는 다르게 이 설정은 **세션 간에 유지되지 않습니다.** 즉, 앱이 오프라인 모드에서 종료되었더라도, Adjust SDK는 항상 온라인 모드로 시작됩니다. - - -### 트래킹 비활성화 - -`false` 파라미터와 함께`setEnabled`를 호출하여 Adjust SDK가 현재 기기의 모든 활동을 트래킹하는 것을 비활성화 할 수 있습니다. (주의: 트래킹 중단을 원한때만 사용하시기 바랍니다.) **이 설정은 세션 간에 유지됩니다**. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.setEnabled(false); -``` -
-Web View SDK -
- -```js -Adjust.setEnabled(false); -``` -
- -`isEnabled`함수를 호출하여 Adjust SDK가 현재 활성화되어있는지 확인할 수 있습니다. 활성화된 파라미터를`true`로 설정하여 `setEnabled`를 호출하고 언제든지 Adjust SDK를 활성화할 수 있습니다. - -### 이벤트 버퍼링 - -앱이 이벤트 트래킹을 많이 사용하는 경우, 일부 네트워크 요청을 연기하여 네트워크 요청을 1분에 한 번씩 일괄적으로 보낼 수 있습니다. 이벤트 버퍼링은 cofig 인스턴스에서 활성화할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setEventBufferingEnabled(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setEventBufferingEnabled(true); -``` -
- -### 백그라운드 트래킹 - -Adjust SDK는 기본적으로 앱이 백그라운드에서 작동하는 동안 네트워크 요청 전송을 일시 중지하도록 설정되어 있습니다. 이는 cofig 인스턴스에서 변경할 수 있습니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -adjustConfig.setSendInBackground(true); -``` -
-Web View SDK -
- -```js -adjustConfig.setSendInBackground(true); -``` -
- -### GDPR 잊혀질 권리 - -EU의 개인정보보호법(GDPR) 제 17조에 따라, 사용자는 잊혀질 권리(Right to be Forgotten)를 행사했음을 Adjust에 알릴 수 있습니다. 다음 메서드를 호출하면 Adjust SDK가 잊혀질 권리에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.gdprForgetMe(context); -``` -
-Web View SDK -
- -```js -Adjust.gdprForgetMe(); -``` -
- -이 정보를 수신한 후 Adjust는 해당 사용자의 데이터를 삭제하며 Adjust SDK는 해당 사용자에 대한 추적을 중지합니다. 이 기기로부터의 요청은 향후 Adjust에 전송되지 않습니다. - -이러한 설정은 테스트에서 적용하더라도 영구적으로 유지되며, **취소할 수 없습니다.** - -## 특정 유저에 대한 서드파티 공유 - -유저가 서드파티 파트너와의 데이터 공유를 비활성화, 활성화 및 재활성화할 때 Adjust에 이를 고지할 수 있습니다. - -### 특정 유저에 대한 서드파티 공유 비활성화 - -다음 메서드를 호출하여 Adjust SDK가 데이터 공유 비활성화에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다: - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -이 정보를 수신하면 Adjust는 특정 사용자의 데이터를 파트너와 공유하는 것을 차단하고 Adjust SDK는 계속 정상적으로 작동합니다. - -### 특정 유저에 대한 서드파티 공유 활성화 및 재활성화 - -다음 메서드를 호출하여 Adjust SDK가 데이터 공유에 대한 유저의 선택과 변경 내용을 Adjust 백엔드에 보내도록 하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -Adjust는 정보 수신 후 해당 유저에 대한 파트너와의 데이터 공유 상태를 변경합니다. Adjust SDK는 계속해서 정상적으로 작동합니다. - -Adjust SDK가 Adjust 백엔드로 상세한 옵션을 전송하도록 하려면 다음의 메서드를 호출합니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
-Web View SDK -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(null); -adjustThirdPartySharing.addGranularOption("PartnerA", "foo", "bar"); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` -
- -### 특정 유저에 대한 동의 측정 - -Adjust 대시보드에서 데이터 프라이버시 설정을 활성화 또는 비활성화하려면(동의 만료 기간 및 유저 데이터 보유 기간 포함) 다음의 메서드를 도입해야 합니다. - -다음의 메서드를 호출하여 Adjust SDK가 데이터 프라이버시 설정을 Adjust 백엔드로 보내도록 하시기 바랍니다. - -
- - - - - - - - - - - - -
-Native App SDK -
- -```java -Adjust.trackMeasurementConsent(true); -``` -
-Web View SDK -
- -```js -Adjust.trackMeasurementConsent(true); -``` -
- -Adjust가 이 정보를 수신하면 동의 측정을 활성화 또는 비활성화합니다. Adjust SDK는 계속해서 정상적으로 작동합니다. - -## 테스트 및 문제 해결 - -### "세션 실패(너무 빈번한 세션 거부) " 오류가 발생한 경우 - -본 오류는 일반적으로 설치 테스트 시 발생합니다. 앱의 설치 삭제와 재설치만으로는 새 설치가 트리거되지 않습니다. 서버는 SDK가 로컬에 집계된 세션 데이터를 소실했다고 판단하여, 해당 기기에 대해 서버에서 이용 가능한 정보를 기반으로 오류 메시지를 무시할 것입니다. - -이러한 행동은 테스트 시 번거로울 수 있으나, 샌드박스의 행동이 프로덕션 행동과 최대한 일치하도록 하기 위해 반드시 필요합니다. - -앱에 대해 편집자(또는 그 이상)의 권한이 있는 경우, Adjust 대시보드에서 Adjust의 [테스트용 콘솔][testing_console] 기능을 사용하여 직접 모든 기기에 대한 앱의 세션 데이터를 삭제할 수 있습니다. - -기기의 정보가 올바르게 삭제되면 테스트용 콘솔은 `Forgot device` 값을 반환합니다. 기기가 이미 삭제된 경우(또는 값이 정확하지 않은 경우) 링크는 `Advertising ID not found` 값을 반환합니다. - -기기의 삭제는 GDPR 잊혀질 권리의 호출을 뒤바꾸지 않습니다. - -현재 패키지에서 액세스가 있는 경우, Adjust의 [개발자 API][dev_api]를 사용해 기기를 조사하고 삭제할 수 있습니다. - -### 브로드캐스트 리시버가 설치 리퍼러를 포착하는지 확인하고 싶은 경우 - -[가이드](#qs-gps-intent)를 그대로 수행했다면, 브로드캐스트 리시버가 Adjust의 SDK와 서버에 설치 리퍼러를 전송하도록 설정되었을 것입니다. - -테스트용 설치 리퍼러를 수동으로 실행하여 이를 테스트해볼 수 있습니다. `com.your.appid`를 앱 ID로 교체하고, Android Studio의 [adb](http://developer.android.com/tools/help/adb.html) 툴을 사용하여 다음의 명령어를 실행하시기 바랍니다. - -``` -adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver --es "referrer" "adjust_reftag%3Dabc1234%26tracking_id%3D123456789%26utm_source%3Dnetwork%26utm_medium%3Dbanner%26utm_campaign%3Dcampaign" -``` - -`INSTALL_REFERRER` 인텐트에 대해 이미 다른 브로드캐스트 리시버를 사용하고 본 [리퍼러 가이드]를 수행한 경우, `com.adjust.sdk.AdjustReferrerReceiver`를 브로드캐스트 리시버로 교체하시기 바랍니다. - -`-n com.your.appid/com.adjust.sdk.AdjustReferrerReceiver` 파라미터를 삭제하여 기기의 모든 앱이 `INSTALL_REFERRER` 인텐트를 수신하도록 설정할 수 있습니다. - -로그 레벨을 `verbose`로 설정했다면 리퍼러를 읽을 때 로그를 다음과 같이 볼 수 있습니다. - -``` -V/Adjust: Referrer to parse (adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign) from reftag -``` - -그리고 SDK 패키지 핸들러에 추가된 클릭 패키지를 볼 수 있습니다. - -``` -V/Adjust: Path: /sdk_click - ClientSdk: android4.6.0 - Parameters: - app_token abc123abc123 - click_time yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - created_at yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z - environment sandbox - gps_adid 12345678-0abc-de12-3456-7890abcdef12 - needs_attribution_data 1 - referrer adjust_reftag=abc1234&tracking_id=123456789&utm_source=network&utm_medium=banner&utm_campaign=campaign - reftag abc1234 - source reftag - tracking_enabled 1 -``` - -앱을 실행하기 전에 이 테스트를 수행했다면, 패키지가 전송되지 않을 것입니다. 패키지는 앱이 실행된 경우에만 전송됩니다. - -**중요** 본 기능을 테스트하기 위해 `adb` 툴을 사용하는 것은 권고되지 **않습니다.** 전체 리퍼러 콘텐츠(`&`로 구분된 여러 파라미터가 있는 경우)를 `adb` 툴로 테스트하려면 브로드캐스트 리시버에 도달하도록 이를 인코딩해야 합니다. 인코딩을 하지 않으면 `adb`는 첫 `&` 이후의 리퍼러를 삭제하여, 브로드캐스트 리시버에 잘못된 콘텐츠가 전송됩니다. - -앱이 인코딩되지 않은 리퍼러 값을 어떻게 수신하는지 확인하려면, Adjust의 예시 앱을 사용하여 전송되는 값을 변경함으로써 `MainActivity.java` 파일 내에 `onFireIntentClick` 메서드 안에 있는 인텐트를 전송하도록 할 수 있습니다. - -```java -public void onFireIntentClick(View v) { - Intent intent = new Intent("com.android.vending.INSTALL_REFERRER"); - intent.setPackage("com.adjust.examples"); - intent.putExtra("referrer", "utm_source=test&utm_medium=test&utm_term=test&utm_content=test&utm_campaign=test"); - sendBroadcast(intent); -} -``` - -`putExtra` 메서드의 두 번째 파라미터는 원하는 콘텐츠로 변경할 수 있습니다. - -### 앱 실행 시 이벤트 트리거 가능 여부 - -앱 실행 시 이벤트를 트리거하면 예상과는 다른 결과가 나올 수 있습니다. 그 이유는 다음과 같습니다. - -글로벌 `Application` 클래스의 `onCreate` 메서드는 앱 실행 시 호출될 뿐만 아니라, 시스템이나 앱 이벤트가 앱에 의해 포착된 경우에도 호출됩니다. - -Adjust SDK는 이 시점에서 초기화에 준비되어있으나 실제로 시작된 것은 아닙니다. 이는 실제 활동(유저가 실제로 앱을 실행함)이 일어난 경우에만 발생합니다. - -앱 실행 시 이벤트를 트리거하는 것은 실제 유저에 의해 앱이 실행되지 않았음에도 Adjust SDk를 시작하여, 앱의 외부 요소에 따라 결정되는 시점에 이벤트를 전송하도록 합니다. - -따라서 앱 실행 시 이벤트를 트리거하는 것은 트래킹된 설치와 세션 숫자의 정확도에 영향을 줍니다. - -설치 이후에 이벤트를 트리거하고 싶다면 [어트리뷰션 콜백](#af-attribution-callback)을 사용하시기 바랍니다. - -앱이 실행될 때 이벤트를 트리거하고 싶다면, 해당 활동에 대해 `onCreate` 메서드를 사용하시기 바랍니다. - -[dashboard]: http://adjust.com/ko -[adjust.com]: http://adjust.com/ko - -[en-readme]: ../../README.md -[zh-readme]: ../chinese/README.md -[ja-readme]: ../japanese/README.md -[ko-readme]: ../korean/README.md - -[example-java]: ../../Adjust/example-app-java -[example-kotlin]: ../../Adjust/example-app-kotlin -[example-keyboard]: ../../Adjust/example-app-keyboard -[example-tv]: ../../Adjust/example-app-tv -[example-webbridge]: ../../Adjust/example-app-webbridge - -[maven]: http://maven.org -[referrer]: doc/english/misc/multiple-receivers.md -[리퍼러 가이드]: https://github.com/adjust/android_sdk/blob/master/doc/english/misc/multiple-receivers.md -[releases]: https://github.com/adjust/android_sdk/releases -[google-ad-id]: https://support.google.com/googleplay/android-developer/answer/6048248?hl=en -[event-tracking]: https://docs.adjust.com/ko/event-tracking -[callbacks-guide]: https://docs.adjust.com/ko/callbacks -[new-referrer-api]: https://developer.android.com/google/play/installreferrer/library.html -[special-partners]: https://docs.adjust.com/ko/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[android-dashboard]: http://developer.android.com/about/dashboards/index.html -[대시보드]: http://developer.android.com/about/dashboards/index.html -[currency-conversion]: https://docs.adjust.com/ko/event-tracking/#tracking-purchases-in-different-currencies -[android-application]: http://developer.android.com/reference/android/app/Application.html -[android-launch-modes]: https://developer.android.com/guide/topics/manifest/activity-element.html -[google-play-services]: http://developer.android.com/google/play-services/setup.html -[reattribution-with-deeplinks]: https://docs.adjust.com/ko/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[android-purchase-verification]: https://github.com/adjust/android_purchase_sdk -[testing_console]: https://docs.adjust.com/en/testing-console/#how-to-clear-your-advertising-id-from-adjust-between-tests -[dev_api]: https://docs.adjust.com/en/adjust-for-developers/ - -[sdk2sdk-mopub]: ../../doc/korean/sdk-to-sdk/mopub.md - -[en-helpcenter]: https://help.adjust.com/en/developer/android-sdk-documentation -[zh-helpcenter]: https://help.adjust.com/zh/developer/android-sdk-documentation -[ja-helpcenter]: https://help.adjust.com/ja/developer/android-sdk-documentation -[ko-helpcenter]: https://help.adjust.com/ko/developer/android-sdk-documentation - -## 라이선스 - -Adjust SDK는 MIT 라이선스에 따라 사용이 허가되었습니다. - -Copyright (c) 2012-2021 Adjust GmbH, http://www.adjust.com - -이로써 본 소프트웨어와 관련 문서 파일(이하 "소프트웨어")의 복사본을 받는 사람에게는 아래 조건에 따라 소프트웨어를 제한 없이 다룰 수 있는 권한이 무료로 부여됩니다.이 권한에는 소프트웨어를 사용, 복사, 수정, 병합, 출판, 배포 및/또는 판매하거나 2차 사용권을 부여할 권리와 소프트웨어를 제공 받은 사람이 소프트웨어를 사용, 복사, 수정, 병합, 출판, 배포 및/또는 판매하거나 2차 사용권을 부여하는 것을 허가할 수 있는 권리가 제한 없이 포함됩니다. - -위 저작권 고지문과 본 권한 고지문은 소프트웨어의 모든 복사본이나 주요 부분에 포함되어야 합니다. - -소프트웨어는 상품성, 특정 용도에 대한 적합성 및 비침해에 대한 보증 등을 비롯한 어떤 종류의 명시적이거나 암묵적인 보증 없이 "있는 그대로" 제공됩니다. 어떤 경우에도 저작자나 저작권 보유자는 소프트웨어와 소프트웨어의 사용 또는 기타 취급에서 비롯되거나 그에 기인하거나 그와 관련하여 발생하는 계약 이행 또는 불법 행위 등에 관한 배상 청구, 피해 또는 기타 채무에 대해 책임지지 않습니다. - diff --git a/doc/korean/misc/fb-pixel.md b/doc/korean/misc/fb-pixel.md deleted file mode 100644 index 144bb1504..000000000 --- a/doc/korean/misc/fb-pixel.md +++ /dev/null @@ -1,115 +0,0 @@ -## Facebook 픽셀 연동 - -[Facebook 픽셀](https://www.facebook.com/business/help/952192354843755)은 Facebook의 웹 전용 애널리틱스 도구입니다. 종전에는 Facebook SDK으로 앱 WebView에서 픽셀 이벤트를 추적할 수 없었으나 [Facebook SDK](https://developers.facebook.com/docs/analytics) v4.34 버전 출시와 더불어 이제 가능해졌으며, [하이브리드 모바일 앱 이벤트](https://developers.facebook.com/docs/app-events/hybrid-app-events)를 사용하여 Facebook 픽셀 이벤트를 Facebook 앱 이벤트로 전환할 수 있습니다. - -또한 Facebook SDK에 연동하지 않고도 Adjust SDK로 Facebook 픽셀을 사용할 수 있습니다. - -## Facebook 연동 - -### 앱 예제 - -[`AdjustExample-FbPixel` 디렉토리][example-fbpixel]에서 Adjust WebView SDK를 사용하지 않고 Facebook 픽셀 이벤트를 추적하는 방법을 설명하는 앱 예제를 찾아볼 수 있습니다. - -### Facebook App ID - -Facebook SDK 연동을 하지 않아도 됩니다. 그러나 Adjust SDK가 Facebook 픽셀을 연동하도록 하기 위해서는 Facebook SDK에서와 동일한 몇 단계의 절차를 밟아야 합니다. - -[Facebook 안드로이드 SDK 지침](https://developers.facebook.com/docs/android/getting-started/#app_id)에 설명한 대로 Facebook App ID를 앱에 추가해야 합니다. 위 지침에 설명한 단계를 그대로 따르면 되며, 이용자의 편의를 위해 아래에 그대로 복사해 놓았습니다. - -- `strings.xml` 파일을 엽니다. 경로 예: `/app/src/main/res/values/strings.xml`. -- 이름이 `facebook_app_id`, 사용하는 Facebook App ID를 값으로 하는 새로운 라인을 추가합니다. -- `AndroidManifest.xml`을 엽니다. -- `uses-permission` 엘리먼트를 선언에 추가합니다. - - ```xml - - ``` - -- `meta-data` 엘리먼트를 `application` 엘리먼트에 추가합니다. - -```xml - - ... - - ... - - ``` - -### Facebook 픽셀 환경설정 - -픽셀 연동에 대한 Facebook 지침을 따르면 됩니다. 자바스크립트 코드는 다음과 같이 보일 것입니다. - -```js - - -... - -``` - -이제 [하이브리드 모바일 앱 이벤트 지침](https://developers.facebook.com/docs/app-events/hybrid-app-events) 내 `Update Your Pixel` 섹션에서 설명한 대로 Facebook 픽셀 코드를 다음과 같이 업데이트합니다. - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**주의**: `'init'`를 먼저 호출하고 바로 그 다음에 `'set'` 메서드를 호출하는 게 **대단히 중요**함을 명심해 주십시오. (위에 나온 것처럼) Facebook에서 제공하여 사용 대상 HTML 웹 페이지에 붙이는 스크립트 라인에는, `'init'` 호출 바로 다음에 페이지 보기 이벤트에 사용하는 `'track'` 메서드가 들어 있습니다. 이 페이지 보기 이벤트를 올바로 추적하려면 그 사이에 반드시 `'set'` 메서드를 호출해야 합니다! - -## Adjust 연동 - -### Facebook SDK 자바스크립트 인터페이스 등록 - -[안드로이드 WebView SDK](web_views.md) 앱 연동 지침을 따르면 됩니다. 등록을 진행하고 Adjust 브릿지 기본값 인스턴스를 얻을 섹션은 아래를 참조하십시오. - -```java -AdjustBridge.registerAndGetInstance(getApplication(), webview); -``` - -리턴 인스턴스를 `adjustBridgeInstance`와 같은 이름으로 저장한 다음 다음 라인을 추가합니다. - -```java -adjustBridgeInstance.registerFacebookSDKJSInterface(); -``` - -### 이벤트 이름 환경설정 - -Adjust 웹 브릿지 SDK는 Facebook 픽셀 이벤트를 Adjust 이벤트로 전환시켜 줍니다. - -따라서 Facebook 픽셀을 특정한 Adjust 이벤트에 배치(매핑, mapping)하거나, Facebook 픽셀 환경설정에서 복사해 와서 붙이는 `fbq('track', 'PageView');` 등의 Facebook 픽셀 이벤트 추적을 Adjust SDK를 사용하여 시작하기 **전에** Adjust 이벤트 토큰의 기본값을 설정해야 합니다. - -Facebook 픽셀 이벤트와 Adjust 이벤트를 매핑하려면 Adjust SDK를 초기화하기 전에 `adjustConfig` 인스턴스에서 `addFbPixelMapping(fbEventNameKey, adjEventTokenValue)` 메서드를 호출합니다. 매핑이 이루어진 예는 아래와 같습니다. - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -위에 보이는 매핑의 예시는 Facebook 이벤트 중 `fbq('track', 'Search', ...);` 및 `fbq('track', 'Purchase', ...);`를 각각 추적하는 경우에 해당함을 유의해 주십시오. 아쉽게도 Adjust는 자바스크립트에서 추적하는 이벤트 이름과 Facebook SDK에 사용하는 이벤트 이름 전체의 매핑 구조에는 접근할 수 없습니다. - -사용자에게 도움을 드리고자 Adjust가 지금까지 찾아 낸 이벤트 이름 정보를 다음과 같이 정리했습니다. - -| 픽셀 이벤트 이름 | 해당하는 Facebook 앱 이벤트 이름 -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - -위 목록은 완전하지 않을 수 있으며, Facebook이 현재 목록에 새 항목을 추가하거나 목록을 업데이트할 가능성도 있습니다. 테스트하는 중에는 다음과 같은 Adjust 경고 로그를 확인하십시오. - -``` -There is not a default event token configured or a mapping found for event named: 'fb_mobile_search'. It won't be tracked as an adjust event -``` - -매핑 환경설정을 하지 않았다면 그냥 Adjust 이벤트 기본값을 사용할 수도 있습니다. Adjust SDK를 초기화하기 전에 `adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);` 메서드를 호출하기만 하면 됩니다. - -[example-fbpixel]: ../../Adjust/example-app-fbpixel diff --git a/doc/korean/misc/multiple-receivers.md b/doc/korean/misc/multiple-receivers.md deleted file mode 100644 index d8091d326..000000000 --- a/doc/korean/misc/multiple-receivers.md +++ /dev/null @@ -1,31 +0,0 @@ -## 다수의 브로드캐스트 리시버(broadcast receiver)를 위한 지원 - -다수의 소스를 사용하여 앱의 `INSTALL_REFERRER` 인텐트에 브로드캐스트 리시버를 등록해야 하는 경우, -자체 `BroadcastReceiver`를 구현하여 원하시는 모든 리시버를 호출할 수 있습니다. 아래에 나열된 것과 유사하게 manifest 파일에 정의된 브로드캐스트 리시버를 보유한 경우, - -```xml - - - - - -``` - -intent content의 Adjust 브로드캐스트 리시버 및 이를 필요로 하는 기타 수신기에 아래와 같이 정보를 전달해 주시기 바랍니다. - -```java -public class InstallReceiver extends BroadcastReceiver { - @Override - public void onReceive(Context context, Intent intent) { - // Adjust receiver - new AdjustReferrerReceiver().onReceive(context, intent); - // Google Analytics receiver - new CampaignTrackingReceiver().onReceive(context, intent); - // And any other receiver which needs the intent. - } -} -``` - diff --git a/doc/korean/misc/pre-install-tracker-tool.md b/doc/korean/misc/pre-install-tracker-tool.md deleted file mode 100644 index 431617b0b..000000000 --- a/doc/korean/misc/pre-install-tracker-tool.md +++ /dev/null @@ -1,155 +0,0 @@ -## Adjust 스토어 & 사전 설치 트래커 툴 - -Adjust의 스토어 & 사전 설치 트래커 툴(`adjust-dtt`)은 APK 파일에 Adjust의 사전 설치 트래커 정보를 넣을 수 있도록 해주는 Ruby 명령어 툴입니다. 이후 Adjust SDK는 이 정보를 읽고, 특정 Adjust 트래커에 개별 사전 설치 앱 유저를 연결할 수 있도록 해줍니다. - -`adjust-dtt` 툴을 실행하려면 Linux / Mac OS X 머신에 3개의 툴이 설치되어 있어야 합니다. - -1. `ruby` – `adjust-dtt` 툴을 실행하기 위해 사용 -2. `apktool` – APK 언패킹 & 리패킹을 위해 사용 -3. `jarsigner` – APK 서명 목적으로 사용 - -Ruby는 Mac OS X에 기본으로 설치되어 있습니다. 사용자의 Linux에 Ruby가 설치되어 있지 않은 경우, Linux 배포 버전별 설치 방법(https://www.ruby-lang.org/en/documentation/installation/) 을 확인하시기 바랍니다. - -apktool 설치 방법은 https://ibotpeaches.github.io/Apktool/install/ 에서 확인하시기 바랍니다. - -머신의 Mac OS X 설정에 대해 `brew` 패키지 매니저(http://brew.sh/) 가 있는 경우, 다음을 실행하여 apktool을 간편하게 설치할 수 있습니다. - -``` -brew install apktool -``` - -또는, Java 개발 키트(JDK)에 포함된 `jarsigner` 툴을 사용할 수 있으며, 해당 키트를 머신에 설치해야 합니다. JDK(예: 1.8 버전)가 Mac OS X에 설치되면 위치는 다음과 같습니다. - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/ -``` - -JDK 설치는 `bin` 폴더를 포함하며, 이는 다음의 경로에서 찾을 수 있습니다. (위와 동일한 설치 경로를 사용한 경우에만 해당) - -``` -/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ -``` - -해당 폴더 안에서 `jarsigner` 툴을 찾을 수 있으며, 이는 `adjust-dtt` 툴을 사용하기 위해 필요합니다. - -`adjust-dtt` 툴은 `apktool`과 `jarsigner` 툴의 경로가 시스템 `PATH` 변수에 추가되었다고 가정할 것입니다. 만약 이 경우에 해당하지 않는다면, `PATH` 변수에 두 툴을 포함하는 폴더를 추가해야 합니다. - -**참고**: 위의 추천 방법(공식 설치 가이드 또는 `brew` 메서드)에 따라 `apktool` 을 추가하면 터미널 어디에서나(`PATH` 변수에 자동으로 경로가 추가됨) `apktool`을 실행할 수 있으나, `apktool`이 `PATH` 변수에 속하지 않는 위치에 추가된 경우에는 `PATH` 변수에 이를 포함하는 폴더를 추가해야 합니다. - -`apktool` (1)과 `jarsigner` (2)의 위치를 다음과 같이 가정해보겠습니다. - -1. /User/dummy/some/random/folder/ -2. /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/ - -`PATH` 변수에 이 두 위치를 추가하려면 `.bash_profile` 파일을 수정해야 합니다. 이는 일반적으로 `$HOME` 디렉토리의 루트에 있습니다. - -``` -$HOME/.bash_profile -``` - -원하는 편집 프로그램에서 이를 연 뒤 다음을 끝에 추가합니다. - -``` -export PATH="/Users/dummy/some/random/folder:/Library/Java/JavaVirtualMachines/jdk 1.8.0_102.jdk/Contents/Home/bin:$PATH" -``` - -`apktool`이 자동으로 `PATH`에 존재(예: `brew`를 통한 설치에 해당)하는 경우에는 `PATH` 변수에 경로를 별도로 추가하지 않아도 됩니다. 대신(위의 예와 같이), 위 라인이 아니라 다음의 라인을 추가합니다. - -``` -export PATH="/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin: $PATH" -``` - -변경 내용을 저장한 뒤 다음의 명령어를 실행하여 즉시 변경을 적용합니다. - -``` -source $HOME/.bash_profile -``` - -**참고**: 본 튜토리얼은 사용자가 배시 쉘(`bash` shell)을 사용한다고 가정합니다. 그 외의 쉘(예: `zsh`)을 사용하는 경우 쉘 설정에 따라 위 단계를 수행하시기 바랍니다. - -이제 모든 설정이 완료되어 `adjust-dtt` 툴을 사용할 수 있습니다. - -사용자가 배포하고자 하는 APK는 서명됩니다. APK의 "비서명" 버전을 생성한 경우에도 Android Studio에서 머신에 존재하는 기본값 디버그 서명 키스토어를 통해 서명이 이뤄질 것입니다. 이 경우 가장 가능성 높은 위치는 다음과 같습니다. - -``` -$HOME/.android/debug.keystore -``` - -서명된 APK를 Android Studio로부터 내보내기 하는 경우라면, 맞춤 서명 키스토어 파일로 APK를 서명합니다. - -기본값 디버그 키스토어 파일이나 맞춤 키스토어 파일에 액세스할 수 있어야 `adjust-dtt` 툴을 사용할 수 있습니다. `apktool`은 APK를 언패킹하기 위해 사용된 이후 APK의 모든 서명을 완전히 삭제하기 때문에, 편집 이후 APK가 리패킹 될 때 서명이 재활성화되지 않기 때문입니다. 바로 이러한 이유로 `jarsigner` 툴을 실행하여 서명 정보를 전송해야만 APK를 재서명하여 Android 기기에서 전달 및 사용될 수 있습니다. - -이제 마지막으로 남은 단계는 Adjust 대시보드에서 사전 설치앱의 기본값 트래커로 사용할 트래커를 생성하고 토큰을 얻는 작업입니다. - -이 모든 정보를 사용하여 `adjust-config.yaml` 구성 파일을 생성하고, 앱을 게시하고자 하는 각 스토어에 대한 설정을 채웁니다. 이는 사전 설치 트래커 설정을 필요로 합니다. - -아래의 예시는 `adjust-config.yaml` 파일이 **store_1**, **store_2**, **store_3**라는 가상의 스토어에 대해 APK를 빌드하고 싶다고 가정하는 경우입니다. - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: - store_1: - default_tracker: abc123 - store_2: - default_tracker: abc456 - store_3: - default_tracker: abc789 -``` - -다음의 파라미터를 설정할 수 있습니다. - -1. `apk_path` = APK 파일 전체 경로 (글로벌 및 스토어별) -2. `keystore_path` = APK 서명을 위해 사용한 키스토어 파일 전체 경로 (글로벌 및 스토어별) -3. `keystore_pass` = 키스토어 서명 암호 (글로벌 및 스토어별) -4. `keystore_alias` = 키스토어 알리아스(alias) (글로벌 및 스토어별) -5. `default_tracker` = 사전 설치된 Adjust 트래커 토큰 (스토어별) - -첫 4개의 파라미터는 해당 파라미터를 정의하지 않는 모든 스토어에 동일 설정을 적용하고자 하는 경우 루트에서 글로벌로 정의될 수 있습니다. 파라미터를 글로벌과 스토어에 대해 정의하면, 특정 스토어 파라미터가 APK 생성에 사용될 것입니다. 예를 들어 구성 파일은 다음과 같은 모습입니다. - -```yaml -apk_path: /Users/uerceg/Desktop/apk/example-release.apk -keystore_path: /Users/uerceg/Desktop/apk/mykeystore.jks -keystore_pass: mykeystorepass -keystore_alias: mykeystorealias -stores: - store_1: - default_tracker: abc123 - keystore_path: /Users/uerceg/Desktop/apk/differentkeystore.jks - keystore_pass: differentkeystorepass - keystore_alias: differentkeystorealias - store_2: - default_tracker: abc456 - store_3: - default_tracker: abc789 -``` - -이 경우 `adjust-dtt` 툴은 `differentkeystore.jks`, `differentkeystorepass`, `differentkeystorealias`를 `store_1`을 위한 APK를 생성할 때 사용합니다. **스토어** 파라미터는 반드시 루트에 있어야 하며, 그 안에서 원하는 모든 스토어를 정의할 수 있습니다. 변경된 APK 파일이 각 스토어에 대해 생성됩니다. - -`adjust-config.yaml` 파일이 적절하게 구성되면, `adjust-dtt` 툴을 다음과 같이 실행해야 합니다. - -``` -adjust-dtt adjust-config.yaml -``` - -**참고**: `adjust-dtt` 툴을 실행할 수 없는 경우, 실행 권한이 있는지 우선 확인하고, 권한이 없는 경우에는 다음을 실행하시기 바랍니다. - -``` -chmod +x adjust-dtt -``` - -이후 `adjust-dtt` 툴을 다시 실행합니다. - -`adjust-dtt` 툴 실행 시, 다음이 발생할 것입니다. - -1. 앱의 APK 파일이 언패킹되고, APK 이름을 가진 폴더가 APK 파일이 위치한 폴더에 생성됩니다. -2. 에셋 폴더를 검색하고, 에셋 폴더 내에 `adjust_config.properties` 파일(기본값 트래커 정보를 포함)을 찾습니다. -3. 해당 에셋 폴더 또는 `adjust_config.properties` 파일이 존재하지 않는다면, 자동 생성되고, `default_tracker` 파라미터로 전송된 트래커는 구성 파일에 쓰입니다. -4. APK가 이미 `adjust_config.properties` 파일을 포함하고 있으나, 기본값 트래커 값이 함께 쓰여있지 않은 경우 `default_tracker` 파라미터 값이 파일에 쓰입니다. 구성 파일이 이미 기본값 트래커 값을 포함한 경우, 기존 값이 명령어에 전달된 값과 비교된 뒤, 서로 값이 다른 경우에는 사용자가 명령어로 전송한 값이 사용됩니다. -5. APK가 리패킹 됩니다. -6. 사용자가 `keystore_path`, `keystore_pass`, `keystore_alias` 파라미터 값으로 전송한 정보를 통해 APK가 서명됩니다. -7. 이제 모든 과정이 끝났습니다. 생성된 APK는 원래의 이름과 동일한 이름에 `_[store_name]` 접미사가 추가된 이름을 갖게 됩니다. 위 예시에서는 `example-release_store_1.apk`, `example- release_store_2.apk`, `example-release_store_3.apk`라는 3개의 APK 파일이 생성될 것입니다. 이는 배포 전에 원하는 이름으로 변경 가능합니다. - -본 툴에 관한 문의 및 지원 요청은 support@adjust.com으로 연락주시기 바랍니다. diff --git a/doc/korean/plugins/criteo.md b/doc/korean/plugins/criteo.md deleted file mode 100644 index db320348e..000000000 --- a/doc/korean/plugins/criteo.md +++ /dev/null @@ -1,191 +0,0 @@ -## Criteo 플러그인 - -Maven을 사용하고 있는 경우, 기존 Adjust SDK dependency 옆에 있는 `build.gradle` 파일에 다음의 OAID plugin dependency을 추가하세요. 다음의 Criteo plugin dependency을 추가하세요. - -```gradle -implementation 'com.adjust.sdk:adjust-android:4.16.0' -implementation 'com.adjust.sdk:adjust-android-criteo:4.16.0' -``` - -Adjust Criteo plugin을 JAR 파일로 추가할 수도 있습니다. Adjust [releases page][releases]에서 다운로드하세요. - -이제 다음 예시와 같이 각기 다른 Criteo 이벤트를 연동할 수 있습니다. - -### View Listing - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{viewListingEventToken}"); -List productIds = Arrays.asList("productId1", "productId2", "productId3"); -AdjustCriteo.injectViewListingIntoEvent(event, productIds); -Adjust.trackEvent(event); -``` - -### View Product - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{viewProductEventToken}"); -AdjustCriteo.injectViewProductIntoEvent(event, "productId1"); -Adjust.trackEvent(event); -``` - -### Cart - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{cartEventToken}"); -CriteoProduct product1 = new CriteoProduct(100, 1, "productId1"); -CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2"); -CriteoProduct product3 = new CriteoProduct(50, 2, "productId3"); - -List products = Arrays.asList(product1, product2, product3); -AdjustCriteo.injectCartIntoEvent(event, products); -Adjust.trackEvent(event); -``` - -### Transaction confirmation - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{transactionConfirmedEventToken}"); -CriteoProduct product1 = new CriteoProduct(100, 1, "productId1"); -CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2"); -CriteoProduct product3 = new CriteoProduct(50, 2, "productId3"); - -List products = Arrays.asList(product1, product2, product3); -AdjustCriteo.injectTransactionConfirmedIntoEvent(event, products, "transactionId", "newCustomerId"); -Adjust.trackEvent(event); -``` - -### User Level - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{userLevelEventToken}"); -AdjustCriteo.injectUserLevelIntoEvent(event, 1); -Adjust.trackEvent(event); -``` - -### User Status - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{userStatusEventToken}"); -AdjustCriteo.injectUserStatusIntoEvent(event, "uiStatusValue"); -Adjust.trackEvent(event); -``` - -### Achievement Unlocked - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{achievementUnlockedEventToken}"); -AdjustCriteo.injectAchievementUnlockedIntoEvent(event, "AchievementUnlocked"); -Adjust.trackEvent(event); -``` - -### 커스텀 이벤트 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("\{customEvent2EventToken\}"); -AdjustCriteo.injectCustomEventIntoEvent(event, "uiDataValue"); -Adjust.trackEvent(event); -``` - -### 커스텀 이벤트 2 - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustEvent event = new AdjustEvent("{customEvent2EventToken}"); -AdjustCriteo.injectCustomEvent2IntoEvent(event, "uiData2Value", 3); -Adjust.trackEvent(event); -``` - -### Hashed Email - -`injectHashedEmailIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 해시 된 이메일을 첨부할 수 있습니다. 해시된 이메일은 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작하면 다시 설정해야합니다. `injectHashedEmailIntoCriteoEvents` 메소드를 'null'로 설정하여 해시 된 이메일을 제거할 수 있습니다. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectHashedEmailIntoCriteoEvents("8455938a1db5c475a87d76edacb6284e"); -``` - -### Search dates - -`injectViewSearchDatesIntoCriteoEvent` 메소드를 사용하여 모든 Criteo 이벤트에 체크인 및 체크 아웃 날짜를 첨부 할 수 있습니다. 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 날짜가 전송되므로 앱을 다시 시작하면 다시 설정해야합니다. - -`injectViewSearchDatesIntoCriteoEvents` 날짜를 'null'로 설정하여 검색 날짜를 제거할 수 있습니다. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectViewSearchDatesIntoCriteoEvents("2015-01-01", "2015-01-07"); -``` - -### Partner ID - -`injectPartnerIdIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 파트너 ID를 첨부할 수 있습니다. 파트너 ID는 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작하면 다시 설정해야합니다. `injectPartnerIdIntoCriteoEvents` 메소드를 'null'로 설정하여 파트너 ID를 제거 할 수 있습니다. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectPartnerIdIntoCriteoEvents("{CriteoPartnerId}"); -``` - -### 딥 링크 보내기 - -딥 링크를 허용하는 각 활동에 대해 onCreate 메소드를 찾고 다음 호출을 추가하십시오. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - Intent intent = getIntent(); - Uri data = intent.getData(); - - AdjustEvent event = new AdjustEvent("{deeplinkEventToken}"); - AdjustCriteo.injectDeeplinkIntoEvent(event, data); - Adjust.trackEvent(event); -} -``` - -### 고객 ID - -`injectCustomerIdIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 고객 ID를 첨부 할 수 있습니다. 고객 ID는 애플리케이션 수명주기 동안 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작할 때 다시 설정해야합니다. - -`injectCustomerIdIntoCriteoEvents` 값을 'null'로 설정하여 고객 ID를 제거 할 수 있습니다. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectCustomerIdIntoCriteoEvents("{CriteoCustomerId}"); -``` - -### 사용자 분할 - -`injectUserSegmentIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 사용자 분할을 첨부 할 수 있습니다. 고객 ID는 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작할 때 다시 설정해야합니다. - -`injectUserSegmentIntoCriteoEvents` 값을 'null'로 설정하여 사용자 분할을 제거 할 수 있습니다. - -```java -import com.adjust.sdk.plugin.AdjustCriteo; - -AdjustCriteo.injectUserSegmentIntoCriteoEvents("{CriteoUserSegment}"); -``` - - -[releases]: https://github.com/adjust/android_sdk/releases diff --git a/doc/korean/plugins/oaid.md b/doc/korean/plugins/oaid.md deleted file mode 100644 index 34f8d5a0e..000000000 --- a/doc/korean/plugins/oaid.md +++ /dev/null @@ -1,61 +0,0 @@ -## OAID 플러그인 - -OAID는 중국에서 제조된 모든 기기에서 반드시 제공해야 한다고 MSA(Mobile Security Alliance)가 발표한 광고 ID입니다. Google Play Services를 사용할 수 없는 국가에서 이 ID를 사용하여 Android 기기를 어트리뷰션하거나 트래킹할 수 있습니다. - -OAID 플로그인을 사용하면 Adjust Android SDK를 가지고 기기의 OAID 값을 읽을 *뿐만 아니라* 검색하는 다른 기기 ID도 읽을 수 있게 기본 설정이 되어 있습니다. OAID는 MSA SDK를 사용하는 모든 기기나 HMS(Huawei Mobile Service)를 사용하는 모든 화웨이 기기 상에서 읽을 수 있습니다. - -시작하려면 먼저 공식 [Android SDK README][readme]의 내용을 읽고 Adjust SDK를 앱에 연동 해야 합니다. - -Adjust SDK가 OAID를 수집하고 트래킹할 수 있게 하기 위해서는 다음 단계를 따르세요. 플러그인만 사용하여 화웨이 기기의 OAID를 읽으려면 앱에 MSA SDK를 추가하기 단계를 건너뛸 수 있습니다. - - -### 앱에 OAID 플러그인 추가 - -Maven을 사용하고 있는 경우, 기존 Adjust SDK dependency 옆에 있는 `build.gradle` 파일에 다음의 OAID plugin dependency을 추가하세요. - -``` -implementation 'com.adjust.sdk:adjust-android:4.31.0' -implementation 'com.adjust.sdk:adjust-android-oaid:4.31.0' -``` - -Adjust OAID 플러그인을 JAR 파일로 추가할 수도 있습니다. Adjust [릴리스 페이지][releases]에서 다운로드하세요. - - -### 앱에 MSA SDK 추가하기 - -참고: 화웨이 기기에서 OAID를 읽기위해 MSA SDK를 추가할 필요는 없습니다. 이를 위해 OAID 플러그인은 Huawei Mobile Service (버전 2.6.2 이상)를 사용할 수 있습니다. - -OAID 플러그인이 MSA SDK를 사용하여 OAID 값을 읽을 수 있게 하려면 MSA SDK (AAR 파일)를 프로젝트의 libs 디렉토리에 복사하고 dependency를 설정하십시오. 또한 supplierconfig.json을 프로젝트의 assets 디렉토리에 복사해야합니다. - -MSA SDK 및 자세한 사항은 [여기](msa-sdk)에서 확인하시면 됩니다. - - -### Proguard 설정 - -Proguard를 사용 중이고 Google Play 스토어에 앱을 게시하지 않을 계획이라면 Google Play 서비스와 관련된 모든 규칙을 제거하고 [SDK README][readme proguard]에서 install referrer 라이브러리를 설치할 수 있습니다. - -아래와 같이 모든 `com.adjust.sdk` 패키지 규칙을 적용 하세요. - -``` --keep public class com.adjust.sdk.** { *; } -``` - -### 플러그인 사용 - -OAID 값을 읽으려면 SDK를 시작하기 전에 `AdjustOaid.readOaid()`를 호출하세요. - -```java -AdjustOaid.readOaid(); - -// ... - -Adjust.onCreate(config); -``` - -SDK가 OAID 값을 그만 읽게 하려면 AdjustOaid.doNotReadOaid()`를 호출하세요. - - -[readme]: ../../korean/README.md -[releases]: https://github.com/adjust/android_sdk/releases -[readme proguard]: ../../korean/README.md#qs-proguard -[msasdk]: http://www.msa-alliance.cn/col.jsp?id=120 diff --git a/doc/korean/sdk-to-sdk/admob.md b/doc/korean/sdk-to-sdk/admob.md deleted file mode 100644 index 5f699b0bd..000000000 --- a/doc/korean/sdk-to-sdk/admob.md +++ /dev/null @@ -1,29 +0,0 @@ -# Adjust SDK에서 AdMob 광고 매출 트래킹 - -[Adjust Android SDK README][android-readme] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.28.0** - -Admob SDK의 광고 매출을 트래킹하고 싶다면, Adjust의 SDK 연동을 사용하여 Adjust 백엔드로 광고 매출 정보를 전송할 수 있습니다. 이를 위해서는 기록하고자 하는 정보를 포함한 Adjust 광고 매출 객체를 구성한 뒤, `trackAdRevenue` 메서드를 사용하여 객체를 전송해야 합니다. - -> 참고: AdMob과의 광고 매출 트래킹에 관한 문의 사항은 담당 어카운트 매니저나 [support@adjust.com](mailto:support@adjust.com)으로 연락주시기 바랍니다. - -### 예시 - -```java -rewardedAd = new RewardedAd(this, AD_UNIT_ID); -// set paid event listener -rewardedAd.setOnPaidEventListener(new OnPaidEventListener() { - @Override - public void onPaidEvent(AdValue adValue) { - // ... - // send ad revenue info to Adjust - AdjustAdRevenue adRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_ADMOB); - adRevenue.setRevenue(adValue.getValueMicros() / 1000000, adValue.getCurrencyCode()); - Adjust.trackAdRevenue(adRevenue); - } -} -``` -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/korean/README.md diff --git a/doc/korean/sdk-to-sdk/applovin-max.md b/doc/korean/sdk-to-sdk/applovin-max.md deleted file mode 100644 index aa92867ed..000000000 --- a/doc/korean/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,30 +0,0 @@ -# Adjust SDK에서 AppLovin MAX 광고 매출 트래킹 - -[Adjust Android SDK README][android-readme] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.28.0** - -AppLovin MAX SDK와 광고 매출을 트래킹하고 싶다면, Adjust의 SDK간 연동을 사용하여 Adjust 백엔드로 해당 정보를 전송할 수 있습니다. 이를 실행하려면 `trackAdRevenue` 메서드를 `AD_REVENUE_APPLOVIN_MAX` 소스와 함께 호출하시기 바랍니다. - -> 참고: AppLovin MAX와의 광고 매출 트래킹에 관한 문의 사항은 담당 어카운트 매니저나 [support@adjust.com](mailto:support@adjust.com)으로 연락주시기 바랍니다. - -### 예시 - -```java -@Override -public void onAdRevenuePaid(final MaxAd ad) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue( AdjustConfig.AD_REVENUE_APPLOVIN_MAX); - adjustAdRevenue.setRevenue(ad.getRevenue(), "USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.getNetworkName()); - adjustAdRevenue.setAdRevenueUnit(ad.getAdUnitId()); - adjustAdRevenue.setAdRevenuePlacement(ad.getPlacement()); - - Adjust.trackAdRevenue(adjustAdRevenue); -} - -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/korean/README.md - diff --git a/doc/korean/sdk-to-sdk/ironsource.md b/doc/korean/sdk-to-sdk/ironsource.md deleted file mode 100644 index 726f0ad64..000000000 --- a/doc/korean/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# Adjust SDK에서 ironSource 광고 매출 트래킹 - -[Adjust Android SDK README][android-readme] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.28.0** - -ironSource SDK의 광고 매출을 트래킹하고 싶다면, Adjust의 SDK 연동을 사용하여 Adjust 백엔드로 광고 매출 정보를 전송할 수 있습니다. 이를 실행하려면 `trackAdRevenue` 메서드를 `AD_REVENUE_IRONSOURCE` 소스와 함께 호출하시기 바랍니다. - -> 참고: ironSource와의 광고 매출 트래킹에 관한 문의 사항은 담당 어카운트 매니저나 [support@adjust.com](mailto:support@adjust.com)으로 연락주시기 바랍니다. - -### 예시 - -```java -public void onImpressionSuccess (ImpressionData impressionData) { - AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue(AdjustConfig.AD_REVENUE_IRONSOURCE); - adjustAdRevenue.setRevenue(impressionData.getRevenue(), "USD"); - // optional fields - adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdNetwork()); - adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnit()); - adjustAdRevenue.setAdRevenuePlacement(impressionData.getPlacement()); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[android-readme]: https://github.com/adjust/android_sdk/blob/master/doc/korean/README.md diff --git a/doc/korean/sdk-to-sdk/mopub.md b/doc/korean/sdk-to-sdk/mopub.md deleted file mode 100644 index 6df8aa88c..000000000 --- a/doc/korean/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,24 +0,0 @@ -## Adjust SDK를 이용한 MoPub 광고 매출 트래킹 - -[Adjust Android SDK README][android-readme] - -[MoPub Android 문서][mopub-docs] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -MoPub SDK `onImpression` 콜백 메서드 구현 중에 다음과 같이 `trackAdRevenue` Adjust SDK 메서드를 호출하세요. - -```java -public void onImpression(@NonNull final String adUnitId, @Nullable final ImpressionData impressionData) { - // Pass impression data JSON to Adjust SDK. - Adjust.trackAdRevenue(AdjustConfig.AD_REVENUE_MOPUB, impressionData.getJsonRepresentation()); -} -``` - -MoPub을 이용한 광고 매출 트래킹에 관해 질문이 있는 경우 담당 계정 관리자에게 문의하거나 support@adjust.com에 이메일을 보내 주시기 바랍니다. - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[android-readme]: ../../korean/README.md