View as Markdown

Unity

The Ezoic Unity SDK lets you show Ezoic banner, rewarded, and interstitial ads in Unity games while relying on the native Android and iOS SDKs for ad loading, Prebid, Google Ad Manager, consent handling, pageview tracking, and remote configuration.

The Unity package is a C# bridge over the native SDKs. It does not reimplement the ad stack in C#, so your game code stays platform-agnostic and the same calls run as safe no-ops in the editor.

Requirements

  • Unity 2021.3 LTS or higher
  • Android SDK 24 or higher for Android apps, with Target API Level 34 or higher
  • iOS 15.0 or higher for iOS apps, built with Xcode 26.2 or higher
  • External Dependency Manager recommended to resolve the native libraries: Unity's External Dependency Manager 2.1 or higher, or Google's EDM4U 1.2.189 or higher, to install the iOS SDK with Swift Package Manager (the only iOS install from Unity SDK 1.22.0)
  • Google Mobile Ads application ID provided by Ezoic

Installation

In Unity, open Window → Package Manager → + → Add package from git URL… and enter the package git URL pinned to a released version:

https://github.com/ezoic/ezoic-unity-sdk.git#v1.26.0

Or add it to your project's Packages/manifest.json dependencies:

{
  "dependencies": {
    "com.ezoic.ads": "https://github.com/ezoic/ezoic-unity-sdk.git#v1.26.0"
  }
}

The current Unity SDK version is 1.26.0, which uses native SDK 1.26.0 on Android and iOS (Google Mobile Ads 25.5.0 on Android, 13 on iOS).

Upgrading to 1.26.0: no C# code changes are needed. The package uses native SDK 1.26.0. Banner and outstream bid requests now tell bidders where the ad sits on screen (OpenRTB banner.pos). The SDK measures the view when it asks for bids: in view is above the fold, off screen (further down a scroll view, another page) is below the fold, and an anchor reports header or footer. A view not yet in a window sends no position. Ads placed in view get the stronger signal. If you added the Swift package in Xcode yourself, update it to 1.26.0 or later.

Upgrading to 1.25.0: no C# code changes are needed. The package uses native SDK 1.25.0. EzoicRewardedAd.Load still takes your ad unit id. If you added the Swift package in Xcode yourself, update it to 1.25.0 or later.

Upgrading to 1.24.0 (the release after 1.22.3; there is no Unity 1.23): no C# code changes are needed.

  • If your app uses another CMP, you can now leave the built-in CMP out of your Android and iOS builds with the new Include Ezoic CMP project setting; see Using your own CMP. By default nothing changes: the CMP is included and on.
  • New EzoicAds.IsBuiltInCmpIncluded tells you whether the built-in CMP is in the app.
  • The native consent types moved to a new consent core library, com.ezoic.sdk:ezoic-consent-core on Android and EzoicConsentCore on iOS, which the ads library brings in. If your own Swift code uses the CMP's own types (EzoicCmp, EzoicCmpConfiguration, CmpError), add import EzoicCmpSDK: import EzoicAdsSDK no longer makes them available.
  • If you added the Swift package in Xcode yourself, update it to 1.24.0 or later.

Upgrading to 1.22.3 (the release after 1.22.0; there is no Unity 1.22.1 or 1.22.2): no code changes are needed.

  • The SDK now closes an interstitial that Google renders once it has been on screen for about 20 seconds without being dismissed, and OnDismissed fires as usual. Google decides when its close button appears, and some video ads withhold it for a long time. Rewarded ads are never closed this way. See Add an Interstitial Ad.
  • A banner created without a size now gets the largest standard size that fits the banner's width, not the screen's.
  • On Android, a banner won by a header bidding partner keeps its size. Before, it could shrink to about 1x1 right after it loaded.

Upgrading to 1.22.0: no C# code changes are needed, but iOS builds need the Swift package.

  • iOS: CocoaPods is no longer supported. The package's dependency manifest no longer declares the EzoicAdsSDK CocoaPod: the CocoaPods trunk stopped receiving Ezoic releases at 1.19.1, and this package needs the 1.22.0 native SDK. Keep Swift Package Manager Integration on in the External Dependency Manager's iOS Resolver, or add the Swift package in Xcode (see iOS). Remove any pod 'EzoicAdsSDK' line you added to a Podfile yourself.
  • In the US states with consumer privacy laws, the built-in CMP now shows a privacy notice with a "Do Not Sell My Information" choice and writes the state's IAB GPP values. Ads never wait for it. See US-state privacy.
  • PresentConsentSettings opens the US privacy settings in those states. New EzoicAds.IsPrivacyOptionsRequired tells you when to show your "Privacy choices" button. If you showed it only while IsConsentRequired is true, switch to IsPrivacyOptionsRequired, so US users can reach it (see Privacy and Consent).
  • The native consent code is now its own library (com.ezoic.sdk:ezoic-cmp-sdk on Android, the EzoicCmpSDK module on iOS), which the ads library brings in. Games that don't use Ezoic ads can use the com.ezoic.cmp-sdk package on its own; see Consent management (CMP).
  • New AppPaid and SetAppContent describe your app to bidders. See App details for bidders.

Upgrading to 1.21.0: no code changes are needed. Banners now refresh automatically every 30 seconds, or at the interval Ezoic sets for the ad unit. On Android, Google Mobile Ads moves to 25.5.0 and InMobi now bids in Ezoic's Google Ad Manager auctions through Google's InMobi adapter, which the native SDK includes; if a custom mainTemplate.gradle or another plugin pins play-services-ads, allow 25.5.0. Swift Package Manager builds get native iOS SDK 1.21.0; CocoaPods builds do not (see iOS).

Upgrading to 1.20.0: no code changes are needed. With a current External Dependency Manager, the iOS SDK now installs as a Swift package instead of a CocoaPod; see iOS. Older EDM4U versions keep installing the CocoaPod, which gets no native iOS SDK updates after December 1, 2026.

Upgrading from 1.11.0 to 1.19.1:

  • iOS now requires 15.0 and Xcode 26.2, and Android requires Target API Level 34.
  • The native SDKs show a built-in consent dialog to users in GDPR regions, and ad loads for those users fail until they decide. Call EzoicAds.PresentConsentIfRequired after EzoicAds.Initialize and add a "Privacy settings" button, or turn the dialog off if you run your own consent platform. See Privacy and Consent.
  • iOS builds through CocoaPods (the EDM4U path) failed to compile in 1.11.0 and now build.
  • Calling EzoicAds.Initialize again, for example from a scene that loads twice, now reports success.
  • Android release builds made with Android Gradle Plugin 9 no longer crash at startup, and on iOS consent set with SetGDPRConsent or SetGPPConsent now reaches Google Mobile Ads, IMA and Amazon.

Platform Setup

Unity games still need the native platform setup required by Android and iOS. The package ships an Editor/EzoicDependencies.xml manifest so the External Dependency Manager for Unity (EDM4U) can resolve the native libraries automatically. Install EDM4U from the Unity Jar Resolver project.

Android

With EDM4U installed, the Android Resolver adds the native com.ezoic.sdk:ezoic-ads-sdk:1.26.0 library (from Maven Central), which brings in com.ezoic.sdk:ezoic-consent-core:1.26.0 and com.ezoic.sdk:ezoic-cmp-sdk:1.26.0 (unless you leave the CMP out), to your generated Gradle build — no manual dependency needed.

The native SDK serves through Google Ad Manager, which requires your application ID in the Android manifest. Enable Custom Main Manifest under Project Settings → Player → Android → Publishing Settings and add the meta-data entry inside the <application> tag of Assets/Plugins/Android/AndroidManifest.xml:

<manifest>
  <application>
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY" />
  </application>
</manifest>

Replace the value with the Google Mobile Ads application ID provided for your account. A missing or incorrect app ID causes the app to crash on start. The application ID is usually provided by Ezoic and can be found in your Ezoic dashboard.

iOS

Install the native iOS SDK with Swift Package Manager through the External Dependency Manager: use Unity's External Dependency Manager 2.1 or higher (Unity 2022.3 or higher), or Google's EDM4U 1.2.189 or higher. Make sure Swift Package Manager Integration is on in the iOS Resolver settings (Edit → Project Settings → External Dependency Manager → iOS Resolver for Unity's version, Assets → External Dependency Manager → iOS Resolver → Settings for EDM4U, where it is on by default). The iOS Resolver then adds the https://github.com/ezoic/ezoic-swift-sdk-dist.git package (up to the next major version from 1.26.0) to the generated Xcode project and links its EzoicAdsSDK product (the ads SDK with the built-in CMP) to UnityFramework. Xcode resolves the package, with Google Mobile Ads, Prebid Mobile and Amazon Publisher Services, when you open or build the project.

Without the External Dependency Manager, build the Xcode project from Unity, open Unity-iPhone.xcodeproj, choose File → Add Package Dependencies, enter https://github.com/ezoic/ezoic-swift-sdk-dist.git with Up to Next Major Version from 1.26.0, and add the EzoicAdsSDK product to the UnityFramework target (or EzoicAdsSDKWithoutCMP; see Using your own CMP). A Replace build regenerates the Xcode project without the package, so use Append or add it again.

CocoaPods is not supported from Unity SDK 1.22.0. The CocoaPods trunk stopped receiving Ezoic releases at 1.19.1 and becomes read-only on December 2, 2026, and this package needs the 1.26.0 native SDK. The package's dependency manifest therefore declares no CocoaPod: with Swift Package Manager Integration off, or with an EDM4U older than 1.2.187, EDM adds no Ezoic library and the Xcode build fails with no such module 'EzoicAdsSDK'. Turn the integration on, or add the package in Xcode as described above. Avoid installing Google Mobile Ads through both channels: if this package installs as a Swift package while another plugin installs the Google-Mobile-Ads-SDK CocoaPod, the app links two copies of Google Mobile Ads.

iOS requires a deployment target of 15.0 or higher, set under Project Settings → Player → iOS → Other Settings → Target minimum iOS Version.

Follow the Required App Setup for Ads to Serve in the iOS guide. These steps live in your app's Info.plist and directly affect fill, so complete all of them:

  • Adding the Google Mobile Ads application ID (GADApplicationIdentifier) and GADIsAdManagerApp to Info.plist
  • Adding NSUserTrackingUsageDescription to Info.plist (the SDK presents the App Tracking Transparency prompt for you before loading ads — biggest impact on fill)
  • Adding the SKAdNetworkItems identifiers from Ezoic's combined list, skadnetworkids.xml, to Info.plist (Apple does not read these from frameworks/SDKs, and Google's list alone misses Ezoic's other buyers)

Unity writes a new Info.plist whenever it replaces the Xcode project, so apply these entries to the generated project after each build. For the SKAdNetwork identifiers, run the command from SKAdNetwork identifiers in the Xcode build output directory, or add them from an editor script marked [PostProcessBuild].

app-ads.txt

For both platforms, host an app-ads.txt file at the root of the developer website listed on your app's store page (for example, https://example.com/app-ads.txt). It authorizes the buyers that may sell your inventory; a missing or incomplete file causes most programmatic demand to be filtered out. Ezoic provides the required entries — confirm the file is published and current. See app-ads.txt setup to redirect it to Ezoic or update it automatically.

Initialize the SDK

Initialize Ezoic once, early in your game's lifecycle, with your Ezoic-registered domain. Make the call from the Unity main thread (for example from a MonoBehaviour's Start). The optional callback reports (success, error).

using Ezoic.Ads;
using UnityEngine;

public class AdsBootstrap : MonoBehaviour
{
    void Start()
    {
        EzoicAds.Initialize("example.com", (success, error) =>
        {
            if (success)
            {
                Debug.Log("Ezoic Ads initialized. SDK version: " + EzoicAds.Version);
            }
            else
            {
                Debug.LogWarning("Ezoic Ads init failed: " + error);
            }
        });
    }
}

domain must match the domain configured for your site in Ezoic. The native Android and iOS SDKs both authenticate using the configured domain plus the app's bundle/package identifier — there is no client-side API key. EzoicAds.IsInitialized becomes true once initialization succeeds.

To pass options, use the EzoicConfiguration overload. CmpEnabled (default true) turns the built-in CMP on or off (see Privacy and Consent), and AppPaid is described below.

App details for bidders

Unity SDK 1.22.0 and later can send two optional details about your app to bidders: whether it is a paid app (AppPaid, OpenRTB app.paid), and its content language and genre (SetAppContent, OpenRTB app.content). Nothing is sent for a value you don't set.

// Paid or free app. Unset (null, the default) sends nothing.
EzoicAds.Initialize(new EzoicConfiguration("example.com") { AppPaid = false }, (success, error) => { /* ... */ });

// Sent with every later ad request. Can be called before Initialize.
EzoicAds.SetAppContent(language: "en", genre: "Puzzle");
EzoicAds.SetAppContent(null, null); // clears it

language is an ISO-639-1 two-letter code such as "en" or "de"; any other value is dropped, with a native warning. genre is free text.

Add a Banner Ad

Construct an EzoicBannerAd with your ad unit id and a screen position, subscribe to its events, then call Load(). Show it once it loads.

using Ezoic.Ads;

// Adaptive banner anchored to the bottom of the screen.
var banner = new EzoicBannerAd(adUnitId: 12345, position: BannerPosition.Bottom);

banner.OnLoaded      += () => banner.Show();
banner.OnLoadFailed  += error => Debug.LogWarning("Banner failed: " + error);
banner.OnClicked     += () => Debug.Log("Banner clicked");
banner.OnImpression  += () => Debug.Log("Banner impression");
banner.OnSizeChanged += (width, height) =>
    Debug.Log($"Banner size: {width}x{height}");

banner.Load();

// later: banner.Hide(); banner.Show();
// when done: banner.Destroy();

Replace 12345 with your Ezoic ad unit id. Use Show() / Hide() to toggle visibility without reloading, and always call Destroy() when you are done with a banner to release the native ad.

When no ad fills, the banner collapses so it does not leave a blank gap. This is controlled by CollapseOnNoFill (default true). If a refresh does not fill, the previous ad stays visible. OnSizeChanged reports the displayed size, or 0×0 when collapsed.

Banners refresh automatically every 30 seconds, or at the interval Ezoic sets for the ad unit, while at least half of the banner is on screen and your app is in the foreground. You do not set a refresh timer in your app.

The banner constructor takes an optional size string. Pass null (the default) to request an adaptive banner sized by the native SDK, or a fixed size string such as "320x50":

// Fixed 320x50 banner at the top of the screen.
var banner = new EzoicBannerAd(adUnitId: 12345, position: BannerPosition.Top, size: "320x50");

Common fixed size strings include:

  • "320x50": standard banner
  • "320x100": large banner
  • "300x250": medium rectangle
  • "468x60": full banner
  • "728x90": leaderboard

BannerPosition supports Top, Bottom, TopLeft, TopRight, BottomLeft, BottomRight, and Center.

EzoicBannerAd raises these events, all delivered on the Unity main thread:

  • OnLoaded
  • OnLoadFailed(string error)
  • OnClicked
  • OnImpression
  • OnSizeChanged(int width, int height)

Add a Rewarded Ad

Rewarded ads are full-screen ads that grant an in-app reward when the user finishes watching. Load one imperatively ahead of time (for example, at the start of a level), subscribe to its events, then present it at a natural break. The static Load hands you a ready instance through its onLoaded callback.

using Ezoic.Ads;

EzoicRewardedAd.Load(
    adUnitId: 34567,
    onLoaded: ad =>
    {
        ad.OnUserEarnedReward += (type, amount) =>
            Debug.Log($"Reward earned: {amount} {type}");
        ad.OnShown        += () => Debug.Log("Rewarded shown");
        ad.OnDismissed    += () => Debug.Log("Rewarded dismissed");
        ad.OnFailedToShow += error => Debug.LogWarning("Show failed: " + error);
        ad.OnImpression   += () => Debug.Log("Rewarded impression");
        ad.OnClicked      += () => Debug.Log("Rewarded clicked");

        if (ad.IsLoaded)
        {
            ad.Show();
        }
        // when finished with it: ad.Destroy();
    },
    onFailed: error => Debug.LogWarning("Rewarded load failed: " + error));

Replace 34567 with your Ezoic ad unit id. The reward type and amount come from the reward configured on the Google Ad Manager rewarded ad unit. Load and Show() are separate steps; guard Show() behind IsLoaded. Load a new EzoicRewardedAd for each reward opportunity, and call Destroy() when you are done with an instance.

Add an Interstitial Ad

Interstitial ads are full-screen ads shown at natural transition points (for example, between levels or screens). They grant no reward. Like rewarded ads, load one ahead of time and present it at a break.

using Ezoic.Ads;

EzoicInterstitialAd.Load(
    adUnitId: 23456,
    onLoaded: ad =>
    {
        ad.OnShown        += () => Debug.Log("Interstitial shown");
        ad.OnDismissed    += () => Debug.Log("Interstitial dismissed");
        ad.OnFailedToShow += error => Debug.LogWarning("Show failed: " + error);
        ad.OnImpression   += () => Debug.Log("Interstitial impression");
        ad.OnClicked      += () => Debug.Log("Interstitial clicked");

        if (ad.IsLoaded)
        {
            ad.Show();
        }
        // when finished with it: ad.Destroy();
    },
    onFailed: error => Debug.LogWarning("Interstitial load failed: " + error));

Replace 23456 with your Ezoic ad unit id. Load and Show() are separate steps; guard Show() behind IsLoaded. Load a new EzoicInterstitialAd for each opportunity, and call Destroy() when you are done with an instance.

From Unity SDK 1.22.3, the SDK closes an interstitial that Google renders once it has been on screen for about 20 seconds without being dismissed, and OnDismissed fires as usual. Time the ad spends covered (a store page, a browser, your app in the background) does not count, and rewarded ads are never closed this way.

Try the Sample

The package ships a Basic Integration sample: a single MonoBehaviour with an on-screen control panel that initializes the SDK and loads, shows, hides, and destroys every ad type while logging each ad event.

To import it, open Window → Package Manager, select Ezoic Ads in the package list, open the Samples tab, and click Import next to Basic Integration. Then attach the imported EzoicAdsDemo script to a GameObject in an empty scene, set your domain and ad unit ids in the Inspector, and build to a device.

Example Project

For a complete, ready-to-open project, see the Ezoic Unity SDK example on GitHub. It is a minimal Unity project that installs this SDK through the UPM git URL and shows how to test your ad code without a device:

  • Assets/App/AdsBootstrap.cs: an app-style integration that initializes the SDK, then loads a banner, an interstitial, and a rewarded ad, recording every outcome.
  • Assets/Tests/EditMode/: tests for the synchronous API surface (nothing throws, IsInitialized and Version defaults are correct).
  • Assets/Tests/PlayMode/: tests that initialization and load callbacks are always delivered on the Unity main thread, never inline.
  • .github/workflows/ci.yml: runs both test suites headlessly on every push with GameCI.

Open the folder in Unity Hub (Unity 6000.3 LTS; any 2021.3 or newer editor works if you adjust ProjectSettings/ProjectVersion.txt). Unity resolves the SDK from GitHub automatically. Run the tests from Window → General → Test Runner.

The native SDKs include a consent management platform (CMP) that is on by default:

  • GDPR regions: an IAB TCF consent dialog. Ad loads wait for the user's decision and fail without one.
  • Covered US states (from Unity SDK 1.22.0): a privacy notice and a "Do Not Sell My Information" choice. Ads never wait for it. See US-state privacy.
  • Elsewhere, nothing is shown and ads load as usual.

Consent management (CMP) covers the CMP on every platform, including how to use it in a game without Ezoic ads.

So:

  1. Ask for consent once per launch, right after Initialize. You don't need to wait for the init callback. In covered US states the request reports NotRequired, because the SDK shows the US notice by itself.
  2. Add a "Privacy choices" button that calls PresentConsentSettings, and show it unless EzoicAds.IsPrivacyOptionsRequired is false. In GDPR regions it reopens the TCF dialog; TCF policy requires that users can change or withdraw consent at any time. In covered US states it opens the US privacy settings.
EzoicAds.Initialize("example.com", (success, error) => { /* ... */ });

EzoicAds.PresentConsentIfRequired(result =>
{
    // result.Outcome: NotRequired, AlreadyDecided, Decided (see result.Decision),
    // Dismissed (ask again later), AlreadyPresenting, or Failed (see result.Error).
    Debug.Log("Consent: " + result);
});

// "Privacy choices" button handler:
EzoicAds.PresentConsentSettings(result => Debug.Log("Consent settings: " + result));

// Hide the button only when it is known not to apply. The value is null until the
// SDK has loaded your settings, so read it again when the menu with the button opens.
bool showPrivacyButton = EzoicAds.IsPrivacyOptionsRequired != false;

Calling PresentConsentIfRequired again is harmless: it reports AlreadyPresenting while a dialog is open and AlreadyDecided once a valid decision is stored. Call it again after a Dismissed or Failed outcome to re-ask.

PresentConsentSettings depends on where the user is. In a GDPR region it reopens the TCF dialog with the user's stored choices. In a covered US state it opens the US privacy settings and reports Decided with AcceptAll (not opted out) or RejectAll (opted out of sale or sharing), or Dismissed when closed without saving. Elsewhere, or when the built-in CMP is off, it reports NotRequired.

EzoicAds.IsPrivacyOptionsRequired (bool?, Unity SDK 1.22.0 and later) is true in a GDPR region or a covered US state while the built-in CMP is in charge, false otherwise, and null while still unknown. Don't use IsConsentRequired for the button: it answers only whether GDPR applies, so it stays false for US users.

US-state privacy

From Unity SDK 1.22.0, for users in the 15 US states with consumer privacy laws (California, Colorado, Connecticut, Delaware, Florida, Iowa, Montana, Nebraska, New Hampshire, New Jersey, Oregon, Tennessee, Texas, Utah and Virginia), the built-in CMP does what Ezoic's web CMP does. There is nothing to call and no new setting; it runs whenever the built-in CMP is on.

  • Notice: until the user chooses, a native card slides up at the bottom of the screen: "Privacy Preferences", with Consent and Do Not Sell My Information. It never blocks the game or holds back ads. Only a choice dismisses it. Ezoic anchor ads are hidden while it shows. Without a choice, it shows again at the next launch. The notice is in English.
  • Settings: Do Not Sell My Information opens the US privacy settings, where the user can opt out of the sale or sharing of their information. PresentConsentSettings opens the same screen.
  • Signals: the choice is written as the standard IAB GPP (IABGPP_*) values for the user's state. After an opt-out, Google Ad Manager requests ask for restricted data processing.
  • Hands off: the CMP doesn't write GPP values when another CMP already wrote them, or after you call SetGPPConsent.

Using your own CMP

If your app already runs another consent platform (Google UMP, OneTrust, and so on), turn the built-in CMP off. The SDK then reads that platform's IABTCF_* and IABGPP_* values:

EzoicAds.Initialize(new EzoicConfiguration("example.com") { CmpEnabled = false }, (success, error) => { /* ... */ });

From Unity SDK 1.24.0 you can also remove the built-in CMP from your app. Open Edit → Project Settings → Ezoic and turn off Include Ezoic CMP (on by default), and keep CmpEnabled = false. The setting is saved in ProjectSettings/EzoicAdsSettings.json; build scripts can set Ezoic.Ads.Editor.EzoicAdsSettings.IncludeCmp = false before building. With it off:

  • Android: after Unity generates the Gradle project, the package adds configurations.all { exclude group: 'com.ezoic.sdk', module: 'ezoic-cmp-sdk' } to unityLibrary/build.gradle and launcher/build.gradle. ezoic-ads-sdk and ezoic-consent-core stay.
  • iOS: after the External Dependency Manager's iOS Resolver has added the Swift package, the package links the EzoicAdsSDKWithoutCMP product to UnityFramework instead of EzoicAdsSDK. Your code doesn't change. Build with Replace after changing the setting. If you add the Swift package in Xcode yourself, add EzoicAdsSDKWithoutCMP instead of EzoicAdsSDK.

Android and iOS builds stop with an error if the project also has the standalone com.ezoic.cmp-sdk package, which needs the CMP; leave Include Ezoic CMP on in that case. On Android, the External Dependency Manager's Android Resolver must patch mainTemplate.gradle (Custom Main Gradle Template on). If it copies the libraries into Assets/Plugins/Android instead, a Gradle exclude can't remove the copied ezoic-cmp-sdk file, so the build stops with an error that says so. With a Gradle dependency you added yourself (no External Dependency Manager), the exclude applies as well.

Without the CMP the SDK behaves exactly as with CmpEnabled = false: the consent calls report what they would then, and ad loads never wait for a consent decision. If you remove the CMP but leave CmpEnabled at its default true, the native SDK logs a warning at Initialize (with DebugEnabled = true) that the CMP is not included in the app. Initialize also removes the consent keys an Ezoic CMP from an earlier version of your app wrote, but never another CMP's keys or the ones your app wrote; see Android and iOS for exactly which keys.

EzoicAds.IsBuiltInCmpIncluded (bool) is false when the build left the CMP out and true otherwise, whether or not the CMP is enabled. It doesn't need Initialize, and it is false in the editor.

You can also pass consent signals yourself. SetGDPRConsent makes the built-in dialog stand down for the current launch only, so call it before Initialize on every launch, or set CmpEnabled = false. After SetGPPConsent, the built-in CMP leaves the IABGPP_* values to your app and shows no US notice.

EzoicAds.SetGDPRConsent(true, "TCF_CONSENT_STRING");
EzoicAds.SetGPPConsent("DBABBg~BVoAAACA.QA", "8"); // California (section 8), not opted out
EzoicAds.SetSubjectToCOPPA(false);

The native SDKs write the consent you pass to the standard IAB values that Google Mobile Ads and other SDKs read: SetGDPRConsent writes IABTCF_gdprApplies and IABTCF_TCString, and SetGPPConsent writes IABGPP_HDR_GppString and IABGPP_GppSID. The GPP section ID depends on the user's state: 8 is California, and each other state has its own section. Ezoic's CMP writes the section for the user's state, not the national section (7).

EzoicAds.ResetConsent() clears the stored decision and the US choice so the dialog, or the US notice at the next launch, shows again. This is useful for testing.

For platform-specific consent behavior, see the Android privacy section and iOS privacy section.

Pageview Tracking

The native SDKs handle their platform-specific automatic pageview tracking. If your game changes screens, you can also track a pageview manually:

EzoicAds.TrackPageview();

Troubleshooting

Native library unresolved

If the build fails to find the native Ezoic library, confirm the External Dependency Manager for Unity (EDM4U) is installed. It reads the package's dependency manifest and resolves the native Android library and the iOS Swift package for you; without it you must add the Gradle dependency and the Swift package manually.

No ads in the editor

Ads only serve on Android and iOS devices. In the Unity editor (and any other platform) the SDK runs as a safe no-op stub: calls never throw, load callbacks report failure, EzoicAds.IsInitialized is false, and EzoicAds.Version is an empty string. Build to a device to see ads.

iOS: no such module 'EzoicAdsSDK'

From Unity SDK 1.22.0 the iOS SDK installs only as a Swift package. If Xcode reports no such module 'EzoicAdsSDK', turn on Swift Package Manager Integration in the External Dependency Manager's iOS Resolver settings (EDM4U 1.2.187 or higher), or add the ezoic-swift-sdk-dist package in Xcode (see iOS). A Replace build regenerates the Xcode project without a package you added by hand. Also confirm the Google Mobile Ads application ID and the App Tracking Transparency description are present in Info.plist.