Incompatible with New Consent Management Platform requirements for serving ads in the EEA and UK
This plugin can no longer be updated and used, use one of the Google-certified CMPs instead.
Every application, except for children, must make certain disclosures to users in the European Economic Area (EEA) along with the UK and obtain their consent to use cookies or other local storage, where legally required, and to use personal data (such as AdID) to serve ads. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR).
The CAS Unity Consent provides tools for publishers to request consent for personalized ads as well as to handle Apple's App Tracking Transparency (ATT) requirements.
if you are using Unity 2018.4 or newer then you can add CAS SDK to your Unity project using the Unity Package Manager, or you can import the package manually.
In your open Unity project, navigate to Window -> Package Manager -> + -> Add package from Git URL
and add url:
https://github.com/cleveradssolutions/CAS-Unity-Consent.git#2.0.1
Open YourProject/Packages/manifest.json
file in any text editor and add line in dependencies
tag:
{ "dependencies": {
"com.cleversolutions.ads.unity": "https://github.com/cleveradssolutions/CAS-Unity-Consent.git#2.0.1",
} }
- Download latest CleverAdsSolutions.unitypackage
- In your open Unity project, navigate to
Assets > Import Package > Custom Package
. - In the
Import Unity Package
window, make sure all of the files are selected and click Import.
In your open Unity project, navigate to Assets > CleverAdsSolutions > Consent request parameters to create and modify request parameters.
- Test in Unity Editor - Show request in Unity Editor.
- With Age of audience request - The user is prompted for the year ir birth and the audience is determined automatically.
- With iOS App tracking Transparency request - The iOS 14.5+ users is prompted for permission to track the Advertising ID.
- With option of Decline consent - The user is given the choice to opt out dialog.
- With Mediation Networks settings - The user is provided with advanced consent settings for each active network in the game.
- Network UI Prefab field - Refference to network toggle prefab.
- Create template button - Create and set a template prefab in project assets to override the interface.
- Default button - Set default prefab from package.
- Consent UI Prefab field - Refference to main canvas prefab.
- Create template button - Create and set a template prefab in project assets to override the interface.
- Default button - Set default prefab from package.
- Privacy policy URL field - URL to applicaiton privacy policy for each platform or universal.
- Terms of Use URL field - URL to application terms of use for each platform or universal.
To load query parameters from an asset into resources, or create default parameters when an asset has not been created, use the following method:
ConsentRequestParameters request = CAS.UserConsent.UserConsent.BuildRequest();
Override any parameters with following methods:
request.DisableInEditor()
.DisableAudienceDefinition()
.DisableDeclineOption()
.DisableMediationSettings()
.WithAudienceDefinition()
.WithDeclineOption()
.WithMediationSettings()
.WithRequestTrackingTransparency()
.WithUIPrefab(customUIPrefab)
.WithMediationSettingsTogglePrefab(customTogleUIPrefab)
.WithPrivacyPolicy(privcyPolicyURL)
.WithTermsOfUse(termsOfUseURL)
.WithResetConsentStatus()
.WithResetUserInfo()
.WithConsentMessage(consentMessage)
.WithSettingsMessage(mediationSettingsMessage);
To subscribe callback use the following method:
request.WithCallback(() => {
// User consent received
// Next step initialize Clever Ads Solutions
IMediationManager manager = CAS.MobileAds.BuildManager().Initialize();
});
UserConsentUI form = request.Present();
Get the latest consent status value:
ConsentStatus status = CAS.UserConsent.UserConsent.GetStatus();
Get the latest selected year of birth.
int year = CAS.UserConsent.UserConsent.GetYearOfBirth();
Get the latest tagged audience.
Audience audience = CAS.UserConsent.UserConsent.GetAudience();
Add component > CleverAdsSolutions > UserConsent > Request
- Request On Awake - Automatically form present while the scene is awake. Else call public method
Present()
- Reset User Info - Reset latest user consent state and selected year of birth.
- Reset Consent Status - Reset latest user consent state.
- Use global settings - Use consent request parameters from asset in resource. Else set reference to custom consent request parameters asset.
- OnConsent - Event on requeset finish.
iOS 14 and above requires publishers to obtain permission to track the user's device across applications.
- Open Consent requeset parameters in
Assets > CleverAdsSolution > Consent Request Parameters
menu. - Check With iOS App tracking Transparency request
- Open CAS settings in
Assets > CleverAdsSolution > iOS Settings
menu. - Check Set User Tracking Usage description
- Define NSUserTrackingUsageDescription
To file bugs, make feature requests, or suggest improvements for the Unity Consent Plugin, please use GitHub's issue tracker.
Site: https://cleveradssolutions.com
mailto:support@cleveradssolutions.com
The CAS Unity Consent plugin is available under a commercial license. See the LICENSE file for more info.