Consent for Edge Network
The Adobe Experience Platform Consent mobile extension enables consent preferences collection from your mobile app when using the Adobe Experience Platform Mobile SDK and the Edge Network extension.
Configure the Adobe Experience Platform Consent extension in Data Collection UI
- In Data Collection UI, in your mobile property, select the Extensions tab.
- On the Catalog tab, locate or search for the Consent extension, and select Install.
- Set your desired default consent level.
- Select Save.
- Follow the publishing process to update SDK configuration.
In order to ingest and use the data collected by this extension, follow the guide on ingesting data using the Consents and Preferences data type.
The Consent extension uses Adobe Standard 2.0 when communicating with the Edge Network.
The use of this extension is currently limited to the setting (and enforcement) of client-side, macro consent flags. While SDK APIs allow for granular and global consent preference collection, flags are not consistently enforced with upstream applications and therefore will not accommodate use cases that rely on global/granular consent preferences.
Add the AEP Consent extension to your app
Download and import the Consent extension
- Add the Mobile Core and Edge extensions to your project using the app's Gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:edge")implementation("com.adobe.marketing.mobile:edgeidentity")implementation("com.adobe.marketing.mobile:edgeconsent")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:edge'implementation 'com.adobe.marketing.mobile:edgeidentity'implementation 'com.adobe.marketing.mobile:edgeconsent'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Mobile Core and Edge extensions in your Application class.
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.edge.identity.Identity;import com.adobe.marketing.mobile.edge.consent.Consent;
- Add the Mobile Core and Edge extensions to your project using Cocoapods. Add following pods in your
Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'AEPCore', '~> 5.0'pod 'AEPEdge', '~> 5.0'pod 'AEPEdgeIdentity', '~> 5.0'pod 'AEPEdgeConsent', '~> 5.0'end
- Import the Mobile Core and Edge libraries:
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeimport AEPEdgeIdentityimport AEPEdgeConsent
Objective-C
Copied to your clipboard// AppDelegate.h@import AEPCore;@import AEPEdge;@import AEPEdgeIdentity;@import AEPEdgeConsent;
- Add the Mobile Core and Edge extensions to your project using the app's Gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:edge")implementation("com.adobe.marketing.mobile:edgeidentity")implementation("com.adobe.marketing.mobile:edgeconsent")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:edge'implementation 'com.adobe.marketing.mobile:edgeidentity'implementation 'com.adobe.marketing.mobile:edgeconsent'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Mobile Core and Edge extensions in your Application class.
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.edge.identity.Identity;import com.adobe.marketing.mobile.edge.consent.Consent;
- Add the Mobile Core and Edge extensions to your project using Cocoapods. Add following pods in your
Podfile
:
Copied to your clipboarduse_frameworks!target 'YourTargetApp' dopod 'AEPCore', '~> 5.0'pod 'AEPEdge', '~> 5.0'pod 'AEPEdgeIdentity', '~> 5.0'pod 'AEPEdgeConsent', '~> 5.0'end
- Import the Mobile Core and Edge libraries:
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeimport AEPEdgeIdentityimport AEPEdgeConsent
Objective-C
Copied to your clipboard// AppDelegate.h@import AEPCore;@import AEPEdge;@import AEPEdgeIdentity;@import AEPEdgeConsent;
Register Edge extensions with Mobile Core
Java
Copied to your clipboardpublic class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);MobileCore.registerExtensions(Arrays.asList(Consent.EXTENSION, Identity.EXTENSION, Edge.EXTENSION),o -> Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized"));}}
Kotlin
Copied to your clipboardclass MainApp : Application() {override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.configureWithAppID("YOUR_APP_ENVIRONMENT_ID")val extensions = listOf(Consent.EXTENSION, Identity.EXTENSION, Edge.EXTENSION)MobileCore.registerExtensions(extensions) {Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized")}}}
Swift
Copied to your clipboard// AppDelegate.swiftfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([Identity.self, Edge.self, Consent.self], {MobileCore.configureWith(appId: "yourAppId")})...}
Objective-C
Copied to your clipboard// AppDelegate.m- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@[AEPMobileEdgeIdentity.class, AEPMobileEdge.class, AEPMobileEdgeConsent.class] completion:^{[AEPMobileCore configureWithAppId: @"yourAppId"];}];...}
Java
Copied to your clipboardpublic class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);MobileCore.registerExtensions(Arrays.asList(Consent.EXTENSION, Identity.EXTENSION, Edge.EXTENSION),o -> Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized"));}}
Kotlin
Copied to your clipboardclass MainApp : Application() {override fun onCreate() {super.onCreate()MobileCore.setApplication(this)MobileCore.configureWithAppID("YOUR_APP_ENVIRONMENT_ID")val extensions = listOf(Consent.EXTENSION, Identity.EXTENSION, Edge.EXTENSION)MobileCore.registerExtensions(extensions) {Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized")}}}
Swift
Copied to your clipboard// AppDelegate.swiftfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {MobileCore.registerExtensions([Identity.self, Edge.self, Consent.self], {MobileCore.configureWith(appId: "yourAppId")})...}
Objective-C
Copied to your clipboard// AppDelegate.m- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[AEPMobileCore registerExtensions:@[AEPMobileEdgeIdentity.class, AEPMobileEdge.class, AEPMobileEdgeConsent.class] completion:^{[AEPMobileCore configureWithAppId: @"yourAppId"];}];...}
Configuration keys
To update the SDK configuration programmatically, use the following information to change the Edge Consent configuration values.
Key | Required | Description | Data Type |
---|---|---|---|
consent.default | No | Consents in XDM format. For more details, see Privacy/Personalization/Marketing Preferences (Consents) Schema. | Map |