Ads
Introduction
Plankton's advertising functionality allows you to effortlessly incorporate ads into your Unity games, facilitating game monetization and improving user engagement. In the latest Plankton release, ads can be displayed through three mediation options:
These mediations let you serve ads to your games from multiple sources, so they will maximize your fill rate and increase your monetization by sending ad requests to multiple networks to ensure you find the best available network to serve ads.
Supported Ad Formats:
- Banner
- Interstitial
- Rewarded
- Rewarded interstitial (AdMob only)
- App open (AdMob and AppLovin MAX)
Before you begin
Prerequisites
- Complete the Plankton setup
- For Android
- Set Minimum API Level to
24or higher.
- Set Minimum API Level to
- For iOS
- Set Target Minimum iOS Version to
15.0or higher
- Set Target Minimum iOS Version to
You can change Minimum and Target versions in Unity from Edit > Project Settings > Player > Other Settings
Set up your mediation account
Create and set up an account for each ad mediation you want to use.
AdMob
Set up your game in your AdMob account and create your desired ad units. After finishing the setup, you will have a unique AdMob App ID that is needed later in this guide.
AppLovin MAX
Set up your game in your AppLovin account and create your desired ad units. After finishing the setup, you will have a unique AppLovin SDK Key that is needed later in this guide.
Unity LevelPlay
Set up your game in your ironSource account and create your desired ad units. After finishing the setup, you will have a unique LevelPlay App Key that is needed later in this guide.
You can use different mediations together in your game. For example you can show interstitial ads from AdMob, but show rewarded ads from AppLovin MAX and banner ads from LevelPlay.
Be aware that this multi-mediation feature is only applicable for different ad types, so it's not possible to use two mediations for the same ad type.
Configure Plankton settings
- Open plankton settings by going to
Edit > Project Settings > Plankton. - Select the checkbox of your ad mediation. Below each mediation, there are several ad networks and a field for your game's ID in that platform.
- Fill the corresponding
Keyfield for each mediation. - Select ad networks that you have enabled in your mediation account. See available ad networks.

Implementation
Now it's time to write a few lines of code. Always import the Plankton package in your scripts.
using Plankton;
Initialize
To get started with ads, create a new Ad.Builder and configure the ad formats you plan to use.
This setup allows you to assign different ad providers and unit IDs per format.
Each Set... method takes two arguments:
- The mediation network as
Ad.Provider(e.g., Ad.Provider.Admob) - The ad unit ID as a string (provided by your ad mediation network)
Call initialization once per session. Complete consent handling before initializing ads; see UMP and, on iOS, ATT.
Finally, call Ad.Initialize(builder, callback) and provide the builder and a callback that will be invoked once all ad networks are initialized and ready.
Important: Wait for initialization before displaying ads. Initialization completion does not mean an ad is loaded; check the format's IsLoaded property before showing it.
var bannerProvider = Ad.Provider.Admob; // or Ad.Provider.AppLovin or Ad.Provider.LevelPlay
var bannerUnitId = "<YOUR_BANNER_UNIT_ID>";
var interstitialProvider = Ad.Provider.Admob;
var interstitialUnitId = "<YOUR_INTERSTITIAL_UNIT_ID>";
var rewardedProvider = Ad.Provider.Admob;
var rewardedUnitId = "<YOUR_REWARDED_UNIT_ID>";
var rewardedInterstitialProvider = Ad.Provider.Admob;
var rewardedInterstitialUnitId = "<YOUR_REWARDED_INTERSTITIAL_UNIT_ID>";
var appOpenProvider = Ad.Provider.Admob;
var appOpenUnitId = "<YOUR_APP_OPEN_UNIT_ID>";
var builder = new Ad.Builder()
.SetBanner(bannerProvider, bannerUnitId)
.SetInterstitial(interstitialProvider, interstitialUnitId)
.SetRewarded(rewardedProvider, rewardedUnitId)
.SetRewardedInterstitial(rewardedInterstitialProvider, rewardedInterstitialUnitId)
.SetAppOpen(appOpenProvider, appOpenUnitId);
Ad.Initialize(builder, () => Debug.Log("Ads initialized."));
After calling initialize, Plankton will take care of the loading and preparation of ads, so you don't have to. Just show ads whenever you want. Plankton takes care of the technical details behind the scenes.
Banner Ads
Banner ads are rectangular ads that occupy a small portion of an app's layout and are fixed at either the top or bottom of the screen. They stay on screen while users are interacting with the app and refresh automatically after a certain period of time.
To show a banner at the bottom of the screen:
Ad.Banner.ShowAtBottom();
To show a banner at the top of the screen:
Ad.Banner.ShowAtTop();
To hide the currently displayed banner:
Ad.Banner.Hide();
That's all it takes!
Only one banner ad can be displayed at a time.
For example, if a banner is displayed at the bottom and you call ShowAtTop, the banner at the bottom will be hidden, and a new banner will be displayed at the top.
Adaptive Banner
By default, Plankton uses adaptive banner sizing, which adjusts the banner's height and takes the full width of the screen.
If you'd prefer to show a standard-sized banner, you can disable this behavior by setting the adaptive flag to false in the SetBanner method during initialization.
builder.SetBanner(bannerProvider, "<YOUR_BANNER_UNIT_ID>", adaptive: false);
Interstitial Ads
Interstitial ads are full-screen ads typically displayed at natural transition points or breaks in the game's flow. Users can either interact with the ad or close it to return to the game.
Here's a sample code that shows how to display an interstitial ad:
Ad.Interstitial.Show(
(displayed) => Debug.Log($"Interstitial Ad result - displayed: {displayed}"),
"AD_PLACEMENT"
);
This method takes two arguments:
-
Callback: A method invoked after the ad is closed or if it fails to show. The
displayedparameter (boolean) indicates whether the ad was successfully displayed or not. -
Placement(optional): A short string that specifies where the ad is being displayed (e.g. "end_of_level").
A placement is a short string specifying the location of the ad being displayed. Placements are usually used for data analysis or user attribution purposes.
Common interstitial ad placements include:
- When a player reaches the end of a level: for example
end_of_level
Common rewarded ad placements include:
- When a player watches an ad to get free coins: for example
free_coins - When a player watches an ad to unlock a bonus item: for example
unlock_bonus
Interstitial ads should be displayed during natural pauses in the flow of an app. Between levels of a game is a good example, or after the user completes a task.
Rewarded Ads
Rewarded ads are full-screen ads that allow you to reward users with in-app items, such as virtual currency or bonus items, for interacting with video ads, playable ads, and surveys.
Here's how you can display a rewarded ad:
Ad.Rewarded.Show(
(displayed, rewardEarned) => Debug.Log($"Rewarded Ad result - displayed: {displayed}, reward earned: {rewardEarned}"),
"AD_PLACEMENT"
);
This method takes two arguments:
-
Callback: A method invoked after the ad is shown or if it fails to show. The callback receives two boolean parameters:
displayed: Indicates whether the ad was successfully displayed or not.rewarded: Indicates whether the user earned the reward or not.
-
Placement(optional): A short string specifying where the ad is displayed (e.g. "free_coins" or "unlock_bonus").
Rewarded Interstitial Ads
Rewarded interstitial is a type of incentivized ad format that lets you offer rewards for ads that appear automatically during natural app transitions. Unlike rewarded ads, users aren't required to opt in to view a rewarded interstitial. Learn more about it.
Here's how you can display a rewarded interstitial ad:
Ad.RewardedInterstitial.Show(
(displayed, rewardEarned) => Debug.Log($"RewardedInterstitial Ad result - displayed: {displayed}, reward earned: {rewardEarned}"),
"AD_PLACEMENT"
);
This method takes two arguments:
-
Callback: A method invoked after the ad is shown or if it fails to show. The callback receives two boolean parameters:
displayed: Indicates whether the ad was successfully displayed or not.rewarded: Indicates whether the user earned the reward or not.
-
Placement(optional): A short string specifying where the ad is displayed (e.g. "revive_character" or "unlock_special_item").
Rewarded interstitial ad type is exclusive to AdMob mediation.
App Open Ads
App open ads are supported by AdMob and AppLovin MAX. LevelPlay is not supported for this format.
App open ads are a special ad format intended for publishers wishing to monetize their app load screens. App open ads can be closed at any time, and are designed to be shown when your users bring your app to the foreground.
You can show App Open ads whenever the app returns to the foreground.
The most common way to do this is by handling OnApplicationPause in a MonoBehaviour.
You can also use other ways such as AppStateEventNotifier to detect when the app returns to the foreground.:
class ExampleAdManager : MonoBehaviour
{
void OnApplicationPause(bool pauseStatus)
{
if (!pauseStatus) // App is returning to foreground
{
if (Ad.AppOpen.IsLoaded) // Check if the ad is loaded before showing
Ad.AppOpen.Show(
(displayed) => Debug.Log($"AppOpen Ad result - displayed: {displayed}"),
"AD_PLACEMENT"
);
else
Debug.Log("AppOpen ad is not loaded yet!");
}
}
}
This method takes two arguments:
-
Callback: A method invoked after the ad is closed or if it fails to show. The
displayedparameter (boolean) indicates whether the ad was successfully displayed or not. -
Placement(optional): A short string that specifies where the ad is being displayed (e.g. "end_of_level").
The documentation thus far assumes that you only show app open ads when users foreground your game when it is suspended in memory. "Cold starts" occur when your game is launched but was not previously suspended in memory.
An example of a cold start is when a user opens your game for the first time. With cold starts, you won't have a previously loaded app open ad that's ready to be shown right away. The delay between when you initialize Plankton Ads module and an ad gets loaded can create a situation where users are able to briefly use your game before being surprised by an out of context ad. This should be avoided because it is a bad user experience.
The preferred way to use app open ads on cold starts is to use a loading screen to load your game and assets, and to only show the ad from the loading screen. If your game has completed loading and has sent the user to the main content of your game, do not show the ad.
App open ads help you monetize your app's loading screen when the app first launches and during app switches, but it's important to keep the following best practices in mind so that your users enjoy using your app.
- Show your first app open ad after your users have used your app a few times.
- Show app open ads during times when your users would otherwise be waiting for your app to load.
- If you have a loading screen under the app open ad and your loading screen completes loading before the ad is dismissed, dismiss your loading screen in the
onResultcallback of theAppOpen.Show()method.
Check if an ad is ready to show
To ensure the ad is loaded before showing it, you can call Ad.IsLoaded.
bool isInterstitialLoaded = Ad.Interstitial.IsLoaded;
bool isRewardedLoaded = Ad.Rewarded.IsLoaded;
bool isRewardedInterstitialLoaded = Ad.RewardedInterstitial.IsLoaded;
bool isAppOpenLoaded = Ad.AppOpen.IsLoaded;
Plankton loads and prepares ads automatically. Before attempting to display the ad, it's best to check if the ad is loaded as the loading process can take a few seconds.
Listen for Callbacks
You can listen for all ad-related actions by subscribing to the Ad.OnAdAction event.
This is useful if you want to track ad lifecycle events (such as loading, showing, clicking, closing) or trigger custom logic when certain actions occur.
Here's an example usage:
using Plankton;
void Start()
{
// Subscribe to ad actions
Ad.OnAdAction += OnAdActionReceived;
}
void OnDestroy()
{
// Unsubscribe to avoid memory leaks
Ad.OnAdAction -= OnAdActionReceived;
}
private void OnAdActionReceived(Ad.AdActionResult result)
{
Debug.Log($"Ad Action: {result.action}, Type: {result.type}, Placement: {result.placement}, Provider: {result.provider}");
if (result.type == "rewarded" && result.action == "loaded")
{
// Example: Prepare for showing ad
}
}
The result parameter is an instance of Ad.AdActionResult, which contains details about the ad type, action, placement, and provider involved.
actionrequested, loaded, loadFailed, showed, showFailed, clicked, closed, rewardReceived
You can automatically report these ad actions as ad events to GameAnalytics with a single method call. Learn how to enable automatic ad event tracking.
[Optional] SSV Callbacks for rewarded ads
Server-Side Verification (SSV) callbacks provide an additional security layer for rewarded ad flows by allowing you to validate completions on your own server. When a rewarded ad finishes, the ad network sends a secure request to your server containing reward details and any custom data you have passed from the client.
Plankton supports setting custom data for SSV callbacks for both AdMob and ironSource LevelPlay rewarded ads. This data is sent alongside the ad completion details and can be used to securely identify the player, session, or any other relevant context.
Visit the official documentation for AdMob SSV and LevelPlay S2S to learn how to set up Server-to-Server callbacks in your game.
AdMob
For AdMob rewarded and rewarded-interstitial ads, you can pass custom data per ad request by using the optional adMobSsvCustomData parameter in Rewarded.Show() and RewardedInterstitial.Show().
The value will be included as custom_data in the SSV callback URL received by your server.
Ad.Rewarded.Show(
(displayed, rewarded) => Debug.Log($"Rewarded result displayed:{displayed} rewarded:{rewarded}"),
adMobSsvCustomData: "player123_session456" // This will appear in the SSV callback
);
LevelPlay
For LevelPlay rewarded ads, you can set a map of key-value string parameters as custom SSV data using Ad.Rewarded.SetLevelPlayServerParameters().
Unlike AdMob, these parameters are not passed per show request — they remain in effect until changed or cleared.
You can also call the method again within the same session and choose to clear previously set parameters by toggling the clearPreviousParams argument.
var ssvParams = new Dictionary<string, string> {
{ "playerId", "player123" },
{ "sessionId", "session456" }
};
Ad.Rewarded.SetLevelPlayServerParameters(ssvParams, clearPreviousParams: true);
Test and debug
Each of these mediations provide their own debugging tools which can be used at runtime to test and debug the advertisement feature.
Admob Ad Inspector
AdMob's Ad Inspector is an in-app overlay that enables authorized devices to perform real-time analysis of test ad requests directly within a mobile app.
Enable Test Device
Before displaying Ad Inspector, you must first set your device as a test device. You can do this in two ways:
-
Add a Test Device via AdMob Dashboard
You can manually add your test device in the AdMob dashboard by entering your device's Ad ID (Android) or IDFA (iOS). Learn more about how to do this.
-
Register a Test Device Programmatically
If you prefer to set up a test device within your app, follow these steps:
- Implement Ads with AdMob, run your game, and initialize the Ads module.
- Check the runtime logs for a message showing your test device ID, then copy your test device ID to your clipboard.
- Android Log:
I/Ads: Use RequestConfiguration.Builder.setTestDeviceIds(Arrays.asList("<YOUR_TEST_DEVICE_ID>")) to get test ads on this device.- iOS Log:
<Google> To get test ads on this device, set:GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"<YOUR_TEST_DEVICE_ID>" ]; - Modify your code to call the following method before initializing Ads:
var builder = new Ad.Builder()
.SetInterstitial(Ad.Provider.Admob, "<YOUR_INTERSTITIAL_UNIT_ID>")
.SetAdmobTestDeviceIds("<YOUR_TEST_DEVICE_ID>");
Ad.Initialize(builder, () => Debug.Log("Ads initialized."));- Re-run your app. If the ad is a Google ad, you'll see a Test mode label centered at the top of the ad (banner, interstitial, or rewarded ad).
Android emulators and iOS simulators are automatically configured as test devices.
You can pass multiple test device IDs to Ad.Builder.SetAdmobTestDeviceIds as a single string, separating them with a comma.
Open Ad Inspector
Once your test device is set up, you can display the Ad Inspector in your game with the following call:
Ad.OpenAdMobDebugger();
For more details, check out AdMob's official Ad Inspector guide.
AppLovin Mediation Debugger
AppLovin's Mediation Debugger is a suite of testing tools that help you integrate and launch faster with MAX. You can use them to confirm the validity of network integrations. This ensures that you can successfully load and show ads, among other things.
Ad.OpenAppLovinMaxDebugger();
LevelPlay Test Suite
The LevelPlay integration test suite enables you to quickly and easily test your app's integration, verify platform setup, and review ads related to your configured networks.
To display it in your game, call the following method:
Ad.OpenLevelPlayDebugger();
Available Ad networks
AdMob mediation
-
Android
- AppLovin
- Chartboost
- DT Exchange (Fyber)
- ironSource
- Liftoff (Vungle)
- Meta (Facebook)
- Mintegral
- Pangle
- Premium Ads
- Unity Ads
-
iOS
- AppLovin
- ironSource
- Liftoff (Vungle)
- Meta (Facebook)
- Mintegral
- Pangle
- Premium Ads
- Unity Ads
AppLovin MAX mediation
-
Android
- AdMob
- Google Ad Manager
- DT Exchange (Fyber)
- ironSource
- Liftoff (Vungle)
- Meta (Facebook)
- Mintegral
- Pangle
- Premium Ads
- Unity Ads
-
iOS
- AdMob
- Google Ad Manager
- ironSource
- Liftoff (Vungle)
- Meta (Facebook)
- Mintegral
- Pangle
- Premium Ads
- Unity Ads
LevelPlay mediation
-
Android
- AdMob
- AppLovin
- Chartboost
- DT Exchange (Fyber)
- Liftoff (Vungle)
- Meta (Facebook)
- Mintegral
- Pangle
- Unity Ads
-
iOS
- AdMob
- AppLovin
- Chartboost
- DT Exchange (Fyber)
- Liftoff (Vungle)
- Meta (Facebook)
- Mintegral
- Pangle
- Unity Ads
If you need other ad networks that are missing in our list, please let us know at our Discord server or via Email.
Impression-Level Revenue Data (ILRD)
What is ILRD?
Impression-Level Revenue Data (ILRD) refers to granular revenue data associated with individual ad impressions. This data provides detailed insights into how much revenue each ad impression generates.
Use Case and Benefits:
- Accurate Revenue Tracking: Gain visibility into your revenue streams on a per-impression basis.
- Enhanced Analytics: Understand the performance of different ad placements, networks, and formats.
- Attribution: Share ILRD with analytics and attribution providers like AppsFlyer or Tenjin for advanced reporting and user-level attribution.
If you use AppsFlyer or Tenjin through Plankton, ILRD data is automatically sent to these platforms. You don’t need to do any extra work.
For GameAnalytics, you can subscribe to ILRD data so that Plankton will automatically forward this information to GameAnalytics.
Listening to ILRD Data
Plankton exposes ILRD from AdMob, AppLovin MAX and LevelPlay. AdMob revenue is in micros of currencyCode (divide by 1,000,000 for currency units); MAX and LevelPlay revenue is a decimal amount in USD. Keep these units distinct when forwarding or comparing values.
AdMob
You can subscribe to AdMob ILRD by adding a delegate to OnAdMobImpressionRevenue event.
The result parameter is an object of the class AdMobImpressionRevenue.
Ad.OnAdMobImpressionRevenue += result =>
{
if (result != null)
{
Debug.Log($"OnAdMobImpressionRevenue: adType={result.adType}, networkName={result.networkName}, adUnitId={result.adUnitId}, currencyCode={result.currencyCode}, precision={result.precision}, revenue={result.revenue}, adMobSdkVersion={result.adMobSdkVersion}, responseId={result.responseId}");
}
};
AppLovin MAX
You can subscribe to AppLovin MAX ILRD by adding a delegate to OnAppLovinMaxImpressionRevenue event.
The result parameter is an object of the class AppLovinMaxImpressionRevenue.
Ad.OnAppLovinMaxImpressionRevenue += result =>
{
if (result != null)
{
Debug.Log($"OnAppLovinMaxImpressionRevenue: adType={result.adType}, networkName={result.networkName}, adUnitId={result.adUnitId}, country={result.country}, precision={result.precision}, creativeId={result.creativeId}, revenue={result.revenue}, appLovinSdkVersion={result.appLovinSdkVersion}, placement={result.placement}");
}
};
LevelPlay
You can subscribe to LevelPlay ILRD by adding a delegate to OnLevelPlayImpressionRevenue event.
The result parameter is an object of the class LevelPlayImpressionRevenue.
Ad.OnLevelPlayImpressionRevenue += result =>
{
if (result != null)
{
Debug.Log($"OnLevelPlayImpressionRevenue: adType={result.adType}, networkName={result.networkName}, adUnitId={result.adUnitId}, country={result.country}, precision={result.precision}, creativeId={result.creativeId}, revenue={result.revenue}, ironSourceSdkVersion={result.ironSourceSdkVersion}, placement={result.placement}");
}
};
API References
Defined Types
In this section, we will discuss the enumerated types, variables, and classes associated with this feature:
Enums
Ad.Provider
| Values | Description |
|---|---|
| Admob | You can use Admob mediation as an ad mediation SDK in your game. |
| AppLovin | You can use AppLovin Max as an ad mediation SDK in your game. |
| LevelPlay | You can use LevelPlay as an ad mediation SDK in your game. |
AdMobImpressionPrecision : int
| Values | Description |
|---|---|
| Undefined = 0 | When there are no sources of data available for AdMob to calculate a revenue value. |
| Estimated = 1 | An ad value estimated from aggregated data |
| PublisherProvided = 2 | The manual CPM you entered for your waterfall ad source instance in a mediation group. |
| Exact = 3 | The precise value paid for the ad. This is only available for the AdMob Network and your bidding ad sources. If AdMob cannot provide a precise value for the bidding ad source, the precision will be estimated. |
Classes
AdActionResult
| Field Name | Field Type | Default Value | Field Description |
|---|---|---|---|
| type | string | string.Empty | The type of ad the event is related to. Possible values: banner, interstitial, rewarded, rewarded_interstitial, app_open. |
| action | string | string.Empty | The action that occurred for this ad. Possible values: requested, loaded, loadFailed, showed, showFailed, clicked, closed, rewardReceived. |
| provider | string | string.Empty | The ad provider used for this event. Possible values: admob, applovin, levelplay. |
| placement | string | string.Empty | The placement string passed when showing the ad, if any (e.g., "end_of_level", "free_coins"). |
Ad.AdMobImpressionRevenue
| Field Name | Field Type | Default Value | Field Description |
|---|---|---|---|
| adUnitId | string | string.Empty | The unique identifier for the ad |
| adType | string | string.Empty | The type of ad (e.g. banner, interstitial, rewarded) |
| currencyCode | string | string.Empty | The currency in which the revenue is reported (e.g. "USD") |
| networkName | string | string.Empty | The name of the ad network that served the ad. |
| revenue | long | 0 | Revenue in micros of currencyCode; divide by 1,000,000 for currency units |
| responseId | string | string.Empty | AdMob's response ID. |
| adMobSdkVersion | string | string.Empty | The version of the AdMob SDK |
| precision | AdMobImpressionPrecision | .Undefined | The level of precision in the revenue value |
Ad.AppLovinMaxImpressionRevenue
| Field Name | Field Type | Default Value | Field Description |
|---|---|---|---|
| adUnitId | string | string.Empty | ID of the MAX Ad Unit from which the revenue was generated. |
| adType | string | string.Empty | The type of ad (e.g. BANNER, INTER, REWARD) |
| country | string | string.Empty | The two-letter country code of the impression |
| placement | string | string.Empty | The Ad Placement Name where the user generated impressions and revenue. |
| networkName | string | string.Empty | The Ad Network that generated the impression. |
| revenue | double | 0 | The revenue generated by the user, in USD, expressed with six-decimal precision. |
| creativeId | string | string.Empty | The unique identifier of the creative. |
| appLovinSdkVersion | string | string.Empty | The version of the AppLovin SDK |
| precision | string | string.Empty | The level of precision in the revenue value |
Ad.LevelPlayImpressionRevenue
| Field Name | Field Type | Default Value | Field Description |
|---|---|---|---|
| adUnitId | string | string.Empty | The unique identifier for the ad |
| adType | string | string.Empty | The type of ad (e.g. banner, interstitial, rewarded_video) |
| country | string | string.Empty | The two-letter country code of the impression |
| placement | string | string.Empty | The Ad placement name where the user generated impressions and revenue. |
| networkName | string | string.Empty | The ad network name that served the ad |
| revenue | double | 0 | The revenue generated for the impression (USD). The revenue value is either estimated or exact, according to the precision |
| precision | string | string.Empty | The level of precision in the revenue value |
| creativeId | string | string.Empty | The creative ID of the ad campaign. The default is an empty string. |
| allData | string | string.Empty | A json string containing all of the information about the ad impression (including all of the fields of this class) |
| ironSourceSdkVersion | string | string.Empty | The version of the ironSource SDK |
Properties and Delegates
Properties
| Name | Type | Default Value | Description |
|---|---|---|---|
| IsOnline | bool | true | Use this to check if the user is online. |
Delegates
| Name | Type | Default Value | Description |
|---|---|---|---|
| OnAdAction | Action<Ad.AdActionResult> | null | Reports ad lifecycle actions; action is a string. |
| OnAdMobImpressionRevenue | Action<AdMobImpressionRevenue> | null | Set revenue listener (ILRD) for AdMob |
| OnAppLovinMaxImpressionRevenue | Action<AppLovinMaxImpressionRevenue> | null | Set revenue listener (ILRD) for AppLovin MAX |
| OnLevelPlayImpressionRevenue | Action<LevelPlayImpressionRevenue> | null | Set revenue listener (ILRD) for LevelPlay |
Methods Summaries
| Method | Arguments | Return Type | Description |
|---|---|---|---|
| Initialize | Ad.Builder builder, Action callback | void | You have to initialize “Ad” before trying to show ads. Call this function before any attempt to request ads. The callback will be invoked once the feature is initialized. |
| Banner.ShowAtBottom | string placement = "bottom" | void | Display a banner ad at the bottom of the screen. |
| Banner.ShowAtTop | string placement = "top" | void | Display a banner ad at the top of the screen. |
| Banner.Hide | (no arguments) | void | Hide the currently displaying banner ad. |
| Interstitial.IsLoaded | (no arguments) | bool | This method checks if an interstitial ad is loaded and can be shown. |
| Interstitial.Show | Action<bool> onResult = null, string placement = "interstitial" | void | Displays an interstitial ad and accepts a callback to determine whether the ad was successfully displayed. The callback is invoked after the ad is shown or fails to show, with a boolean displayed indicating if the ad was shown. The placement parameter is a string specifying the placement of the ad. |
| Rewarded.IsLoaded | (no arguments) | bool | This method checks if a rewarded ad is loaded and can be shown. |
| Rewarded.Show | Action<bool, bool> onResult = null, string placement = "rewarded", string adMobSsvCustomData = string.Empty | void | Displays a rewarded ad and accepts a callback to determine whether the ad was displayed and if a reward was granted to the user. The callback is invoked after the ad is shown or fails to show, with a boolean displayed indicating if the ad was shown and a boolean rewardEarned indicating if the reward was granted. The placement parameter is a string specifying the placement of the ad. For AdMob, you can pass adMobSsvCustomData to attach custom data for Server-Side Verification (SSV) callbacks. |
| Ad.Rewarded.SetLevelPlayServerParameters | Dictionary<string, string> parameters, bool clearPreviousParams = false | void | Sets custom Server-Side Verification (SSV) parameters for LevelPlay (ironSource) rewarded ads. Accepts a dictionary of string key-value pairs. These parameters are sent with the SSV request for all subsequent rewarded ad completions until changed or cleared. Use clearPreviousParams to remove existing parameters before applying new ones. |
| RewardedInterstitial.IsLoaded | (property) | bool | Whether an AdMob rewarded interstitial is ready. |
| RewardedInterstitial.Show | Action<bool, bool> onResult = null, string placement = "rewarded interstitial", string adMobSsvCustomData = string.Empty | void | Shows a rewarded interstitial and reports displayed/reward-earned results. |
| AppOpen.IsLoaded | (property) | bool | Whether an app-open ad is ready. |
| AppOpen.Show | Action<bool> onResult = null, string placement = "app_open" | void | Shows an app-open ad and reports whether it displayed. |
| OpenAdMobDebugger | (no arguments) | void | It opens Admob Ad Inspector for debugging Admob. |
| OpenAppLovinMaxDebugger | (no arguments) | void | It opens Applovin Max Mediation Debugger for debugging Applovin Max. |
| OpenLevelPlayDebugger | (no arguments) | void | It opens LevelPlay integration test suite for testing your integration and verifying your platform setup. |
| GetAndroidAdId | (no arguments) | string | Returns the Google Ad ID of the device.(Android Only) |
Builder Methods
| Method | Arguments | Return Type | Description |
|---|---|---|---|
| SetBanner | Provider provider, string zoneId, bool adaptive = true | Ad.Builder | Configures the banner ad provider and unit ID. Optionally accepts a flag to enable or disable adaptive sizing. |
| SetInterstitial | Provider provider, string zoneId | Ad.Builder | Sets the provider and unit ID for interstitial ads. |
| SetRewarded | Provider provider, string zoneId | Ad.Builder | Sets the provider and unit ID for rewarded video ads. |
| SetRewardedInterstitial | Provider provider, string zoneId | Ad.Builder | Sets the provider and unit ID for rewarded interstitial ads. |
| SetAppOpen | Provider provider, string zoneId | Ad.Builder | Sets the provider and unit ID for app open ads. |
| SetAdmobTestDeviceIds | string deviceIds | Ad.Builder | Registers one or more test device IDs to enable test ads from AdMob during development. |