GDPR compliance

All versions of the Unity Ads SDK are compliant with the General Data Protection Regulation (GDPR), which took effect in the European Economic Area (EEA) on May 25, 2018.

Visit our legal site for more information on Unity's approach to privacy.

Unity's built-in solution

Unity recommends that you update to the latest version of the Unity Ads SDK, but this is not required for GDPR compliance.

SDK versions earlier than 2.0 now only serve contextual ads to users, strictly based on geographic location and current gameplay. No historical or personal data is used for ad targeting, including user behavior within the app and across other apps, or installs.

SDK versions 2.0 and later automatically present affected users with an opportunity to opt in to targeted advertising, with no implementation needed from the publisher. On a per-app basis, the first time a Unity ad appears, the user sees a banner with the option to opt in to behaviorally targeted advertising. Thereafter, the user can select an information button to manage their privacy choices.

Implementing a custom solution

If a publisher or mediator manually requests a user opt-in, the Unity opt-in will not appear. Note that users can still request opt-out or data deletion, and access their data at any time by tapping the Unity Data Privacy icon when or after an ad appears.

Use the following API to pass a consent flag to the Unity Ads SDK.

Tip: If the user takes no action to agree or disagree with targeted advertising (for example, closing the prompt), Unity recommends re-prompting them at a later time.

Unity (C#)

// If the user opts in to targeted advertising:
MetaData gdprMetaData = new MetaData("gdpr");
gdprMetaData.Set("consent", "true");
Advertisement.SetMetaData(gdprMetaData);

// If the user opts out of targeted advertising:
MetaData gdprMetaData = new MetaData("gdpr");
gdprMetaData.Set("consent", "false");
Advertisement.SetMetaData(gdprMetaData);

Note: You must commit the changes to the MetaData object for each value before trying to set another value. The second parameter is an object (a string in this example). Using a Boolean value will result in an error.

iOS (Objective-C)

// If the user opts in to targeted advertising:
UADSMetaData *gdprConsentMetaData = [[UADSMetaData alloc] init];
[gdprConsentMetaData set:@"gdpr.consent" value:@YES];
[gdprConsentMetaData commit];

// If the user opts out of targeted advertising:
UADSMetaData *gdprConsentMetaData = [[UADSMetaData alloc] init];
[gdprConsentMetaData set:@"gdpr.consent" value:@NO];
[gdprConsentMetaData commit];

Note: You must commit the changes to the MetaData object for each value before trying to set another value.

Android (Java)

// If the user opts in to targeted advertising:
MetaData gdprMetaData = new MetaData(this);
gdprMetaData.set("gdpr.consent", true);
gdprMetaData.commit();

// If the user opts out of targeted advertising:
MetaData gdprMetaData = new MetaData(this);
gdprMetaData.set("gdpr.consent", false);
gdprMetaData.commit();

Note: You must commit the changes to the MetaData object for each value before trying to set another value.