-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); -``` - | -
-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 -``` - | -
-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); -``` - | -
-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**. - | -
-Native App SDK - | -
- -```java -AdjustEvent adjustEvent = new AdjustEvent("abc123"); -Adjust.trackEvent(adjustEvent); -``` - | -
-Web View SDK - | -
- -```js -let adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` - | -
-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); -``` - | -
-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); -``` - | -
-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); -``` - | -
-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); -``` - | -
-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); -``` - | -
-Native App SDK - | -
- -```java -Adjust.addSessionCallbackParameter("foo", "bar"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` - | -
-Native App SDK - | -
- -```java -Adjust.removeSessionCallbackParameter("foo"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.removeSessionCallbackParameter('foo'); -``` - | -
-Native App SDK - | -
- -```java -Adjust.resetSessionCallbackParameters(); -``` - | -
-Web View SDK - | -
- -```js -Adjust.resetSessionCallbackParameters(); -``` - | -
-Native App SDK - | -
- -```java -Adjust.addSessionPartnerParameter("foo", "bar"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.addSessionPartnerParameter('foo', 'bar'); -``` - | -
-Native App SDK - | -
- -```java -Adjust.removeSessionPartnerParameter("foo"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.removeSessionPartnerParameter('foo'); -``` - | -
-Native App SDK - | -
- -```java -Adjust.resetSessionPartnerParameters(); -``` - | -
-Web View SDK - | -
- -```js -Adjust.resetSessionPartnerParameters(); -``` - | -
-Native App SDK - | -
- -```java -adjustConfig.setDelayStart(5.5); -``` - | -
-Web View SDK - | -
- -```java -adjustConfig.setDelayStart(5.5); -``` - | -
-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); -``` - | -
-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); -``` - | -
-Native App SDK - | -
- -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` - | -
-Native App SDK - | -
- -```java -Adjust.trackAdRevenue(adjustAdRevenue); -``` - | -
-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); -``` - | -
-Native App SDK - | -
- -```java -AdjustAttribution attribution = Adjust.getAttribution(); -``` - | -
-Web View SDK - | -
- -```js -let attribution = Adjust.getAttribution(); -``` - | -
-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) { - // ... -}); -``` - | -
-Native App SDK - | -
- -```java -String amazonAdId = Adjust.getAmazonAdId(context); -``` - | -
-Web View SDK - | -
- -```js -let amazonAdId = Adjust.getAmazonAdId(); -``` - | -
-Native App SDK - | -
- -```java -String adid = Adjust.getAdid(); -``` - | -
-Web View SDK - | -
- -```js -let adid = Adjust.getAdid(); -``` - | -
-Native App SDK - | -
- -```java -adjustConfig.setPreinstallTrackingEnabled(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setPreinstallTrackingEnabled(true); -``` - | -
- Method - | -- AndroidManifest.xml change - | -
Content Provider | -Add permission:
-
-```
- |
-
System Installer Receiver | -Declare receiver:
-
-```xml
- |
-
- Native App SDK - | -
- - ```java - adjustConfig.setDefaultTracker("{TrackerToken}"); - ``` - | -
- Web View SDK - | -
- - ```js - adjustConfig.setDefaultTracker('{TrackerToken}'); - ``` - | -
-Native App SDK - | -
- -```java -Adjust.setOfflineMode(true); -``` - | -
-Web View SDK - | -
- -```js -Adjust.setOfflineMode(true); -``` - | -
-Native App SDK - | -
- -```java -Adjust.setEnabled(false); -``` - | -
-Web View SDK - | -
- -```js -Adjust.setEnabled(false); -``` - | -
-Native App SDK - | -
- -```java -adjustConfig.setEventBufferingEnabled(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setEventBufferingEnabled(true); -``` - | -
-Native App SDK - | -
- -```java -adjustConfig.setSendInBackground(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setSendInBackground(true); -``` - | -
-Native App SDK - | -
- -```java -Adjust.gdprForgetMe(context); -``` - | -
-Web View SDK - | -
- -```js -Adjust.gdprForgetMe(); -``` - | -
-Native App SDK - | -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-Web View SDK - | -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-Native App SDK - | -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-Web View SDK - | -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-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); -``` - | -
-Native App SDK - | -
- -```java -Adjust.trackMeasurementConsent(true); -``` - | -
-Web View SDK - | -
- -```js -Adjust.trackMeasurementConsent(true); -``` - | -
-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 -``` - | -
-Native App SDK - | -
- -```java -adjustConfig.setCoppaCompliantEnabled(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setCoppaCompliantEnabled(true); -``` - | -
-Native App SDK - | -
- -```java -adjustConfig.setPlayStoreKidsAppEnabled(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setPlayStoreKidsAppEnabled(true); -``` - | -
-原生应用 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); -``` - | -
-原生应用 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 -``` - | -
-原生应用 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); -``` - | -
-原生应用 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 将始终尝试启动链接**。 - | -
-原生应用 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); -``` - | -
-原生应用 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); -``` - | -
-原生应用 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); -``` - | -
-原生应用 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); -``` - | -
-原生应用 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); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.addSessionCallbackParameter("foo", "bar"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.removeSessionCallbackParameter("foo"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.removeSessionCallbackParameter('foo'); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.resetSessionCallbackParameters(); -``` - | -
-Web View SDK - | -
- -```js -Adjust.resetSessionCallbackParameters(); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.addSessionPartnerParameter("foo", "bar"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.addSessionPartnerParameter('foo', 'bar'); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.removeSessionPartnerParameter("foo"); -``` - | -
-Web View SDK - | -
- -```js -Adjust.removeSessionPartnerParameter('foo'); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.resetSessionPartnerParameters(); -``` - | -
-Web View SDK - | -
- -```js -Adjust.resetSessionPartnerParameters(); -``` - | -
-原生应用 SDK - | -
- -```java -adjustConfig.setDelayStart(5.5); -``` - | -
-Web View SDK - | -
- -```java -adjustConfig.setDelayStart(5.5); -``` - | -
-原生 SDK - | -
- -```java -Adjust.setPushToken(pushNotificationsToken, context); -``` - -更新后的签名加入了 `context`,可允许 SDK 涵盖更多场景,确保推送标签被发送。因此,我们建议您使用以上签名方式。 - -尽管如此,我们仍支持之前没有 `context` 的相同方法签名。 - - | -
-Web View SDK - | -
- -```js -Adjust.setPushToken(pushNotificationsToken); -``` - | -
-原生应用 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 - | -
- -```java -AdjustPlayStoreSubscription subscription = new AdjustPlayStoreSubscription( - price, - currency, - sku, - orderId, - signature, - purchaseToken); -subscription.setPurchaseTime(purchaseTime); - -Adjust.trackPlayStoreSubscription(subscription); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.trackAdRevenue(source, payload); -``` - | -
-原生应用 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 - | -
- -```java -AdjustAttribution attribution = Adjust.getAttribution(); -``` - | -
-Web View SDK - | -
- -```js -let attribution = Adjust.getAttribution(); -``` - | -
-原生应用 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) { - // ... -}); -``` - | -
-原生应用 SDK - | -
- -```java -String amazonAdId = Adjust.getAmazonAdId(context); -``` - | -
-Web View SDK - | -
- -```js -let amazonAdId = Adjust.getAmazonAdId(); -``` - | -
-原生应用 SDK - | -
- -```java -String adid = Adjust.getAdid(); -``` - | -
-Web View SDK - | -
- -```js -let adid = Adjust.getAdid(); -``` - | -
-原生应用 SDK - | -
- -```java -adjustConfig.setPreinstallTrackingEnabled(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setPreinstallTrackingEnabled(true); -``` - | -
- 原生应用 SDK - | -
- - ```java - adjustConfig.setDefaultTracker("{TrackerToken}"); - ``` - | -
- Web View SDK - | -
- - ```js - adjustConfig.setDefaultTracker('{TrackerToken}'); - ``` - | -
-原生应用 SDK - | -
- -```java -Adjust.setOfflineMode(true); -``` - | -
-Web View SDK - | -
- -```js -Adjust.setOfflineMode(true); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.setEnabled(false); -``` - | -
-Web View SDK - | -
- -```js -Adjust.setEnabled(false); -``` - | -
-原生应用 SDK - | -
- -```java -adjustConfig.setEventBufferingEnabled(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setEventBufferingEnabled(true); -``` - | -
-原生应用 SDK - | -
- -```java -adjustConfig.setSendInBackground(true); -``` - | -
-Web View SDK - | -
- -```js -adjustConfig.setSendInBackground(true); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.gdprForgetMe(context); -``` - | -
-Web View SDK - | -
- -```js -Adjust.gdprForgetMe(); -``` - | -
-原生应用 SDK - | -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-Web View SDK - | -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(false); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-原生应用 SDK - | -
- -```java -AdjustThirdPartySharing adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-Web View SDK - | -
- -```js -let adjustThirdPartySharing = new AdjustThirdPartySharing(true); -Adjust.trackThirdPartySharing(adjustThirdPartySharing); -``` - | -
-原生应用 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); -``` - | -
-原生应用 SDK - | -
- -```java -Adjust.trackMeasurementConsent(true); -``` - | -
-Web View SDK - | -
- -```js -Adjust.trackMeasurementConsent(true); -``` - | -
Parameter name | -Requirement | -Description | -Note | -
---|---|---|---|
SCMCategory | -Required* | -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. | -
SCMProductName | -Required* | -Product name | -Special characters should not be encoded but provided in proper UTF-8. Do not use any HTML markup. | -
SCMSalePrice | -Required* | -Sale price as decimal value (e.g. 2.99) | -Please use a dot as a decimal separator and do not use any thousand separators. | -
SCMAmount | -Required* | -Regular price as decimal value (e.g. 3.99) | -Please use a dot as a decimal separator and do not use any thousand separators. | -
SCMCurrency | -Required* | -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:// | -
SCMProductImageURL | -Required* | -Product image URL | -Please 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. | -
SCMBrand | -Required* | -Product brand | -Special characters should not be encoded but provided in proper UTF-8 (Same as SCMProductName above). Do not use any HTML markup. | -
SCMDescription | -Optional | -Short product description | -Special characters should not be encoded but provided in proper UTF-8 (Same as SCMProductName above). Do not use any HTML markup. | -
SCMTimestamp | -Optional | -Timestamp 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). | -
SCMValidityTimestamp | -Optional | -Timestamp 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). | -
SCMQuantity | -Optional | -Number of products in stock | -Please integrate this field only after discussion with your personal Sociomantic contact | -
SCMScore | -Optional | -Priority score of the product (value range is between 0 to 10.0) | -Please integrate this field only after discussion with your personal Sociomantic contact | -