### Get Attribution Data with Adjust Flutter SDK Source: https://github.com/adjust/flutter_sdk/blob/master/example/README.md Asynchronously retrieves attribution data. Handle the returned attribution object in the .then() callback. ```dart Adjust.getAttribution().then((attribution) { // Handle attribution data }); ``` -------------------------------- ### Initialize Adjust SDK with Callbacks Source: https://context7.com/adjust/flutter_sdk/llms.txt Initializes the Adjust SDK using `AdjustConfig`. This method should be called once before any other SDK operations. It configures logging, enables background sending, and sets up callbacks for attribution, session success/failure, event success/failure, deferred and direct deep links, remote triggers, and SKAdNetwork updates. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_config.dart'; import 'package:adjust_sdk/adjust_attribution.dart'; import 'package:adjust_sdk/adjust_session_success.dart'; import 'package:adjust_sdk/adjust_session_failure.dart'; import 'package:adjust_sdk/adjust_event_success.dart'; import 'package:adjust_sdk/adjust_event_failure.dart'; import 'package:adjust_sdk/adjust_remote_trigger.dart'; void initializeAdjust() { final config = AdjustConfig('YOUR_APP_TOKEN', AdjustEnvironment.production); // Logging config.logLevel = AdjustLogLevel.info; // Flags config.isSendingInBackgroundEnabled = true; config.isCostDataInAttributionEnabled = true; config.isDeferredDeeplinkOpeningEnabled = true; // Attribution callback config.attributionCallback = (AdjustAttribution attribution) { print('Network: ${attribution.network}'); print('Campaign: ${attribution.campaign}'); print('Adgroup: ${attribution.adgroup}'); print('Creative: ${attribution.creative}'); print('TrackerToken: ${attribution.trackerToken}'); print('CostType: ${attribution.costType}'); print('CostAmount: ${attribution.costAmount}'); print('CostCurrency: ${attribution.costCurrency}'); print('FB Install Referrer: ${attribution.fbInstallReferrer}'); // Android print('JSON: ${attribution.jsonResponse}'); }; // Session callbacks config.sessionSuccessCallback = (AdjustSessionSuccess data) { print('Session success: ${data.message} adid=${data.adid}'); }; config.sessionFailureCallback = (AdjustSessionFailure data) { print('Session failure: ${data.message} willRetry=${data.willRetry}'); }; // Event callbacks config.eventSuccessCallback = (AdjustEventSuccess data) { print('Event success: token=${data.eventToken} callbackId=${data.callbackId}'); }; config.eventFailureCallback = (AdjustEventFailure data) { print('Event failure: token=${data.eventToken} willRetry=${data.willRetry}'); }; // Deep link callbacks config.deferredDeeplinkCallback = (String? deeplink) { print('Deferred deeplink: $deeplink'); }; config.directDeeplinkCallback = (String? deeplink) { print('Direct deeplink: $deeplink'); }; // Remote trigger callback config.remoteTriggerCallback = (AdjustRemoteTrigger trigger) { print('Remote trigger label: ${trigger.label}'); print('Remote trigger payload: ${trigger.payloadJson}'); }; // SKAdNetwork update callback (iOS) config.skanUpdatedCallback = (Map data) { print('SKAN conversion_value=${data['conversion_value']}'); print('SKAN coarse_value=${data['coarse_value']}'); print('SKAN lock_window=${data['lock_window']}'); if (data['error'] != null) print('SKAN error=${data['error']}'); }; Adjust.initSdk(config); } ``` -------------------------------- ### Adjust.initSdk Source: https://context7.com/adjust/flutter_sdk/llms.txt Initializes the Adjust SDK with the provided AdjustConfig. This method must be called once before any other SDK method. It also registers all callbacks defined in the config object. ```APIDOC ## Adjust.initSdk — Initialize the SDK Initializes the Adjust SDK with the provided `AdjustConfig`. Must be called once, typically in `initState`, before any other SDK method. All callbacks set on the config object are registered at this point. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_config.dart'; import 'package:adjust_sdk/adjust_attribution.dart'; import 'package:adjust_sdk/adjust_session_success.dart'; import 'package:adjust_sdk/adjust_session_failure.dart'; import 'package:adjust_sdk/adjust_event_success.dart'; import 'package:adjust_sdk/adjust_event_failure.dart'; import 'package:adjust_sdk/adjust_remote_trigger.dart'; void initializeAdjust() { final config = AdjustConfig('YOUR_APP_TOKEN', AdjustEnvironment.production); // Logging config.logLevel = AdjustLogLevel.info; // Flags config.isSendingInBackgroundEnabled = true; config.isCostDataInAttributionEnabled = true; config.isDeferredDeeplinkOpeningEnabled = true; // Attribution callback config.attributionCallback = (AdjustAttribution attribution) { print('Network: ${attribution.network}'); print('Campaign: ${attribution.campaign}'); print('Adgroup: ${attribution.adgroup}'); print('Creative: ${attribution.creative}'); print('TrackerToken: ${attribution.trackerToken}'); print('CostType: ${attribution.costType}'); print('CostAmount: ${attribution.costAmount}'); print('CostCurrency: ${attribution.costCurrency}'); print('FB Install Referrer: ${attribution.fbInstallReferrer}'); // Android print('JSON: ${attribution.jsonResponse}'); }; // Session callbacks config.sessionSuccessCallback = (AdjustSessionSuccess data) { print('Session success: ${data.message} adid=${data.adid}'); }; config.sessionFailureCallback = (AdjustSessionFailure data) { print('Session failure: ${data.message} willRetry=${data.willRetry}'); }; // Event callbacks config.eventSuccessCallback = (AdjustEventSuccess data) { print('Event success: token=${data.eventToken} callbackId=${data.callbackId}'); }; config.eventFailureCallback = (AdjustEventFailure data) { print('Event failure: token=${data.eventToken} willRetry=${data.willRetry}'); }; // Deep link callbacks config.deferredDeeplinkCallback = (String? deeplink) { print('Deferred deeplink: $deeplink'); }; config.directDeeplinkCallback = (String? deeplink) { print('Direct deeplink: $deeplink'); }; // Remote trigger callback config.remoteTriggerCallback = (AdjustRemoteTrigger trigger) { print('Remote trigger label: ${trigger.label}'); print('Remote trigger payload: ${trigger.payloadJson}'); }; // SKAdNetwork update callback (iOS) config.skanUpdatedCallback = (Map data) { print('SKAN conversion_value=${data['conversion_value']}'); print('SKAN coarse_value=${data['coarse_value']}'); print('SKAN lock_window=${data['lock_window']}'); if (data['error'] != null) print('SKAN error=${data['error']}'); }; Adjust.initSdk(config); } ``` ``` -------------------------------- ### AdjustConfig - SDK Configuration Object Source: https://context7.com/adjust/flutter_sdk/llms.txt Holds all SDK configuration options before initialization. Pass an app token and environment; set optional flags, callbacks, URL strategy, and store info. ```APIDOC ## `AdjustConfig` — SDK Configuration Object Holds all SDK configuration options before initialization. Pass an app token and environment; set optional flags, callbacks, URL strategy, and store info. ```dart import 'package:adjust_sdk/adjust_config.dart'; import 'package:adjust_sdk/adjust_store_info.dart'; final config = AdjustConfig('2fm9gkqubvpc', AdjustEnvironment.sandbox); // Logging level: verbose | debug | info | warn | error | suppress config.logLevel = AdjustLogLevel.verbose; // Default tracker for organic installs config.defaultTracker = 'abc123'; // External device ID for server-side mapping config.externalDeviceId = 'user-uuid-1234'; // ATT consent waiting interval in seconds (iOS, max 120) config.attConsentWaitingInterval = 30; // Max size of event deduplication ID list config.eventDeduplicationIdsMaxSize = 20; // Feature flags config.isCoppaComplianceEnabled = false; config.isPlayStoreKidsComplianceEnabled = false; config.isPreinstallTrackingEnabled = true; config.isLinkMeEnabled = true; config.isDeviceIdsReadingOnceEnabled = false; config.isAdServicesEnabled = true; // iOS config.isIdfaReadingEnabled = true; // iOS config.isIdfvReadingEnabled = true; // iOS config.isSkanAttributionEnabled = true; // iOS config.isAppTrackingTransparencyUsageEnabled = true; // iOS config.isAppSetIdReadingEnabled = true; // Android config.isFirstSessionDelayEnabled = false; // Store info (for multi-store Android builds) final storeInfo = AdjustStoreInfo('GooglePlay'); storeInfo.storeAppId = 'com.example.myapp'; config.storeInfo = storeInfo; // URL strategy: route traffic to specific domains // useSubdomains=true means prepend region prefix; isDataResidency=false for CDN config.setUrlStrategy( ['eu.adjust.com', 'eu2.adjust.com'], true, // useSubdomains true, // isDataResidency ); // Facebook App ID for Meta install referrer (Android) config.fbAppId = '123456789'; ``` ``` -------------------------------- ### Configure Adjust SDK with AdjustConfig Source: https://context7.com/adjust/flutter_sdk/llms.txt Initialize AdjustConfig with your app token and environment. Set optional parameters like log level, default tracker, and feature flags. Configure store information and URL strategy for specific regions. ```dart import 'package:adjust_sdk/adjust_config.dart'; import 'package:adjust_sdk/adjust_store_info.dart'; final config = AdjustConfig('2fm9gkqubvpc', AdjustEnvironment.sandbox); // Logging level: verbose | debug | info | warn | error | suppress config.logLevel = AdjustLogLevel.verbose; // Default tracker for organic installs config.defaultTracker = 'abc123'; // External device ID for server-side mapping config.externalDeviceId = 'user-uuid-1234'; // ATT consent waiting interval in seconds (iOS, max 120) config.attConsentWaitingInterval = 30; // Max size of event deduplication ID list config.eventDeduplicationIdsMaxSize = 20; // Feature flags config.isCoppaComplianceEnabled = false; config.isPlayStoreKidsComplianceEnabled = false; config.isPreinstallTrackingEnabled = true; config.isLinkMeEnabled = true; config.isDeviceIdsReadingOnceEnabled = false; config.isAdServicesEnabled = true; // iOS config.isIdfaReadingEnabled = true; // iOS config.isIdfvReadingEnabled = true; // iOS config.isSkanAttributionEnabled = true; // iOS config.isAppTrackingTransparencyUsageEnabled = true; // iOS config.isAppSetIdReadingEnabled = true; // Android config.isFirstSessionDelayEnabled = false; // Store info (for multi-store Android builds) final storeInfo = AdjustStoreInfo('GooglePlay'); storeInfo.storeAppId = 'com.example.myapp'; config.storeInfo = storeInfo; // URL strategy: route traffic to specific domains // useSubdomains=true means prepend region prefix; isDataResidency=false for CDN config.setUrlStrategy( ['eu.adjust.com', 'eu2.adjust.com'], true, // useSubdomains true, // isDataResidency ); // Facebook App ID for Meta install referrer (Android) config.fbAppId = '123456789'; ``` -------------------------------- ### Track a Simple Event with Adjust Flutter SDK Source: https://github.com/adjust/flutter_sdk/blob/master/example/README.md Use this to track basic events. Ensure the Adjust SDK is initialized and configured with your app token. ```dart final event = AdjustEvent('g3mfiw'); Adjust.trackEvent(event); ``` -------------------------------- ### Adjust.trackEvent - Track Custom Events Source: https://context7.com/adjust/flutter_sdk/llms.txt Creates and sends an event to Adjust servers. Supports revenue, callback parameters, partner parameters, deduplication IDs, and purchase tokens for in-app purchase tracking. ```APIDOC ## `Adjust.trackEvent` — Track Custom Events Creates and sends an event to Adjust servers. Supports revenue, callback parameters, partner parameters, deduplication IDs, and purchase tokens for in-app purchase tracking. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_event.dart'; // Simple event final simpleEvent = AdjustEvent('abc123'); Adjust.trackEvent(simpleEvent); // Revenue event final revenueEvent = AdjustEvent('xyz789'); revenueEvent.setRevenue(9.99, 'USD'); revenueEvent.deduplicationId = 'unique-order-id-001'; // prevent double-counting revenueEvent.callbackId = 'my-callback-ref-001'; Adjust.trackEvent(revenueEvent); // Event with callback and partner parameters final richEvent = AdjustEvent('def456'); richEvent.addCallbackParameter('user_id', 'u-9876'); richEvent.addCallbackParameter('item_sku', 'SKU-001'); richEvent.addPartnerParameter('campaign_source', 'email'); richEvent.addPartnerParameter('promo_code', 'SUMMER20'); Adjust.trackEvent(richEvent); // iOS: event with App Store transaction for purchase verification + tracking final iapEvent = AdjustEvent('iap_token'); iapEvent.setRevenue(4.99, 'USD'); iapEvent.productId = 'com.example.premium_monthly'; iapEvent.transactionId = 'ios-transaction-id-abc'; Adjust.trackEvent(iapEvent); // Android: event with Play Store purchase token final playEvent = AdjustEvent('play_token'); playEvent.setRevenue(4.99, 'USD'); playEvent.productId = 'com.example.premium_monthly'; playEvent.purchaseToken = 'android-purchase-token-xyz'; Adjust.trackEvent(playEvent); ``` ``` -------------------------------- ### Global Callback and Partner Parameters Source: https://context7.com/adjust/flutter_sdk/llms.txt Attaches key-value parameters to all event and session requests globally. This is useful for adding persistent metadata like user IDs without needing to set them for each individual event. Parameters can be added, removed, or cleared. ```APIDOC ## Global Callback and Partner Parameters Attaches key-value parameters to every event and session request SDK-wide, without having to set them per-event. Useful for session-level metadata like user IDs. ```dart import 'package:adjust_sdk/adjust.dart'; // Add global parameters (persist across all events/sessions) Adjust.addGlobalCallbackParameter('user_id', 'u-12345'); Adjust.addGlobalCallbackParameter('app_version', '3.1.0'); Adjust.addGlobalPartnerParameter('segment', 'premium_user'); Adjust.addGlobalPartnerParameter('ab_group', 'variant_b'); // Remove specific keys Adjust.removeGlobalCallbackParameter('app_version'); Adjust.removeGlobalPartnerParameter('ab_group'); // Remove all keys of each type Adjust.removeGlobalCallbackParameters(); Adjust.removeGlobalPartnerParameters(); ``` ``` -------------------------------- ### Track Events with Parameters Source: https://context7.com/adjust/flutter_sdk/llms.txt Add custom callback and partner parameters to events. Callback parameters are sent to your tracking URLs, while partner parameters are sent to your partner's postbacks. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_event.dart'; // Event with callback and partner parameters final richEvent = AdjustEvent('def456'); richEvent.addCallbackParameter('user_id', 'u-9876'); richEvent.addCallbackParameter('item_sku', 'SKU-001'); richEvent.addPartnerParameter('campaign_source', 'email'); richEvent.addPartnerParameter('promo_code', 'SUMMER20'); Adjust.trackEvent(richEvent); ``` -------------------------------- ### Adjust.verifyAppStorePurchase / Adjust.verifyAndTrackAppStorePurchase Source: https://context7.com/adjust/flutter_sdk/llms.txt Verifies an App Store in-app purchase server-side, returning a `AdjustPurchaseVerificationResult`. The combined `verifyAndTrack` variant also records the event on successful verification. ```APIDOC ## `Adjust.verifyAppStorePurchase` / `Adjust.verifyAndTrackAppStorePurchase` — iOS Purchase Verification Verifies an App Store in-app purchase server-side, returning a `AdjustPurchaseVerificationResult`. The combined `verifyAndTrack` variant also records the event on successful verification. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_app_store_purchase.dart'; import 'package:adjust_sdk/adjust_event.dart'; import 'package:adjust_sdk/adjust_purchase_verification_result.dart'; // Verify only (does not track an event) final purchase = AdjustAppStorePurchase( 'com.example.premium', // productId 'ios-transaction-xyz', // transactionId ); final AdjustPurchaseVerificationResult? result = await Adjust.verifyAppStorePurchase(purchase); if (result != null) { print('Status: ${result.verificationStatus}'); // 'verified', 'not_verified', etc. print('Code: ${result.code}'); // HTTP-like code print('Msg: ${result.message}'); } // Verify AND track simultaneously final event = AdjustEvent('iap_event_token'); event.setRevenue(9.99, 'USD'); event.productId = 'com.example.premium'; event.transactionId = 'ios-transaction-xyz'; final AdjustPurchaseVerificationResult? trackResult = await Adjust.verifyAndTrackAppStorePurchase(event); print('Track+verify result: ${trackResult?.verificationStatus}'); ``` ``` -------------------------------- ### Adjust.trackThirdPartySharing Source: https://context7.com/adjust/flutter_sdk/llms.txt Controls data sharing with third parties and configures per-partner granular sharing options. Pass `null` to configure granular options without changing the overall sharing state. ```APIDOC ## `Adjust.trackThirdPartySharing` — Third-Party Data Sharing Control Enables or disables data sharing with third parties and configures per-partner granular sharing options. Pass `null` to configure granular options without changing the overall sharing state. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_third_party_sharing.dart'; // Disable all third-party sharing (e.g. user opts out) final optOut = AdjustThirdPartySharing(false); Adjust.trackThirdPartySharing(optOut); // Enable with granular per-partner options final sharing = AdjustThirdPartySharing(true); // Granular options: partnerName, key, value sharing.addGranularOption('PartnerA', 'user_data', 'no'); sharing.addGranularOption('PartnerA', 'device_data', 'yes'); // Partner sharing settings: partnerName, key, bool sharing.addPartnerSharingSetting('facebook', 'install', false); sharing.addPartnerSharingSetting('google_dv360', 'all', true); Adjust.trackThirdPartySharing(sharing); // Notify about user-level measurement consent (Google consent mode) Adjust.trackMeasurementConsent(true); ``` ``` -------------------------------- ### Register Push Token and Handle GDPR Forget Me Request Source: https://context7.com/adjust/flutter_sdk/llms.txt Register a push token for uninstall/reinstall tracking by calling `Adjust.setPushToken(token)` when the token refreshes. To comply with GDPR Article 17, call `Adjust.gdprForgetMe()` to erase all user data and stop future tracking. ```dart import 'package:adjust_sdk/adjust.dart'; // Register FCM/APNs push token whenever it refreshes void onTokenRefresh(String token) { Adjust.setPushToken(token); } // GDPR Article 17: erase all user data and stop future tracking void onUserRequestedDeletion() { Adjust.gdprForgetMe(); // SDK stops tracking; all data associated with the device is deleted server-side } ``` -------------------------------- ### Set Global Callback and Partner Parameters - Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Attaches key-value parameters to all SDK events and sessions. Use to set user IDs or app versions. Parameters can be removed individually or all at once. ```dart import 'package:adjust_sdk/adjust.dart'; // Add global parameters (persist across all events/sessions) Adjust.addGlobalCallbackParameter('user_id', 'u-12345'); Adjust.addGlobalCallbackParameter('app_version', '3.1.0'); Adjust.addGlobalPartnerParameter('segment', 'premium_user'); Adjust.addGlobalPartnerParameter('ab_group', 'variant_b'); // Remove specific keys Adjust.removeGlobalCallbackParameter('app_version'); Adjust.removeGlobalPartnerParameter('ab_group'); // Remove all keys of each type Adjust.removeGlobalCallbackParameters(); Adjust.removeGlobalPartnerParameters(); ``` -------------------------------- ### Handle iOS ATT and SKAdNetwork - Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Request App Tracking Transparency authorization from the user and manually update SKAdNetwork conversion values. Returns status codes for ATT and potential errors for SKAN. ```dart import 'package:adjust_sdk/adjust.dart'; // Prompt the user with the ATT dialog // Returns: 0=notDetermined, 1=restricted, 2=denied, 3=authorized final num attStatus = await Adjust.requestAppTrackingAuthorization(); print('ATT status: $attStatus'); // Manually update SKAN conversion value // coarseValue: 'low' | 'medium' | 'high' final String? error = await Adjust.updateSkanConversionValue( 63, // fine conversion value (0–63) 'high', // coarse conversion value false, // lockWindow ); if (error != null) { print('SKAN update error: $error'); } else { print('SKAN conversion value updated'); } ``` -------------------------------- ### Adjust.processDeeplink / Adjust.processAndResolveDeeplink Source: https://context7.com/adjust/flutter_sdk/llms.txt Handles deep links for attribution. `processAndResolveDeeplink` additionally resolves shortened Adjust links and returns the full URL. ```APIDOC ## `Adjust.processDeeplink` / `Adjust.processAndResolveDeeplink` — Deep Link Handling Passes a deep link URI to the Adjust SDK for attribution processing. `processAndResolveDeeplink` additionally resolves shortened Adjust links and returns the full URL. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_deeplink.dart'; // In app_links / uni_links callback when a deep link is received: void onDeepLinkReceived(Uri uri) async { final deeplink = AdjustDeeplink(uri.toString()); // Optional: organic search referrer (Google Search, etc.) deeplink.referrer = 'https://www.google.com/search?q=myapp'; // Option 1: process without resolution (fire and forget) Adjust.processDeeplink(deeplink); // Option 2: process AND resolve shortened link, get full URL back final resolvedLink = await Adjust.processAndResolveDeeplink(deeplink); if (resolvedLink != null) { print('Resolved deeplink: $resolvedLink'); // Navigate based on resolved URL } } // Retrieve the last deep link processed by the SDK (iOS only) final lastDeeplink = await Adjust.getLastDeeplink(); print('Last deeplink: $lastDeeplink'); ``` ``` -------------------------------- ### SDK State Control Source: https://context7.com/adjust/flutter_sdk/llms.txt Provides methods to control the SDK's operational state, including enabling, disabling, and switching between online and offline modes. This is useful for managing user consent and testing scenarios. ```APIDOC ## SDK State Control Enable, disable, and switch the SDK between online and offline modes at runtime. Useful for user consent flows and testing. ```dart import 'package:adjust_sdk/adjust.dart'; // Check if SDK is currently active final bool enabled = await Adjust.isEnabled(); print('SDK enabled: $enabled'); // Disable (pauses all tracking; data is not lost, queued when re-enabled) Adjust.disable(); // Re-enable Adjust.enable(); // Switch to offline mode (events queued locally, not sent) Adjust.switchToOfflineMode(); // Return to online mode (queued events are flushed) Adjust.switchBackToOnlineMode(); ``` ``` -------------------------------- ### Enable First Session Delay for COPPA/Kids Compliance Source: https://context7.com/adjust/flutter_sdk/llms.txt Enable first-session delay in the Adjust SDK configuration to set compliance flags or external device IDs before the initial session is sent. Use this when you need to collect user consent or configure specific compliance settings. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_config.dart'; // 1. Enable first-session delay in config final config = AdjustConfig('YOUR_APP_TOKEN', AdjustEnvironment.production); config.isFirstSessionDelayEnabled = true; Adjust.initSdk(config); // 2. At the appropriate time (e.g., after consent screen), apply options: Adjust.enableCoppaComplianceInDelay(); // or disableCoppaComplianceInDelay() Adjust.enablePlayStoreKidsComplianceInDelay(); // Android, or disable variant Adjust.setExternalDeviceIdInDelay('user-uuid-abc123'); // 3. Release the delay — first session is sent now Adjust.endFirstSessionDelay(); ``` -------------------------------- ### Control SDK State - Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Enable, disable, or switch the SDK between online and offline modes. Useful for user consent flows and testing. Disabled SDKs queue events for later. ```dart import 'package:adjust_sdk/adjust.dart'; // Check if SDK is currently active final bool enabled = await Adjust.isEnabled(); print('SDK enabled: $enabled'); // Disable (pauses all tracking; data is not lost, queued when re-enabled) Adjust.disable(); // Re-enable Adjust.enable(); // Switch to offline mode (events queued locally, not sent) Adjust.switchToOfflineMode(); // Return to online mode (queued events are flushed) Adjust.switchBackToOnlineMode(); ``` -------------------------------- ### Track Android Play Store Subscription - Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Tracks a Google Play Store subscription purchase. Requires SKU, order ID, signature, and purchase token. Purchase time is in epoch milliseconds. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_play_store_subscription.dart'; final subscription = AdjustPlayStoreSubscription( '999', // price in micros as string 'USD', // currency 'com.example.premium_monthly', // sku 'GPA.1234-5678-9012-34567', // orderId 'purchase_signature_base64', // signature 'android-purchase-token-xyz', // purchaseToken ); subscription.purchaseTime = '1693564800000'; // epoch ms subscription.addCallbackParameter('plan', 'monthly'); subscription.addPartnerParameter('channel', 'organic'); Adjust.trackPlayStoreSubscription(subscription); ``` -------------------------------- ### Process and Resolve Deep Links with Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Passes a deep link URI to the Adjust SDK for attribution processing. `processAndResolveDeeplink` additionally resolves shortened Adjust links and returns the full URL. Use this in your app's deep link callback. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_deeplink.dart'; // In app_links / uni_links callback when a deep link is received: void onDeepLinkReceived(Uri uri) async { final deeplink = AdjustDeeplink(uri.toString()); // Optional: organic search referrer (Google Search, etc.) deeplink.referrer = 'https://www.google.com/search?q=myapp'; // Option 1: process without resolution (fire and forget) Adjust.processDeeplink(deeplink); // Option 2: process AND resolve shortened link, get full URL back final resolvedLink = await Adjust.processAndResolveDeeplink(deeplink); if (resolvedLink != null) { print('Resolved deeplink: $resolvedLink'); // Navigate based on resolved URL } } // Retrieve the last deep link processed by the SDK (iOS only) final lastDeeplink = await Adjust.getLastDeeplink(); print('Last deeplink: $lastDeeplink'); ``` -------------------------------- ### Verify iOS App Store Purchases with Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Verifies an App Store in-app purchase server-side, returning a `AdjustPurchaseVerificationResult`. The combined `verifyAndTrack` variant also records the event on successful verification. Use this for iOS in-app purchase validation. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_app_store_purchase.dart'; import 'package:adjust_sdk/adjust_event.dart'; import 'package:adjust_sdk/adjust_purchase_verification_result.dart'; // Verify only (does not track an event) final purchase = AdjustAppStorePurchase( 'com.example.premium', // productId 'ios-transaction-xyz', // transactionId ); final AdjustPurchaseVerificationResult? result = await Adjust.verifyAppStorePurchase(purchase); if (result != null) { print('Status: ${result.verificationStatus}'); // 'verified', 'not_verified', etc. print('Code: ${result.code}'); // HTTP-like code print('Msg: ${result.message}'); } // Verify AND track simultaneously final event = AdjustEvent('iap_event_token'); event.setRevenue(9.99, 'USD'); event.productId = 'com.example.premium'; event.transactionId = 'ios-transaction-xyz'; final AdjustPurchaseVerificationResult? trackResult = await Adjust.verifyAndTrackAppStorePurchase(event); print('Track+verify result: ${trackResult?.verificationStatus}'); ``` -------------------------------- ### Track Revenue Event with Adjust Flutter SDK Source: https://github.com/adjust/flutter_sdk/blob/master/example/README.md Use this to track events that include revenue data. Specify the amount and currency, and optionally set a transaction ID. ```dart final event = AdjustEvent('a4fd35'); event.setRevenue(100.0, 'EUR'); event.transactionId = 'DummyTransactionId'; Adjust.trackEvent(event); ``` -------------------------------- ### Adjust.verifyPlayStorePurchase / Adjust.verifyAndTrackPlayStorePurchase Source: https://context7.com/adjust/flutter_sdk/llms.txt Verifies a Google Play Store in-app purchase, returning a `AdjustPurchaseVerificationResult`. The combined variant also records the event. ```APIDOC ## `Adjust.verifyPlayStorePurchase` / `Adjust.verifyAndTrackPlayStorePurchase` — Android Purchase Verification Verifies a Google Play Store in-app purchase, returning a `AdjustPurchaseVerificationResult`. The combined variant also records the event. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_play_store_purchase.dart'; import 'package:adjust_sdk/adjust_event.dart'; import 'package:adjust_sdk/adjust_purchase_verification_result.dart'; // Verify only final purchase = AdjustPlayStorePurchase( 'com.example.premium', // productId 'android-purchase-token-abc', // purchaseToken ); final AdjustPurchaseVerificationResult? result = await Adjust.verifyPlayStorePurchase(purchase); if (result != null) { print('Status: ${result.verificationStatus}'); print('Code: ${result.code}'); print('Msg: ${result.message}'); } // Verify AND track simultaneously final event = AdjustEvent('play_iap_token'); event.setRevenue(4.99, 'USD'); event.productId = 'com.example.premium'; event.purchaseToken = 'android-purchase-token-abc'; final AdjustPurchaseVerificationResult? trackResult = await Adjust.verifyAndTrackPlayStorePurchase(event); print('Track+verify result: ${trackResult?.verificationStatus}'); ``` ``` -------------------------------- ### Control Third-Party Data Sharing with Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Enables or disables data sharing with third parties and configures per-partner granular sharing options. Pass `null` to configure granular options without changing the overall sharing state. Use `trackMeasurementConsent` to notify about user-level measurement consent. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_third_party_sharing.dart'; // Disable all third-party sharing (e.g. user opts out) final optOut = AdjustThirdPartySharing(false); Adjust.trackThirdPartySharing(optOut); // Enable with granular per-partner options final sharing = AdjustThirdPartySharing(true); // Granular options: partnerName, key, value sharing.addGranularOption('PartnerA', 'user_data', 'no'); sharing.addGranularOption('PartnerA', 'device_data', 'yes'); // Partner sharing settings: partnerName, key, bool sharing.addPartnerSharingSetting('facebook', 'install', false); sharing.addPartnerSharingSetting('google_dv360', 'all', true); Adjust.trackThirdPartySharing(sharing); // Notify about user-level measurement consent (Google consent mode) Adjust.trackMeasurementConsent(true); ``` -------------------------------- ### Adjust.trackPlayStoreSubscription Source: https://context7.com/adjust/flutter_sdk/llms.txt Tracks a Google Play Store subscription purchase on Android. This method requires details such as SKU, order ID, signature, purchase token, price, and currency, along with optional purchase time and custom parameters. ```APIDOC ## `Adjust.trackPlayStoreSubscription` — Android Subscription Tracking Tracks a Google Play Store subscription purchase including SKU, order ID, signature, and purchase token. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_play_store_subscription.dart'; final subscription = AdjustPlayStoreSubscription( '999', // price in micros as string 'USD', // currency 'com.example.premium_monthly', // sku 'GPA.1234-5678-9012-34567', // orderId 'purchase_signature_base64', // signature 'android-purchase-token-xyz', // purchaseToken ); subscription.purchaseTime = '1693564800000'; // epoch ms subscription.addCallbackParameter('plan', 'monthly'); subscription.addPartnerParameter('channel', 'organic'); Adjust.trackPlayStoreSubscription(subscription); ``` ``` -------------------------------- ### Track Simple and Revenue Events Source: https://context7.com/adjust/flutter_sdk/llms.txt Track custom events with an event token. For revenue events, set the amount and currency, and optionally provide a deduplication ID and callback ID to prevent double-counting and reference the event. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_event.dart'; // Simple event final simpleEvent = AdjustEvent('abc123'); Adjust.trackEvent(simpleEvent); // Revenue event final revenueEvent = AdjustEvent('xyz789'); revenueEvent.setRevenue(9.99, 'USD'); revenueEvent.deduplicationId = 'unique-order-id-001'; // prevent double-counting revenueEvent.callbackId = 'my-callback-ref-001'; Adjust.trackEvent(revenueEvent); ``` -------------------------------- ### Track iOS App Store Subscription - Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Tracks an App Store subscription purchase. Set transaction date, sales region, and custom parameters as needed. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_app_store_subscription.dart'; final subscription = AdjustAppStoreSubscription( '9.99', // price (string) 'USD', // currency 'txn-id-ios-001', // transactionId ); subscription.transactionDate = '2024-09-01T12:00:00Z'; subscription.salesRegion = 'US'; subscription.addCallbackParameter('subscription_tier', 'premium'); subscription.addPartnerParameter('renewal_count', '1'); Adjust.trackAppStoreSubscription(subscription); ``` -------------------------------- ### Adjust.trackAppStoreSubscription Source: https://context7.com/adjust/flutter_sdk/llms.txt Tracks an App Store subscription purchase on iOS. It allows for specifying price, currency, transaction ID, and optional details like sales region, transaction date, and custom parameters. ```APIDOC ## `Adjust.trackAppStoreSubscription` — iOS Subscription Tracking Tracks an App Store subscription purchase with optional sales region, transaction date, and custom parameters. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_app_store_subscription.dart'; final subscription = AdjustAppStoreSubscription( '9.99', // price (string) 'USD', // currency 'txn-id-ios-001', // transactionId ); subscription.transactionDate = '2024-09-01T12:00:00Z'; subscription.salesRegion = 'US'; subscription.addCallbackParameter('subscription_tier', 'premium'); subscription.addPartnerParameter('renewal_count', '1'); Adjust.trackAppStoreSubscription(subscription); ``` ``` -------------------------------- ### Retrieve Device Identifiers - Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Asynchronously retrieve platform-specific advertising and device identifiers. Includes cross-platform ADID, iOS IDFA/IDFV, and Android Google/Amazon Ad IDs. ```dart import 'package:adjust_sdk/adjust.dart'; // Cross-platform: Adjust device identifier final String? adid = await Adjust.getAdid(); print('ADID: $adid'); // With timeout (returns null if not available within the interval) final String? adidTimed = await Adjust.getAdidWithTimeout(3000); // 3 seconds // Current attribution data final attribution = await Adjust.getAttribution(); print('${attribution.network} / ${attribution.campaign}'); // With timeout final attrTimed = await Adjust.getAttributionWithTimeout(5000); // iOS only final String? idfa = await Adjust.getIdfa(); final String? idfv = await Adjust.getIdfv(); final int attStatus = await Adjust.getAppTrackingAuthorizationStatus(); // attStatus: 0=notDetermined, 1=restricted, 2=denied, 3=authorized // Android only final String? googleAdId = await Adjust.getGoogleAdId(); final String? amazonAdId = await Adjust.getAmazonAdId(); // SDK version string (e.g. "flutter5.6.2@5.6.2") final String sdkVersion = await Adjust.getSdkVersion(); print('SDK version: $sdkVersion'); ``` -------------------------------- ### Track In-App Purchases with Transaction IDs Source: https://context7.com/adjust/flutter_sdk/llms.txt Track in-app purchases by setting the product ID and transaction ID for iOS App Store purchases or the purchase token for Android Play Store purchases. Revenue and currency should also be set. ```dart // iOS: event with App Store transaction for purchase verification + tracking final iapEvent = AdjustEvent('iap_token'); iapEvent.setRevenue(4.99, 'USD'); iapEvent.productId = 'com.example.premium_monthly'; iapEvent.transactionId = 'ios-transaction-id-abc'; Adjust.trackEvent(iapEvent); // Android: event with Play Store purchase token final playEvent = AdjustEvent('play_token'); playEvent.setRevenue(4.99, 'USD'); playEvent.productId = 'com.example.premium_monthly'; playEvent.purchaseToken = 'android-purchase-token-xyz'; Adjust.trackEvent(playEvent); ``` -------------------------------- ### Verify Android Play Store Purchases with Adjust SDK Source: https://context7.com/adjust/flutter_sdk/llms.txt Verifies a Google Play Store in-app purchase, returning a `AdjustPurchaseVerificationResult`. The combined variant also records the event. Use this for Android in-app purchase validation. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_play_store_purchase.dart'; import 'package:adjust_sdk/adjust_event.dart'; import 'package:adjust_sdk/adjust_purchase_verification_result.dart'; // Verify only final purchase = AdjustPlayStorePurchase( 'com.example.premium', // productId 'android-purchase-token-abc', // purchaseToken ); final AdjustPurchaseVerificationResult? result = await Adjust.verifyPlayStorePurchase(purchase); if (result != null) { print('Status: ${result.verificationStatus}'); print('Code: ${result.code}'); print('Msg: ${result.message}'); } // Verify AND track simultaneously final event = AdjustEvent('play_iap_token'); event.setRevenue(4.99, 'USD'); event.productId = 'com.example.premium'; event.purchaseToken = 'android-purchase-token-abc'; final AdjustPurchaseVerificationResult? trackResult = await Adjust.verifyAndTrackPlayStorePurchase(event); print('Track+verify result: ${trackResult?.verificationStatus}'); ``` -------------------------------- ### Device Identifier Retrieval Source: https://context7.com/adjust/flutter_sdk/llms.txt Asynchronously retrieves various device and advertising identifiers, including the Adjust device identifier (ADID), platform-specific IDs like IDFA and Google Ad ID, and attribution data. Includes options for timeouts. ```APIDOC ## Device Identifier Retrieval Retrieve platform-specific advertising and device identifiers asynchronously. ```dart import 'package:adjust_sdk/adjust.dart'; // Cross-platform: Adjust device identifier final String? adid = await Adjust.getAdid(); print('ADID: $adid'); // With timeout (returns null if not available within the interval) final String? adidTimed = await Adjust.getAdidWithTimeout(3000); // 3 seconds // Current attribution data final attribution = await Adjust.getAttribution(); print('${attribution.network} / ${attribution.campaign}'); // With timeout final attrTimed = await Adjust.getAttributionWithTimeout(5000); // iOS only final String? idfa = await Adjust.getIdfa(); final String? idfv = await Adjust.getIdfv(); final int attStatus = await Adjust.getAppTrackingAuthorizationStatus(); // attStatus: 0=notDetermined, 1=restricted, 2=denied, 3=authorized // Android only final String? googleAdId = await Adjust.getGoogleAdId(); final String? amazonAdId = await Adjust.getAmazonAdId(); // SDK version string (e.g. "flutter5.6.2@5.6.2") final String sdkVersion = await Adjust.getSdkVersion(); print('SDK version: $sdkVersion'); ``` ``` -------------------------------- ### iOS App Tracking Transparency (ATT) and SKAdNetwork Source: https://context7.com/adjust/flutter_sdk/llms.txt Handles iOS-specific privacy features by allowing developers to request App Tracking Transparency authorization from the user and manually update SKAdNetwork conversion values. ```APIDOC ## iOS App Tracking Transparency (ATT) and SKAdNetwork Request ATT authorization and manually update SKAdNetwork conversion values. ```dart import 'package:adjust_sdk/adjust.dart'; // Prompt the user with the ATT dialog // Returns: 0=notDetermined, 1=restricted, 2=denied, 3=authorized final num attStatus = await Adjust.requestAppTrackingAuthorization(); print('ATT status: $attStatus'); // Manually update SKAN conversion value // coarseValue: 'low' | 'medium' | 'high' final String? error = await Adjust.updateSkanConversionValue( 63, // fine conversion value (0–63) 'high', // coarse conversion value false, // lockWindow ); if (error != null) { print('SKAN update error: $error'); } else { print('SKAN conversion value updated'); } ``` ``` -------------------------------- ### Track Ad Revenue Source: https://context7.com/adjust/flutter_sdk/llms.txt Report ad revenue by providing the ad network source and revenue details. Optional metadata like impression count, unit, and placement can be included, along with callback and partner parameters. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_ad_revenue.dart'; final adRevenue = AdjustAdRevenue('applovin_max_sdk'); // Required: revenue amount and currency adRevenue.setRevenue(0.0025, 'USD'); // Optional metadata adRevenue.adImpressionsCount = 1; adRevenue.adRevenueNetwork = 'admob'; adRevenue.adRevenueUnit = 'banner_320x50'; adRevenue.adRevenuePlacement = 'home_screen_top'; // Optional parameters forwarded to callback/partner adRevenue.addCallbackParameter('session_id', 'sess-abc123'); adRevenue.addPartnerParameter('ad_unit_id', 'ca-app-pub-xxxx/yyyy'); Adjust.trackAdRevenue(adRevenue); // Supported source strings: 'applovin_max_sdk', 'mopub', 'admob_sdk', // 'helium_chartboost_sdk', 'ironsource_sdk', 'unity_sdk', 'tradplus_sdk', // 'topon_sdk', 'adx_sdk', 'publisher_defined' ``` -------------------------------- ### Adjust.trackAdRevenue - Track Ad Revenue Source: https://context7.com/adjust/flutter_sdk/llms.txt Reports ad revenue from mediation networks. Accepts a source string identifying the network and optional impression/placement metadata. ```APIDOC ## `Adjust.trackAdRevenue` — Track Ad Revenue Reports ad revenue from mediation networks. Accepts a source string identifying the network and optional impression/placement metadata. ```dart import 'package:adjust_sdk/adjust.dart'; import 'package:adjust_sdk/adjust_ad_revenue.dart'; final adRevenue = AdjustAdRevenue('applovin_max_sdk'); // Required: revenue amount and currency adRevenue.setRevenue(0.0025, 'USD'); // Optional metadata adRevenue.adImpressionsCount = 1; adRevenue.adRevenueNetwork = 'admob'; adRevenue.adRevenueUnit = 'banner_320x50'; adRevenue.adRevenuePlacement = 'home_screen_top'; // Optional parameters forwarded to callback/partner adRevenue.addCallbackParameter('session_id', 'sess-abc123'); adRevenue.addPartnerParameter('ad_unit_id', 'ca-app-pub-xxxx/yyyy'); Adjust.trackAdRevenue(adRevenue); // Supported source strings: 'applovin_max_sdk', 'mopub', 'admob_sdk', // 'helium_chartboost_sdk', 'ironsource_sdk', 'unity_sdk', 'tradplus_sdk', // 'topon_sdk', 'adx_sdk', 'publisher_defined' ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.