Skip to content

Unity Plugin - Privacy signals

Set privacy signals and initialize

Set privacy signals before calling MDN11 SDK initialize

All privacy signals must be set before Initialize(). This ensures ad networks receive the correct user status from the very first ad request. SetChildDirected in particular cannot be changed reliably after initialization.

using UnityEngine;
using Aurion11.A11Mediation;

public class AdsInitializer : MonoBehaviour
{
    [SerializeField] private string androidAppKey = "YOUR_ANDROID_APP_KEY";
    [SerializeField] private string iosAppKey     = "YOUR_IOS_APP_KEY";
    [SerializeField] private string hostUrl       = "YOUR_HOST_URL";

    void Awake()
    {
        // Set privacy signals before init
        A11MediationSDK.SetDoNotSell(false);
        A11MediationSDK.SetChildDirected(false);

#if UNITY_ANDROID
        string appKey = androidAppKey;
#elif UNITY_IOS
        string appKey = iosAppKey;
#else
        string appKey = androidAppKey;
#endif

        A11MediationSDK.Initialize(appKey, new[] { hostUrl });
    }
}

How privacy signals propagate

The SDK forwards each signal to the corresponding API of every integrated ad network that supports it. If a signal is not provided, nothing is set and each ad network falls back to its own default behaviour.

When SetChildDirected(true) is set, A11 Mediation automatically suppresses ad requests to networks that serve interest-based advertising only — no additional publisher configuration is required.

Publisher action required for certain networks

Some integrated networks do not expose a privacy API or do not allow deterministic signal mapping. A11 Mediation does not propagate privacy signals to these networks. Additionally, when AdMob or Google Ad Manager (GAM) mediation is active, publishers must configure privacy on AdMob/GAM's own mediated SDKs directly.

When LevelPlay mediation is active (Android), A11 Mediation sets privacy signals on the LevelPlay SDK only. Publishers must check how LevelPlay passes these signals to the ad networks it mediates.

Publishers must take these steps before calling A11MediationSDK.Initialize(), in accordance with the network's technical documentation and any applicable contractual obligations.

See the full Network privacy reference for the required action per network. If you are unsure which steps apply to your integration, contact your Aurion11 representative.

Privacy API reference

All privacy methods must be called before Initialize().

Method Description
SetDoNotSell(bool) CCPA opt-out signal. true = user has opted out of data sale.
SetChildDirected(bool) COPPA flag. true = app is directed at children. Cannot be changed after init.
SetUserConsent(A11UserConsent) GDPR / LGPD per-vendor consent map.
SetUserId(string) Optional first-party user identifier.
SetIsPaidUser(bool) Whether the user has a paid subscription. Used for revenue reporting.

A11UserConsent example

using System.Collections.Generic;
using Aurion11.A11Mediation;

var consent = new A11UserConsent(
    jurisdiction: A11Jurisdiction.GDPR,
    consents: new Dictionary<string, bool>
    {
        { "GoogleAdmob", true },
        { "AppLovin",    true }
    }
);

A11MediationSDK.SetUserConsent(consent);

Vendor keys use the camel-case vendor name, e.g. "GoogleAdmob", "GoogleAdManager", "AppLovin", "MetaAudienceNetwork", "UnityAds". An unrecognized key is skipped, and the rest of the map is still applied (on Android the skipped key is also logged as an error).

LevelPlay mediation (Android)

There is no separate LevelPlay vendor key. To set GDPR / LGPD consent for LevelPlay mediation, set the "UnityAds" entry.

Next steps

Initialize the SDK, then integrate your ad units.