Data Privacy Regulations
Explore the guidelines below to ensure best practices when using the X3M SDK to comply with Data Privacy and Child-Directed regulations, including GDPR, CCPA, COPPA, and other relevant standards.
Use of Personal Information
In adherence to data privacy regulations, avoid transmitting personal user information (such as age, gender, etc.) through the custom user properties initialization option (see InitSettings/UserProperties/CustomProperties). Please be aware that X3M disclaims responsibility for managing such information for users identified as children, as this could potentially violate existing regulations
Integrate with a Consent Management Platform (CMP)
Option 1: Enable CMP Automation
X3M provides a mechanism for automating the integration with Google's User Messaging Platform. To enable this feature, set the flag isCMPAutomationEnabled
to true
:
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.isCMPAutomationEnabled = YES;
X3MInitSettings *initSettings = [X3MInitSettings new];
initSettings.consentInformation = consentInformation;
[X3MXMediatorAds startWithAppKey:@"<your-app-key>"
initSettings:initSettings
callback:^(NSError * _Nullable error) {
// [...]
}];
This will prompt the user for consent only when required, and continue with the SDK initialization after the signals have been collected.
Display a Privacy Settings button inside your app
To give users the option to change their consent during the session, you may want to display a button in your app's settings when a form is available. X3M's SDK provides the following methods to achieve this:
if (XMediatorAds.cmpProvider.isPrivacyFormAvailable()) {
// ... display the privacy settings form button
}
// [...]
XMediatorAds.cmpProvider.presentPrivacyForm(fromViewController: self) { error in
if let error = error {
print("Error: \(error.localizedDescription)")
}
print("presentPrivacyForm complete!")
}
if (X3MXMediatorAds.cmpProvider.isPrivacyFormAvailable) {
// ... display the privacy settings form button
}
// [...]
[X3MXMediatorAds.cmpProvider presentPrivacyFormFromViewController:self onComplete:^(NSError * _Nullable error) {
if (error != nil) {
NSLog(@"Error: %@", error);
}
NSLog(@"presentPrivacyForm complete!");
}];
Debug your integration
When using the CMP Automation feature, you can use the following methods to debug your integration:
// Available options: .disabled, .EEA and .notEEA
let cmpDebugSettings = CMPDebugSettings(debugGeography: .EEA)
let consentInformation = ConsentInformation(isCMPAutomationEnabled: true,
cmpDebugSettings: cmpDebugSettings)
let initSettings = InitSettings(consentInformation: consentInformation)
// Configure a Debug Geography to trigger Privacy Form display
XMediatorAds.startWith(appKey: "<your-app-key>",
initSettings: initSettings) { _ in
// [...]
}
// Clear the collected consent signals from the device (debug only)
XMediatorAds.cmpProvider.reset()
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.isCMPAutomationEnabled = YES;
// Configure a Debug Geography to trigger Privacy Form display
consentInformation.cmpDebugSettings = [[X3MCMPDebugSettings alloc] initWithDebugGeography:X3MCMPDebugGeographyEEA];
X3MInitSettings *initSettings = [X3MInitSettings new];
initSettings.consentInformation = consentInformation;
[X3MXMediatorAds startWithAppKey:@"<your-app-key>"
initSettings:initSettings
callback:^(NSError * _Nullable error) {
// [...]
}];
// Clear the collected consent signals from the device (debug only)
[X3MXMediatorAds.cmpProvider reset];
Option 2: Custom integration with a CMP
Another option is to integrate your app or game directly with the CMP, without relying on X3M's automation. The recommended workflow is as follows:
- First, request the CMP to update the consent requirements for the user.
- If the consent has been granted on a previous session, continue with X3M's initialization without waiting for the requirements update, in order to reduce latency.
- Wait for the consent requirements update request to complete.
- Launch the CMP's privacy form if available and await for its completion.
- Then, initialize X3M's XMediator SDK, and wait for the initialization callback to complete.
- By this point, you can start requesting ads.
This approach ensures that all required consent signals are collected before the ad mediation begins.
Info
For specific instructions on how to implement this workflow using your chosen CMP, please refer to its official documentation.
Consent Information API
XMediator provides a mechanism to forward the user consent to each advertising partner.
For more information about the data privacy regulations that may apply to your product please refer to IAB's Standards. Please note that XMediator is not a replacement to a Consent Management Platform. If you wish to integrate one please refer to IAB's authorized CMP list.
Manage user consent
To indicate whether the user has given consent to be served personalized ads please use the hasUserConsent
flag as shown below:
// Setting the flag on initialization
let consentInformation = ConsentInformation(hasUserConsent: true)
let initSettings = InitSettings(consentInformation: consentInformation)
XMediatorAds.startWith(appKey: "<your-app-key>",
initSettings: initSettings) { _ in
// [...]
}
// [...]
// Updating the flag after initialization
let consentInformation = ConsentInformation(hasUserConsent: true)
XMediatorAds.setConsentInformation(consentInformation)
// Setting the flag on initialization
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.hasUserConsent = @YES;
X3MInitSettings *initSettings = [X3MInitSettings new];
initSettings.consentInformation = consentInformation;
[X3MXMediatorAds startWithAppKey:@"<your-app-key>"
initSettings:initSettings
callback:^(NSError * _Nullable error) {
// [...]
}];
// [...]
// Updating the flag after initialization
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.hasUserConsent = @YES;
[X3MXMediatorAds setConsentInformation:consentInformation];
GDPR Consent for European Economic Area Users
Integration considerations:
- Please note that XMediator does not generate a GDPR Consent String (see Consent String and Vendor List Format) as using a CMP would. Some ad sources may still require you to integrate a CMP in order to serve ads to european users.
- If the user is not affected by EU's GDPR you should avoid setting these flags as it may have a negative effect on the ad mediation performance.
For more information on X3M's approach to GDPR please reach out to us.
Opt-out of sale flag
You can use this flag to indicate whether the user has opted out of the sale of their personal information.
If the user does not opt out, please set the doNotSell
flag as shown below:
// Setting the flag on initialization
let consentInformation = ConsentInformation(doNotSell: false)
let initSettings = InitSettings(consentInformation: consentInformation)
XMediatorAds.startWith(appKey: "<your-app-key>",
initSettings: initSettings) { _ in
// [...]
}
// [...]
// Updating the flag after initialization
let consentInformation = ConsentInformation(doNotSell: false)
XMediatorAds.setConsentInformation(consentInformation)
// Setting the flag on initialization
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.doNotSell = @NO;
X3MInitSettings *initSettings = [X3MInitSettings new];
initSettings.consentInformation = consentInformation;
[X3MXMediatorAds startWithAppKey:@"<your-app-key>"
initSettings:initSettings
callback:^(NSError * _Nullable error) {
// [...]
}];
// [...]
// Updating the flag after initialization
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.doNotSell = @NO;
[X3MXMediatorAds setConsentInformation:consentInformation];
CCPA Data Privacy Regulation
Integration considerations:
- If the user is not affected by California's CCPA you should avoid setting these flags as it may have a negative effect on the ad mediation performance.
For more information on X3M's approach to CCPA please reach out to us.
Child directed flag
You can use this flag to indicate whether the user must be treated as a child. To do this, set the isChildDirected
flag as shown below:
// Setting the flag on initialization
let consentInformation = ConsentInformation(isChildDirected: true)
let initSettings = InitSettings(consentInformation: consentInformation)
XMediatorAds.startWith(appKey: "<your-app-key>",
initSettings: initSettings) { _ in
// [...]
}
// [...]
// Updating the flag after initialization
let consentInformation = ConsentInformation(isChildDirected: true)
XMediatorAds.setConsentInformation(consentInformation)
// Setting the flag on initialization
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.isChildDirected = @YES;
X3MInitSettings *initSettings = [X3MInitSettings new];
initSettings.consentInformation = consentInformation;
[X3MXMediatorAds startWithAppKey:@"<your-app-key>"
initSettings:initSettings
callback:^(NSError * _Nullable error) {
// [...]
}];
// [...]
// Updating the flag after initialization
X3MConsentInformation *consentInformation = [X3MConsentInformation new];
consentInformation.isChildDirected = @YES;
[X3MXMediatorAds setConsentInformation:consentInformation];
COPPA Regulation
Integration considerations:
- If the user is not subject to the Children's Online Privacy Protection Rule you should avoid setting these flags as it may have a negative effect on the ad mediation performance.
For more information on how X3M complies with COPPA, please visit the COPPA Compliance Guidelines for Apps on X3M Platform