# LevelPlay component reference

> View and edit the properties and events of the LevelPlay components to configure the LevelPlay SDK and banner, interstitial, and rewarded ads.

This page documents the **Inspector** window properties and events. You can add each component from its **GameObject** > **Monetization** menu item, or add it to an existing `GameObject` from **Add Component** > **Monetization**.

For how the components work together, refer to [Introduction to LevelPlay components](/grow/levelplay/sdk/unity/intro-to-levelplay-components.md). For the components' public methods, refer to the [LevelPlay component API reference](/grow/levelplay/sdk/unity/component-api-reference.md).

## LevelPlay components

The following table lists each component, its menu item, and its API reference:

| Component                       | Menu item                                                           | API reference                                                                                                                            |
| ------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **LevelPlay SDK**               | **GameObject** > **Monetization** > **LevelPlay SDK**               | [`LevelPlaySdkBehaviour`](/grow/levelplay/sdk/unity/component-api-reference.md#levelplay-sdk-component-class)                            |
| **Banner Ad (LevelPlay)**       | **GameObject** > **Monetization** > **Banner Ad (LevelPlay)**       | [`LevelPlayBannerAdBehaviour`](/grow/levelplay/sdk/unity/component-api-reference.md#banner-ad-\(levelplay\)-component-class)             |
| **Interstitial Ad (LevelPlay)** | **GameObject** > **Monetization** > **Interstitial Ad (LevelPlay)** | [`LevelPlayInterstitialAdBehaviour`](/grow/levelplay/sdk/unity/component-api-reference.md#interstitial-ad-\(levelplay\)-component-class) |
| **Rewarded Ad (LevelPlay)**     | **GameObject** > **Monetization** > **Rewarded Ad (LevelPlay)**     | [`LevelPlayRewardedAdBehaviour`](/grow/levelplay/sdk/unity/component-api-reference.md#rewarded-ad-\(levelplay\)-component-class)         |

## LevelPlay SDK component properties

The **LevelPlay SDK** component initializes the LevelPlay SDK. Add it once, in the first scene your game loads.

The **LevelPlay SDK** component contains the following properties:

| Property                  | Description                                                                                                                                                                                                                                         |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Android App Key**       | Sets the app key used on Android, from the LevelPlay dashboard. The default is empty.                                                                                                                                                               |
| **iOS App Key**           | Sets the app key used on iOS, from the LevelPlay dashboard. The default is empty.                                                                                                                                                                   |
| **User ID**               | Sets an optional user ID that the component passes to the SDK during initialization. Leave it empty if you don't need one. The default is empty.                                                                                                    |
| **Initialize On Start**   | Initializes the SDK automatically when the component starts. Disable it to call `Initialize()` yourself, for example after you collect user consent. The default is enabled.                                                                        |
| **Persist Across Scenes** | Keeps the LevelPlay SDK `GameObject` loaded when you load other scenes. If a later scene also contains a LevelPlay SDK `GameObject`, the duplicate destroys itself. The default is enabled.                                                         |
| **Pause Game During Ad**  | Pauses Unity while a full-screen ad is displayed. This property is supported only on iOS. On Android, this property has no effect, so pause your game in the ad's **On Ad Displayed** and **On Ad Closed** events instead. The default is disabled. |
| **On Init Success**       | Defines the functions to call when the SDK initializes successfully. Passes `LevelPlayConfiguration`. Invoked on the Unity main thread.                                                                                                             |
| **On Init Failed**        | Defines the functions to call when the SDK fails to initialize. Passes `LevelPlayInitError`. Invoked on the Unity main thread.                                                                                                                      |

## Banner Ad (LevelPlay) component properties

The **Banner Ad (LevelPlay)** component loads and displays a banner ad at a fixed position on the screen.

> **Important:**
>
> The banner reads these properties when it creates the ad, on its first load. To apply changes later, call `DestroyAd()` and then `LoadAd()`.

The **Banner Ad (LevelPlay)** component contains the following properties:

| Property                        | Description                                                                                                                                                                  |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Android Ad Unit ID**          | Sets the banner ad unit ID used on Android. The default is empty.                                                                                                            |
| **iOS Ad Unit ID**              | Sets the banner ad unit ID used on iOS. The default is empty.                                                                                                                |
| **Load On Start**               | Loads the banner automatically after the SDK initializes. The default is enabled.                                                                                            |
| **Display On Load**             | Shows the banner as soon as it loads. Disable it to call `ShowAd()` yourself. The default is enabled.                                                                        |
| **Size**                        | Sets the banner size. The options are **Banner**, **Large**, **Medium Rectangle**, **Leaderboard**, **Adaptive**, and **Custom**. The default is **Banner**.                 |
| **Adaptive Width**              | Sets the width of the banner container. `-1` uses the screen width. The default is `-1`. This property is supported only when **Size** is **Adaptive**.                      |
| **Custom Width**                | Sets the banner width. The default is `320`. This property is supported only when **Size** is **Custom**.                                                                    |
| **Custom Height**               | Sets the banner height. The default is `50`. This property is supported only when **Size** is **Custom**.                                                                    |
| **Position**                    | Sets the banner position: one of the nine screen anchors, which combine top, center, or bottom with left, center, or right, or **Custom**. The default is **Bottom Center**. |
| **Custom Position**             | Sets the offset from the top-left corner of the screen. The default is `(0, 0)`. This property is supported only when **Position** is **Custom**.                            |
| **Placement Name**              | Sets an optional placement name used for reporting and targeting. The default is empty.                                                                                      |
| **Respect Safe Area**           | Keeps the banner inside the device's safe area, away from notches and rounded corners. The default is disabled.                                                              |
| **Bid Floor**                   | Sets an optional price floor in USD. `0` or less leaves the floor unset. The default is `0`.                                                                                 |
| **On Ad Loaded**                | Defines the functions to call when the banner loads. Passes `LevelPlayAdInfo`.                                                                                               |
| **On Ad Load Failed**           | Defines the functions to call when the banner fails to load. Passes `LevelPlayAdError`.                                                                                      |
| **On Ad Displayed**             | Defines the functions to call when the banner becomes visible. Passes `LevelPlayAdInfo`.                                                                                     |
| **On Ad Display Failed**        | Defines the functions to call when the banner fails to display. Passes `LevelPlayAdInfo` and `LevelPlayAdError`.                                                             |
| **On Ad Clicked**               | Defines the functions to call when the player clicks the banner. Passes `LevelPlayAdInfo`.                                                                                   |
| **On Ad Expanded**              | Defines the functions to call when the banner expands to cover the screen. Passes `LevelPlayAdInfo`.                                                                         |
| **On Ad Collapsed**             | Defines the functions to call when the banner returns from its expanded state. Passes `LevelPlayAdInfo`.                                                                     |
| **On Ad Left Application**      | Defines the functions to call when the app goes to the background after the player clicks the banner. Passes `LevelPlayAdInfo`.                                              |
| **On Ad Impression Data Ready** | Defines the functions to call when impression-level revenue data is available for this banner. Passes `LevelPlayImpressionData`. Invoked on the Unity main thread.           |

## Interstitial Ad (LevelPlay) component properties

The **Interstitial Ad (LevelPlay)** component loads and shows a full-screen interstitial ad, for example between levels.

The **Interstitial Ad (LevelPlay)** component contains the following properties:

| Property                        | Description                                                                                                                                        |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Android Ad Unit ID**          | Sets the interstitial ad unit ID used on Android. The default is empty.                                                                            |
| **iOS Ad Unit ID**              | Sets the interstitial ad unit ID used on iOS. The default is empty.                                                                                |
| **Load On Start**               | Loads the ad automatically after the SDK initializes. The default is enabled.                                                                      |
| **Auto Reload**                 | Loads a new ad automatically after the ad closes or fails to display. The default is enabled.                                                      |
| **Placement Name**              | Sets an optional placement used by `ShowAd()` and `IsPlacementCapped()`. The default is empty.                                                     |
| **Bid Floor**                   | Sets an optional price floor in USD. `0` or less leaves the floor unset. The default is `0`.                                                       |
| **On Ad Loaded**                | Defines the functions to call when the ad loads and is ready to show. Passes `LevelPlayAdInfo`.                                                    |
| **On Ad Load Failed**           | Defines the functions to call when the ad fails to load. Passes `LevelPlayAdError`.                                                                |
| **On Ad Displayed**             | Defines the functions to call when the ad opens. Passes `LevelPlayAdInfo`.                                                                         |
| **On Ad Display Failed**        | Defines the functions to call when the ad fails to show. Passes `LevelPlayAdInfo` and `LevelPlayAdError`.                                          |
| **On Ad Clicked**               | Defines the functions to call when the player clicks the ad. Passes `LevelPlayAdInfo`.                                                             |
| **On Ad Closed**                | Defines the functions to call when the player closes the ad. Passes `LevelPlayAdInfo`. Resume your game here.                                      |
| **On Ad Info Changed**          | Defines the functions to call when the ad info of a loaded ad changes. Passes `LevelPlayAdInfo`.                                                   |
| **On Ad Impression Data Ready** | Defines the functions to call when impression-level revenue data is available. Passes `LevelPlayImpressionData`. Invoked on the Unity main thread. |

## Rewarded Ad (LevelPlay) component properties

The **Rewarded Ad (LevelPlay)** component loads and shows a full-screen rewarded ad that grants the player a reward when they finish watching it.

The **Rewarded Ad (LevelPlay)** component contains the same properties and events as the **Interstitial Ad (LevelPlay)** component, plus **On Ad Rewarded**. The following table lists all its properties:

| Property                        | Description                                                                                                                                        |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Android Ad Unit ID**          | Sets the rewarded ad unit ID used on Android. The default is empty.                                                                                |
| **iOS Ad Unit ID**              | Sets the rewarded ad unit ID used on iOS. The default is empty.                                                                                    |
| **Load On Start**               | Loads the ad automatically after the SDK initializes. The default is enabled.                                                                      |
| **Auto Reload**                 | Loads a new ad automatically after the ad closes or fails to display. The default is enabled.                                                      |
| **Placement Name**              | Sets an optional placement used by `ShowAd()` and `IsPlacementCapped()`. The default is empty.                                                     |
| **Bid Floor**                   | Sets an optional price floor in USD. `0` or less leaves the floor unset. The default is `0`.                                                       |
| **On Ad Loaded**                | Defines the functions to call when the ad loads and is ready to show. Passes `LevelPlayAdInfo`.                                                    |
| **On Ad Load Failed**           | Defines the functions to call when the ad fails to load. Passes `LevelPlayAdError`.                                                                |
| **On Ad Displayed**             | Defines the functions to call when the ad opens. Passes `LevelPlayAdInfo`.                                                                         |
| **On Ad Display Failed**        | Defines the functions to call when the ad fails to show. Passes `LevelPlayAdInfo` and `LevelPlayAdError`.                                          |
| **On Ad Clicked**               | Defines the functions to call when the player clicks the ad. Passes `LevelPlayAdInfo`.                                                             |
| **On Ad Closed**                | Defines the functions to call when the player closes the ad. Passes `LevelPlayAdInfo`. Resume your game here. Don't grant the reward here.         |
| **On Ad Info Changed**          | Defines the functions to call when the ad info of a loaded ad changes. Passes `LevelPlayAdInfo`.                                                   |
| **On Ad Impression Data Ready** | Defines the functions to call when impression-level revenue data is available. Passes `LevelPlayImpressionData`. Invoked on the Unity main thread. |
| **On Ad Rewarded**              | Defines the functions to call when the player earns the reward. Passes `LevelPlayAdInfo` and `LevelPlayReward`. Grant the reward here.             |
