# Unity Ads integration

> Set up Unity Ads as a mediation network in your Flutter application through Unity LevelPlay, covering account creation, app setup, and SDK integration.

> **Important:**
>
> The following documentation discusses products or services (“Third-party Products”) not developed, owned, or operated by Unity.
> This information might be outdated or incomplete and is provided for your convenience.
> Your use of any Third-party Product is subject to its own terms.
> Unity makes no warranties regarding these products and isn't liable for any damages or losses arising from their use, including issues related to content, advertising, or materials from Third-party providers.

This guide gives you step-by-step instructions on how to set Unity Ads live as an ad network on Unity LevelPlay.

For the Unity Ads network, the auto-setup tool is available to use after you complete step 1 below. The auto-setup tool will create an app and bidder placement and retrieve placement details from Unity Ads—so you don’t need to switch between the LevelPlay and Unity Ads platforms. Alternatively, you can complete the whole setup manually.

## Prerequisites

Ensure that you correctly integrate Rewarded ads, Interstitial ads, or Banner ads into your application. Refer to the following platform-specific guides for integration instructions:

**Rewarded ads integration:**

* [Unity](/grow/levelplay/sdk/unity/rewarded-ad-integration-package.md.md)
* [Android](/grow/levelplay/sdk/android/rewarded-ads-integration.md.md)
* [iOS](/grow/levelplay/sdk/ios/rewarded-ads-integration.md.md)
* [Adobe Air](/grow/levelplay/sdk/adobe/rewarded-ads-integration.md.md)
* [Flutter](/grow/levelplay/sdk/flutter/rewarded-ads-integration.md.md)
* [React Native](/grow/levelplay/sdk/react/rewarded-ads-integration.md.md)

**Interstitial integration:**

* [Unity](/grow/levelplay/sdk/unity/interstitial-integration.md.md)
* [Android](/grow/levelplay/sdk/android/interstitial-integration.md.md)
* [iOS](/grow/levelplay/sdk/ios/interstitial-integration.md.md)
* [Adobe Air](/grow/levelplay/sdk/adobe/interstitial-integration.md.md)
* [Flutter](/grow/levelplay/sdk/flutter/interstitial-integration.md.md)
* [React Native](/grow/levelplay/sdk/react/interstitial-integration.md.md)

**Banner integration:**

* [Unity](/grow/levelplay/sdk/unity/banner-integration.md.md)
* [Android](/grow/levelplay/sdk/android/banner-integration.md.md)
* [iOS](/grow/levelplay/sdk/ios/banner-integration.md.md)
* [Adobe Air](/grow/levelplay/sdk/adobe/banner-integration.md.md)
* [Flutter](/grow/levelplay/sdk/flutter/banner-integration.md.md)
* [React Native](/grow/levelplay/sdk/react/banner-integration.md.md)

## Step 1. Set up Unity Ads

Complete the following steps before setting up Unity Ads:

1. [Create a Unity ID](/cloud/accounts/create-account.md.md)
2. [Sign up for Unity](https://cloud.unity.com)

> **Note:**
>
> After you have completed step 1, you can skip to [step 4](/grow/levelplay/sdk/unity/mediation-network-guides.md.md) and use the auto bidder setup tool to get up and running with Unity Ads bidder on Unity LevelPlay. If you’d rather continue with a manual setup, continue with step 2.

## Step 2. Create a project on Unity Ads

Follow these steps to create your app on Unity Ads:

### Create an app

1. On the [Unity Monetization Dashboard](https://cloud.unity.com/monetization), select **Projects**.

2. Select **Organization,** then **Projects**

3. Select **Create project**

   ![Create project button](/api/media?file=/grow/media/images/Screenshot-2023-04-30-at-5.45.44.png)

4. Enter a project name and [COPPA](https://www.ftc.gov/enforcement/rules/rulemaking-regulatory-reform-proceedings/childrens-online-privacy-protection-rule) designation

5. Select **Create project**

   ![Create project form](/api/media?file=/grow/media/images/Screenshot-2023-04-30-at-5.47.25.png)

To monetize your project, you’ll need to enable Unity Ads in the dashboard. Select **Get started** from the Monetization dashboard > secondary navigation menu.

When you initialize Unity Ads for your project, you must select a mediation provider. Select **I plan to use Mediation**. Then, under **Choose your Mediation Partner,** select **Unity LevelPlay.**
![Choose mediation partner](/api/media?file=/grow/media/images/Screenshot-2023-04-30-at-5.48.59.png)

### Create an ad unit

Use an [Ad Unit](/grow/levelplay/platform/get-started/ad-units.md.md) to surface an event in your game that triggers ad content:

1. From the left navigation menu, select **Monetization > Ad Units**
2. Select **Add Ad Unit** to bring up the creation modal
3. Enter an Ad Unit name, then select a platform (iOS or Android) and [ad format](/grow/levelplay/platform/get-started/ad-units.md.md) (Rewarded ads, Interstitial, or Banner).
4. Select **Create** to save your Ad Unit

### Add a placement

After your project is created, navigate to **Monetization > Placements** and take note of the **Game ID** for both platforms.

![Game ID location](/api/media?file=/grow/media/images/Screenshot-2023-04-30-at-8.42.10.png)

To create a new placement, select **Add Placement**.

> **Note:**
>
> While Unity Ads automatically creates “default” placements when first creating your project, we recommend creating new unique placements for each Unity Ads mediation configuration.

## Step 3. Retrieve your credentials

You’ll need to retrieve the following details from the Unity Ads platform to complete setup on LevelPlay:

* API Key
* Organization core ID
* Key ID
* Secret key

Navigate to **Set up > API Management** and take note of the **API Key**.

![API Key location](/api/media?file=/grow/media/images/Screenshot-2023-04-30-at-8.42.33.png)

Then, navigate to Organization settings and take note of the **Organization core ID**.

![Organization core ID](/api/media?file=/grow/media/images/Screenshot-2023-04-30-at-8.43.02.png)

To retrieve your **Key ID and Secret key** navigate to **Monetization,** then **API Management.** Select **Create LevelPlay Service Account** and a modal will appear with your key ID and secret key. Make sure to save your secret key, as you won’t be able to retrieve it again after you close the modal.
![Create LevelPlay Service Account](/api/media?file=/grow/media/images/Screen-Shot-2023-06-19-at-12.03.32-2.png)

## Step 4. Configure Unity Ads on LevelPlay 

After you have all of these parameters, log in to your LevelPlay account.

* Go to ‘**Mediation**‘ > ‘**Setup**‘ > ‘**SDK Networks**‘.

  ![SDK Networks page](/api/media?file=/grow/media/images/Screenshot-2023-07-11-at-10.01.15-1.png)

* Select Unity Ads from the list of Available Networks

* Input the Unity Ads **API Key** and **Organizational Core ID** in the relevant fields

  ![Unity Ads API Key and Organization ID](/api/media?file=/grow/media/images/Unity-updated-1-1-1.png)

* To activate the auto-setup feature, toggle on the Unity Ads auto-setup tool. This will enable you to automatically create an app and bidder placement on the Unity Ads platform and allow LevelPlay to retrieve placement details from Unity Ads

* After you’ve toggled on the auto-setup tool, enter the key ID and secret key (from step 3). Then, select **Save**
  ![Unity Ads auto-setup configuration](/api/media?file=/grow/media/images/Unity-updated-2-1.png)

> **Note:**
>
> If you toggle the auto-setup tool on, you can still configure Unity Ads bidding manually on LevelPlay.

## Step 5: Set up Unity Ads on the app level

### Traditional waterfall setup 

* Choose the app you want to integrate from the list on the left side of the SDK Networks page
* In the ad unit row, select **Setup** and enter the **Game ID** and **Placement** **ID** under the relevant ad unit settings
  ![Unity Ads waterfall setup](/api/media?file=/grow/media/images/F15F95A0-A7C7-40AF-A955-8C9BE6DB9621.png)
* You will then see Unity Ads as **Active** for Mediation on your Setup Dashboard.

### Bidder setup

There are two ways to set up the Unity Ads bidder on LevelPlay:

1. **Auto-setup** - Automatically create a new app and placements on the Unity Monetize dashboard and populate all the necessary settings on LevelPlay
2. **Manual** - Manually enter the necessary app details on the LevelPlay and Unity Ads platforms

**Auto-setup**

* Select the app where you’d like to run interstitial, rewarded, or banner ads from Unity Ads. Then select the define icon in the Unity Ads row

  ![Unity Ads bidder setup icon](/api/media?file=/grow/media/images/Screenshot-2023-07-11-at-10.20.55.png)

* Select **Add bidder** to automatically create new app and bidding placements on the Unity Ads platform, and import the Game ID and Placement IDs. If there is a Game ID already attached to the app, you will be able to use the auto-setup tool if there is at least 1 placement without the Placement ID parameter value. In this case, a new bidding placement will be created (for the Game ID insert)

  ![Add bidder auto-setup](/api/media?file=/grow/media/images/68A72BE2-91CF-4DA0-8CD4-70FE035A8120-1-1-1.png)

Select **Save** to approve and accept all configurations. If you close the module without saving, the assets will be created on the Unity Ads platform without importing the data onto the LevelPlay platform.

**Important:** The status of Unity Ads bidder instances will be the same as the status of the ironSource Ads bidder, by ad unit. For example, if you’re not using the ironSource Ads bidder for rewarded ads, it will not be automatically activated for the Unity Ads network. To activate the Unity Ads bidding instance for rewarded ads, select the Unity Ads row and toggle on the ad unit. 

**Manual setup**

* Select the app where you’d like to run interstitial or rewarded ads from Unity Ads

* Select Unity Ads from the Setup list of Ad Networks, select the define icon, and insert the Game ID and Placement ID in the relevant fields

* Select **Save**

Now you'll see Unity Ads as active for the ad units of choice in your account.

## Step 6. Add the Unity Ads Adapter to Your Build

Continue your integration using native adapters for [Android](/grow/levelplay/sdk/android/networks/guides/unity-ads.md) and [iOS](/grow/levelplay/sdk/ios/networks/guides/unity-ads.md).

## Step 7. Unity Ads Additional Settings

### User-level COPPA

Unity LevelPlay lets publishers communicate Unity Ads User-level COPPA settings directly to the Unity Ads network. This feature is enabled using LevelPlay SDK 7.1.12+, Unity Ads Android Adapter 4.3.15+.

Use the following syntax, to set Unity Ads user.nonBehavioral flag to true:

```dart
LevelPlay.setMetaData({"UnityAds_coppa": ["true"]});
```

Use the following syntax, to set Unity Ads user.nonBehavioral flag to false:

```dart
LevelPlay.setMetaData({"UnityAds_coppa": ["false"]});
```

You can now deliver Unity Ads ads within your application.

## Next steps

To leverage additional ad networks through LevelPlay Mediation, integrate the [adapters](/grow/levelplay/sdk/unity/mediation-networks.md.md) and follow our integration guides.
