| 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(source, payload); ``` |
| 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); ``` |
| 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 Adjust.disableThirdPartySharing(context); ``` |
| Web View SDK |
| ```js Adjust.disableThirdPartySharing(); ``` |