Format setup using UI Inspector
Prior to setup, install the Yandex MobileAds SDK package.
Adding formats using UI Inspector
-
Open our GitHub repository and download
Source code.zip. This archive contains thesamplesfolder with four test files of different formats:- App open ads.
- Rewarded ads.
- Adaptive banners.
- Interstitial ads.
-
Move all files to the
Assetsfolder in the Unity project or use the Inspector tab:Add Component/Yandex Ads/[banner type]. After that, you can attach the components to one of the scenes to test how it works:

Adaptive banner
Unique banner settings
- Banner types — Inline, Sticky.
- Position adjustment relative to the screen (
Banner Position). - Width set to screen size (
Use Screen Width).
|
Event |
Event-triggering actions |
|
|
Ad loading completion |
|
|
Ad loading failure |
|
|
The user exits the app after clicking the ad |
|
|
The user returns to the app after clicking the ad |
|
|
The user clicks the ad |
|
|
Ad impression counted |
Interstitial ad
|
Event |
Event-triggering actions |
|
|
Ad loading completion |
|
|
Ad loading failure |
|
|
Ad closing |
|
|
The user clicks the ad |
|
|
Ad impression counted |
|
|
Ad serving |
|
|
Ad serving failure |
Rewarded ad
|
Event |
Event-triggering actions |
|
|
Ad loading completion |
|
|
Ad loading failure |
|
|
Ad closing |
|
|
The user clicks the ad |
|
|
Ad impression counted |
|
|
Ad serving |
|
|
Ad serving failure |
|
|
Ad impression rewarded |
App open ad
Unique banner settings
Show AppOpenAd Once: Serve only once per session.
|
Event |
Event-triggering actions |
|
|
Ad loading completion |
|
|
Ad loading failure |
|
|
Ad closing |
|
|
The user clicks the ad |
|
|
Ad impression counted |
|
|
Ad serving |
|
|
Ad serving failure |
|
|
The app switches to or enters background mode |
Terms
Cold start: Launching the app when it isn't present in RAM, which creates a new app session.
Hot start: Bringing the app from background mode, where it's paused in RAM, into foreground mode.
Features of app open ad integration
- Ads may take a long time to load, so you should avoid increasing the cold start time if the ad hasn't loaded.
- Preload ads for subsequent hot start impressions.
- We don't recommend loading app open ads simultaneously with other ad formats at app startup, as the app may be downloading essential operational data. This may cause excessive load on your device and internet connection, resulting in longer ad load times.
- If the
OnAdFailedToLoadevent returns an error, don't try to load a new ad again. If you really have to, limit the number of ad loading retries — this will help you avoid constant unsuccessful requests and connection issues if there are limitations.
General banner settings
-
Component name: You can use any name, this won't have any impact.
-
Ad Unit Id:-
Development mode to work with demo ad units.
-
Production mode to work with
R-M-XXXXXX-Y(for the actual ID, check the Yandex Advertising Network interface).R-M-XXXXXX-Yis a template for your actual ad unit ID that will be used to receive various creatives.
-
-
Loading and serving settings:
Auto Load: Instant loading upon automatic SDK initialization.Show After Loading: Instant serving after ad loading.
-
Public component methods are the same:
Load(): Manual ad loading.Show(): Manual ad serving.onDestroy(): Ad object removal.
-
Event processing using Unity Inspector: any event can be linked to your custom scripts' methods via Inspector. Click the plus icon, then select an object and the desired method.
-
For all events, you can create public void methods with the necessary signature for parameterized calls.
For example:
public void InterstitialSomeMethod(string message) { Debug.Log("Interstitial show msg: " + message); }