### Adjust Event Tracking Examples Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html This section provides examples of tracking different types of events with the Adjust SDK. It includes tracking a simple event, an event with revenue, an event with custom callback parameters, and an event with partner parameters, all triggered by button clicks. ```JavaScript var btnTrackSimpleEvent = document.getElementById('btnTrackSimpleEvent') btnTrackSimpleEvent.onclick = function(e) { e.preventDefault(); var adjustEvent = new AdjustEvent('g3mfiw'); Adjust.trackEvent(adjustEvent); } var btnTrackRevenueEvent = document.getElementById('btnTrackRevenueEvent') btnTrackRevenueEvent.onclick = function(e) { e.preventDefault() var adjustEvent = new AdjustEvent('a4fd35'); adjustEvent.setRevenue(0.01, 'EUR'); Adjust.trackEvent(adjustEvent); } var btnTrackCallbackEvent = document.getElementById('btnTrackCallbackEvent') btnTrackCallbackEvent.onclick = function(e) { e.preventDefault(); var adjustEvent = new AdjustEvent('34vgg9'); adjustEvent.addCallbackParameter('key', 'value'); adjustEvent.addCallbackParameter('x', 'y'); adjustEvent.addCallbackParameter('key', 'lock'); Adjust.trackEvent(adjustEvent); } var btnTrackPartnerEvent = document.getElementById('btnTrackPartnerEvent') btnTrackPartnerEvent.onclick = function(e) { e.preventDefault() var adjustEvent = new AdjustEvent('w788qs'); adjustEvent.addPartnerParameter('foo', 'bar'); adjustEvent.addPartnerParameter('x', 'y'); adjustEvent.addPartnerParameter('foo', 'foot'); adjustEvent.addPartnerParameter('x', 'z'); Adjust.trackEvent(adjustEvent); } ``` -------------------------------- ### Adjust SDK Information Retrieval Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html This JavaScript snippet illustrates how to retrieve various identifiers and the SDK's enabled status using the Adjust SDK. It includes examples for checking if the SDK is enabled, getting the Google Play Advertising ID, and getting the Amazon Advertising ID, with results displayed via alerts. ```JavaScript var btnIsSdkEnabled = document.getElementById('btnIsSdkEnabled') btnIsSdkEnabled.onclick = function(e) { e.preventDefault(); Adjust.isEnabled(function (isEnabled){ alert('Is SDK enabled? ' + isEnabled); }); } var btnGetGoogleAdId = document.getElementById('btnGetGoogleAdId') btnGetGoogleAdId.onclick = function(e) { e.preventDefault(); Adjust.getGoogleAdId(function (gpsAdid) { alert('Google Play Ad Id:\n' + gpsAdid); }); } var btnGetAmazonId = document.getElementById('btnGetAmazonId') btnGetAmazonId.onclick = function(e) { e.preventDefault(); Adjust.getAmazonAdId(function (amazonAdid) { alert('Amazon Ad Id:\n' + amazonAdid); }, function (message) { alert('Message:\n' + message); }) ``` -------------------------------- ### Control Adjust SDK Offline Mode and Enablement Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-fbpixel/src/main/assets/AdjustExample-FbPixel.html This snippet provides examples of how to programmatically control the Adjust SDK's operational state. It includes functions to enable and disable offline mode, completely enable or disable the SDK, and check its current enabled status. ```javascript window.onload = function() { var btnEnableOfflineMode = document.getElementById('btnEnableOfflineMode') btnEnableOfflineMode.onclick = function(e) { e.preventDefault(); Adjust.switchToOfflineMode(); } var btnDisableOfflineMode = document.getElementById('btnDisableOfflineMode') btnDisableOfflineMode.onclick = function(e) { e.preventDefault(); Adjust.switchBackToOnlineMode(); } var btnEnableSdk = document.getElementById('btnEnableSdk') btnEnableSdk.onclick = function(e) { e.preventDefault() Adjust.enable() } var btnDisableSdk = document.getElementById('btnDisableSdk') btnDisableSdk.onclick = function(e) { e.preventDefault(); Adjust.disable(); } var btnIsSdkEnabled = document.getElementById('btnIsSdkEnabled') btnIsSdkEnabled.onclick = function(e) { e.preventDefault(); alert('Is SDK enabled? ' + Adjust.isEnabled()); } } ``` -------------------------------- ### Adjust Interface: Get SDK Version Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Retrieves the current version string of the Adjust SDK installed in the application. This utility method is available directly from the `Adjust` interface. ```APIDOC Adjust: getSdkVersion() -> String Returns: The current SDK version as a string (e.g., "4.24.1"). ``` -------------------------------- ### Adjust SDK Initialization and Configuration Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html This JavaScript snippet demonstrates how to initialize the Adjust SDK. It creates an `AdjustConfig` object with an app token and environment, sets the log level, and registers various callback functions for attribution, event, session, and deferred deep link handling before initializing the SDK. ```JavaScript var adjustConfig = new AdjustConfig('2fm9gkqubvpc', AdjustConfig.EnvironmentSandbox); adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); adjustConfig.setAttributionCallback(attributionCallback); adjustConfig.setEventSuccessCallback(eventSuccessCallback); adjustConfig.setEventFailureCallback(eventFailureCallback); adjustConfig.setSessionSuccessCallback(sessionSuccessCallback); adjustConfig.setSessionFailureCallback(sessionFailureCallback); adjustConfig.setDeferredDeeplinkCallback(deferredDeeplinkCallback); Adjust.initSdk(adjustConfig); ``` -------------------------------- ### Basic HTML and CSS Styling for Demo App Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html This snippet defines basic HTML structure and CSS rules for styling elements within the Adjust Web View SDK demo application, including font styles, colors, and button layouts. ```CSS html { font-family:Helvetica; color:#222; } h1 { color:steelblue; font-size:24px; margin-top:24px; } button { margin:0 3px 10px; font-size:12px; } .logLine { border-bottom:1px solid #ccc; padding:4px 2px; font-family:courier; font-size:11px; } ``` -------------------------------- ### Enable Preinstall Tracking via Web Bridge (JavaScript) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Allows enabling of preinstall tracking functionality through the web bridge plugin. This method is part of `adjust_config.js` and facilitates configuration from web-based environments. ```JavaScript adjust_config.js.setPreinstallTrackingEnabled(boolean enabled); ``` -------------------------------- ### JavaScript Initialization for Adjust SDK Test Session Source: https://github.com/adjust/android_sdk/blob/master/Adjust/tests/test-app-webbridge/src/main/assets/AdjustTestApp-WebView.html This JavaScript snippet initializes the Adjust SDK test session upon the window loading. It retrieves the current SDK version using `Adjust.getSdkVersion` and then passes this version to `TestLibrary.startTestSession` to begin the testing process. ```JavaScript window.onload = function() { // TestLibrary.addTestDirectory('current/user-agent'); // TestLibrary.addTest('current/deeplink-deferred/Test\_DeferredDeeplink\_callback\_false'); Adjust.getSdkVersion(function(sdkVersion) { TestLibrary.startTestSession(sdkVersion); }); } ``` -------------------------------- ### Initialize Facebook Pixel and Adjust SDK with Mappings Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-fbpixel/src/main/assets/AdjustExample-FbPixel.html This snippet initializes the Facebook Pixel with a given App ID and then configures and initializes the Adjust SDK. It demonstrates how to set up Facebook Pixel event mappings within the Adjust SDK configuration to ensure proper event forwarding and default token handling. ```javascript window.onerror = function(err) { } // Set up Facebook Pixel stuff. let config = {}; config = { fbid: '891530151031248', appid: '308873563017393', domain: null, fbqq: null }; let fbqu = 'https://' + (config.domain || 'connect.facebook.net') + '/en_US/fbevents.js?' + (config.fbqq || ''); !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script',fbqu); // Please make sure to call 'init' method first. config.fbid && fbq('init', config.fbid.toString()); // And right after 'init', make a call to 'set' method BEFORE performing any tracking! config.fbid && fbq('set', 'mobileBridge', config.fbid.toString(), config.appid.toString()); // Initialise Adjust SDK var adjustConfig = new AdjustConfig('2fm9gkqubvpc', AdjustConfig.EnvironmentSandbox); adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose); // Set up Facebook Pixel mappings. adjustConfig.addFbPixelMapping('fb_mobile_search', 'g3mfiw'); adjustConfig.addFbPixelMapping('fb_mobile_purchase', 'a4fd35'); adjustConfig.setFbPixelDefaultEventToken('34vgg9'); // Start Adjust SDK. Adjust.onCreate(adjustConfig); ``` -------------------------------- ### Adjust SDK Mode and State Control Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html This JavaScript snippet demonstrates how to control the Adjust SDK's operational mode and state. It includes functions to switch the SDK to and from offline mode, and to enable or disable the SDK entirely, typically triggered by user interactions. ```JavaScript var btnEnableOfflineMode = document.getElementById('btnEnableOfflineMode') btnEnableOfflineMode.onclick = function(e) { e.preventDefault(); Adjust.switchToOfflineMode(); } var btnDisableOfflineMode = document.getElementById('btnDisableOfflineMode') btnDisableOfflineMode.onclick = function(e) { e.preventDefault(); Adjust.switchBackToOnlineMode(); } var btnEnableSdk = document.getElementById('btnEnableSdk') btnEnableSdk.onclick = function(e) { e.preventDefault() Adjust.enable(); } var btnDisableSdk = document.getElementById('btnDisableSdk') btnDisableSdk.onclick = function(e) { e.preventDefault(); Adjust.disable(); } ``` -------------------------------- ### Retrieve Adjust SDK Information via Button Clicks (JavaScript) Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html This JavaScript snippet attaches event listeners to HTML buttons to interact with the Adjust SDK. It showcases how to retrieve the device's advertising ID (Adjust.getAdid), the SDK's current version (Adjust.getSdkVersion), and comprehensive attribution details (Adjust.getAttribution). The results are displayed using browser alert dialogs, with attribution data being stringified for full display. ```JavaScript var btnGetAdId = document.getElementById('btnGetAdId') btnGetAdId.onclick = function(e) { e.preventDefault(); Adjust.getAdid(function (adid) { alert('Ad Id:\n' + adid); }); } var btnGetSdkVersion = document.getElementById('btnGetSdkVersion') btnGetSdkVersion.onclick = function(e) { e.preventDefault(); Adjust.getSdkVersion(function (sdkVersion) { alert('SDK version:\n' + sdkVersion); }); } var btnGetAttribution = document.getElementById('btnGetAttribution') btnGetAttribution.onclick = function(e) { e.preventDefault(); Adjust.getAttribution(function (attribution) { alert('Tracker token = ' + attribution.trackerToken + '\n' + 'Tracker name = ' + attribution.trackerName + '\n' + 'Network = ' + attribution.network + '\n' + 'Campaign = ' + attribution.campaign + '\n' + 'Adgroup = ' + attribution.adgroup + '\n' + 'Creative = ' + attribution.creative + '\n' + 'Click label = ' + attribution.clickLabel + '\n' + 'Json response = ' + JSON.stringify(attribution.jsonResponse)); }); } ``` -------------------------------- ### Track Facebook Pixel Events via Adjust SDK Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-fbpixel/src/main/assets/AdjustExample-FbPixel.html This snippet demonstrates how to track various Facebook Pixel events ('Search', 'Purchase', and non-mapped events) using the `fbq('track')` method. It illustrates how Adjust SDK automatically handles events with predefined mappings and defaults to a specified token for unmapped events. ```javascript window.onload = function() { var btnTrackSearchEvent = document.getElementById('btnTrackSearchEvent') btnTrackSearchEvent.onclick = function(e) { e.preventDefault(); // Track FB 'Search' event. config.fbid && fbq('track', 'Search', config.fbid.toString()); } var btnTrackPurchaseEvent = document.getElementById('btnTrackPurchaseEvent') btnTrackPurchaseEvent.onclick = function(e) { e.preventDefault() // Track FB 'Purchase' event. config.fbid && fbq('track', 'Purchase', config.fbid.toString()); } var btnTrackNonExistingEventOne = document.getElementById('btnTrackNonExistingEventOne') btnTrackNonExistingEventOne.onclick = function(e) { e.preventDefault(); // Track non existing FB event with no mapping (should default to predefined Adjust event token). config.fbid && fbq('track', 'fb_no_mapping', config.fbid.toString()); } var btnTrackNonExistingEventTwo = document.getElementById('btnTrackNonExistingEventTwo') btnTrackNonExistingEventTwo.onclick = function(e) { e.preventDefault() // Track non existing FB event with no mapping (should default to predefined Adjust event token). config.fbid && fbq('track', 'fb_no_mapping_again', config.fbid.toString()); } } ``` -------------------------------- ### Adjust Instance Methods for Purchase Verification and Payload Detection Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Documents key methods available on the `Adjust` instance, including `verifyPurchase()` for handling purchase verification and `isAdjustUninstallDetectionPayload()` to determine if a payload originates from Adjust. ```APIDOC Adjust: verifyPurchase(): void Description: Initiates the purchase verification process. isAdjustUninstallDetectionPayload(): boolean Description: Checks if a given payload originates from Adjust. Returns: True if the payload is from Adjust, false otherwise. ``` -------------------------------- ### Adjust Deep Link Caching with Context Parameter Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md A new `appWillOpenUrl` method has been added to the `Adjust` class, which now accepts a `Context` object in addition to the `Uri`. This enhancement enables improved deep link caching capabilities. The older `appWillOpenUrl` method, which only took a `Uri`, has been deprecated. ```APIDOC Adjust: appWillOpenUrl(uri: Uri, context: Context): void appWillOpenUrl(uri: Uri): void (Deprecated) ``` -------------------------------- ### Handle Android API Deprecations for PackageInfo and Class Instantiation Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Documents the changes made to adapt to deprecated Android APIs, specifically `PackageInfo.signatures` and `Class.newInstance()`, by switching to their modern alternatives `PackageInfo.signingInfo` and `Class.getDeclaredConstructor().newInstance()` respectively, for compatibility with Android 9+ and Android 14+ devices. ```APIDOC PackageInfo: signatures: Deprecated for Android 9+ signingInfo: New alternative for Android 9+ Class: newInstance(): Deprecated for Android 14+ getDeclaredConstructor().newInstance(): New alternative for Android 14+ ``` -------------------------------- ### Add New URL Strategies to AdjustConfig Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Introduces new URL strategies for the Adjust SDK, including `AdjustConfig.URL_STRATEGY_CN_ONLY` for China-specific domains without fallbacks, and `AdjustConfig.URL_STRATEGY_CN` for general China URL strategy. Also notes the `setUrlStrategy` method for applying these. ```APIDOC AdjustConfig: URL_STRATEGY_CN_ONLY: string Description: Represents AdjustConfig.URL_STRATEGY_CN strategy, but without fallback domains. URL_STRATEGY_CN: string Description: Represents the general China URL strategy. setUrlStrategy(strategy: String): void Description: Sets the URL strategy for the Adjust SDK. Parameters: strategy: The URL strategy to use (e.g., AdjustConfig.URL_STRATEGY_CN). ``` -------------------------------- ### Adjust SDK Callback Handlers Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-webbridge/src/main/assets/AdjustExample-WebView.html These JavaScript functions define various callback handlers for the Adjust SDK, including attribution, event success/failure, session success/failure, and deferred deep link callbacks. They typically display received data using alert messages. ```JavaScript window.onerror = function(err) { } function attributionCallback(attribution) { alert('Tracker token = ' + attribution.trackerToken + '\n' + 'Tracker name = ' + attribution.trackerName + '\n' + 'Network = ' + attribution.network + '\n' + 'Campaign = ' + attribution.campaign + '\n' + 'Adgroup = ' + attribution.adgroup + '\n' + 'Creative = ' + attribution.creative + '\n' + 'Click label = ' + attribution.clickLabel + '\n' + 'Json response = ' + JSON.stringify(attribution.jsonResponse)); } function eventSuccessCallback(eventSuccess) { alert('Message = ' + eventSuccess.message + '\n' + 'Timestamp = ' + eventSuccess.timestamp + '\n' + 'Adid = ' + eventSuccess.adid + '\n' + 'Event token = ' + eventSuccess.eventToken); } function eventFailureCallback(eventFailure) { alert('Message = ' + eventFailure.message + '\n' + 'Timestamp = ' + eventFailure.timestamp + '\n' + 'Adid = ' + eventFailure.adid + '\n' + 'Event token = ' + eventFailure.eventToken + '\n' + 'Will retry = ' + eventFailure.willRetry); } function sessionSuccessCallback(sessionSuccess) { alert('Message = ' + sessionSuccess.message + '\n' + 'Timestamp = ' + sessionSuccess.timestamp + '\n' + 'Adid = ' + sessionSuccess.adid); } function sessionFailureCallback(sessionFailure) { alert('Message = ' + sessionFailure.message + '\n' + 'Timestamp = ' + sessionFailure.timestamp + '\n' + 'Adid = ' + sessionFailure.adid + '\n' + 'Will retry = ' + sessionFailure.willRetry); } function deferredDeeplinkCallback(deferredDeeplink) { alert('Deferred deeplink content:\n' + deferredDeeplink); } ``` -------------------------------- ### Basic CSS Styling for Adjust SDK Test Page Source: https://github.com/adjust/android_sdk/blob/master/Adjust/tests/test-app-webbridge/src/main/assets/AdjustTestApp-WebView.html Defines fundamental CSS styles for HTML elements within the Adjust SDK test page, including font properties, colors, and spacing for general text, headings, buttons, and log lines. ```CSS html { font-family:Helvetica; color:#222; } h1 { color:steelblue; font-size:24px; margin-top:24px; } button { margin:0 3px 10px; font-size:12px; } .logLine { border-bottom:1px solid #ccc; padding:4px 2px; font-family:courier; font-size:11px; } ``` -------------------------------- ### Control Device Info Reading and Final Attribution in AdjustConfig Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Describes new methods in `AdjustConfig` to control how device information is read and whether only final attribution is returned in callbacks. `setReadDeviceInfoOnceEnabled(boolean)` allows reading device info only once, and `setFinalAttributionEnabled(boolean)` enables final attribution only. ```APIDOC AdjustConfig: setReadDeviceInfoOnceEnabled(enabled: boolean): void Description: Indicates if device info should be read only once. Parameters: enabled: If true, device info is read only once. setFinalAttributionEnabled(enabled: boolean): void Description: Indicates if only final attribution is needed in attribution callback. Parameters: enabled: If true, attribution callback returns only final attribution. ``` -------------------------------- ### Track Ad Revenue with Adjust SDK (Android) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Introduces a new method to track ad revenue by passing an `AdjustAdRevnue` object to the `Adjust` interface. This allows for detailed reporting of ad monetization within the application. ```Java Adjust.trackAdRevenue(AdjustAdRevnue adRevenue); ``` -------------------------------- ### Adjust Interface: Track Ad Revenue Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Enables the tracking of ad revenue generated from various sources, including specific ad networks like MoPub. This method is part of the `Adjust` interface and requires a source identifier and a JSON payload. ```APIDOC Adjust: trackAdRevenue(source: String, payload: JSONObject) source: A string identifying the ad revenue source or event. payload: A JSONObject containing detailed ad revenue information. ``` -------------------------------- ### AdjustConfig: Set URL Strategy Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Allows developers to configure a specific URL strategy for the Adjust SDK, which can be useful for targeting different markets or environments. This method is part of the `AdjustConfig` class. ```APIDOC AdjustConfig: setUrlStrategy(urlStrategy: String) urlStrategy: The URL strategy string to be applied (e.g., 'china'). ``` -------------------------------- ### Deprecation of AdjustConfig.setReadMobileEquipmentIdentity Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md The `setReadMobileEquipmentIdentity` method within the `AdjustConfig` object has been marked as deprecated. This indicates that its use is discouraged and it may be removed in future versions of the SDK. ```APIDOC AdjustConfig: setReadMobileEquipmentIdentity(): void (Deprecated) ``` -------------------------------- ### Enable Cost Data in Attribution Callback (Android) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Configures the Adjust SDK to include cost data in the attribution callback. By default, cost data is not included and must be explicitly enabled using this method on the `AdjustConfig` instance. ```Java AdjustConfig.setNeedsCost(boolean needsCost); ``` -------------------------------- ### Retrieve ADID and Current Attribution Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md New methods have been added to the `Adjust` class to allow developers to retrieve the Advertising ID (ADID) and the current attribution value at any time. Previously, this information was primarily available through session or event callbacks. Additionally, the `adid` field is now included in the attribution callback response. ```APIDOC Adjust: getAdid(): String getAttribution(): Attribution AttributionCallbackResponse: adid: String ``` -------------------------------- ### Configure Data Residency Strategy in AdjustConfig (Android) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Sets the data residency region for the Adjust SDK, allowing compliance with regional data protection regulations. This beta feature supports specific regions like US, Turkey, and EU. ```Java AdjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_US); ``` ```Java AdjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_TR); ``` ```Java AdjustConfig.setUrlStrategy(AdjustConfig.DATA_RESIDENCY_EU); ``` -------------------------------- ### Adjust GDPR Forget Me Method Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md A new method, `gdprForgetMe`, has been introduced in the `Adjust` class. This method allows users to request that their data be forgotten by the Adjust SDK, in accordance with GDPR (General Data Protection Regulation) compliance requirements. ```APIDOC Adjust: gdprForgetMe(context: Context): void ``` -------------------------------- ### Enable COPPA Compliance in AdjustConfig (Android) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Enables COPPA (Children's Online Privacy Protection Act) compliance for the application by setting a flag in the Adjust SDK configuration. This ensures that the app adheres to privacy regulations for children's data. ```Java AdjustConfig.setCoppaCompliantEnabled(true); ``` -------------------------------- ### ProGuard Rules for Adjust SDK and Android/Google Play Services APIs Source: https://github.com/adjust/android_sdk/blob/master/Adjust/sdk-core/adjust-proguard-rules.txt These rules specify which classes and their members should be kept intact by ProGuard, preventing them from being obfuscated, optimized, or removed. This is crucial for the Adjust SDK's internal mechanisms, its interaction with Google Play Services (e.g., fetching Advertising ID), and access to specific Android system APIs (e.g., device information, locale settings). The rules ensure that reflection and direct method calls to these components function as expected. ```ProGuard -keep public class com.adjust.sdk.** { *; } -keep class com.adjust.sdk.DeviceInfo** -keepclassmembers class com.adjust.sdk.DeviceInfo** {*;} -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 class dalvik.system.VMRuntime { java.lang.String getRuntime(); } -keep class android.os.Build { java.lang.String[] SUPPORTED_ABIS; java.lang.String CPU_ABI; } -keep class android.content.res.Configuration { android.os.LocaleList getLocales(); java.util.Locale locale; } -keep class android.os.LocaleList { java.util.Locale get(int); } -keep public class com.android.installreferrer.** { *; } ``` -------------------------------- ### Adjust Event Payload Parameters Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Describes additional parameters that can be included with Adjust event payloads, such as `event_callback_id` for custom callbacks and `deduplication_id` for event deduplication. ```APIDOC AdjustEvent: event_callback_id: string (optional) Description: A custom ID to be sent with the event payload for callback purposes. deduplication_id: string Description: An ID used for event deduplication. ``` -------------------------------- ### Mark App as Google Play Kids App in AdjustConfig (Android) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Marks the application as a 'Designed for Families' app in accordance with Google Play policies. This setting is applied via the Adjust SDK configuration to ensure proper handling of user data for child-directed apps. ```Java AdjustConfig.setPlayStoreKidsAppEnabled(true); ``` -------------------------------- ### Retrieve Amazon Advertising Identifier (AAID) Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md The `Adjust` class now includes a `getAmazonAdId()` method. This method provides a way to obtain the value of the Amazon Advertising Identifier (AAID) directly from the SDK. ```APIDOC Adjust: getAmazonAdId(): String ``` -------------------------------- ### AdjustEvent Callback ID and Success/Failure Members Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Introduces a new method `setCallbackId` on the `AdjustEvent` object, allowing developers to attach a custom identifier to an event. This `callbackId` is then reported back in the `AdjustEventSuccess` and `AdjustEventFailure` callbacks, enabling easier correlation of event tracking with their outcomes. ```APIDOC AdjustEvent: setCallbackId(callbackId: String) AdjustEventSuccess: callbackId: String AdjustEventFailure: callbackId: String ``` -------------------------------- ### Adjust Interface: Disable Third-Party Sharing Source: https://github.com/adjust/android_sdk/blob/master/CHANGELOG.md Provides a mechanism to disable the sharing of user data with third parties that are outside of the Adjust ecosystem. This method is exposed through the main `Adjust` interface. ```APIDOC Adjust: disableThirdPartySharing(context: Context) context: The Android application context, used for internal operations. ``` -------------------------------- ### Retrieve Google Play Advertising ID with Adjust SDK Source: https://github.com/adjust/android_sdk/blob/master/Adjust/examples/example-app-fbpixel/src/main/assets/AdjustExample-FbPixel.html This snippet demonstrates how to asynchronously retrieve the Google Play Advertising ID (GPS Ad ID) using the Adjust SDK's `getGoogleAdId` method. The ID is returned via a callback function. ```javascript window.onload = function() { var btnGetGoogleAdId = document.getElementById('btnGetGoogleAdId') btnGetGoogleAdId.onclick = function(e) { e.preventDefault(); Adjust.getGoogleAdId(function (gpsAdid) { alert('Google Play Ad Id:\n' + gpsAdid); }); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.