Integrate PubMatic with LevelPlay
Learn how to integrate PubMatic with your LevelPlay-enabled Android app
Read time 2 minutesLast updated 6 days ago
Learn how to integrate PubMatic with your LevelPlay-enabled Android app. It walks through account setup, app configuration, ad unit creation, adapter installation, and network activation in LevelPlay. Follow the steps below to ensure your ad placements are correctly configured for PubMatic bidding.
Topic | Description |
|---|---|
| Create a PubMatic account | Set up your PubMatic publisher profile |
| Create an app and ad units | Add your app and configure monetization |
| Activate PubMatic in LevelPlay | Connect PubMatic to your project |
| Add the PubMatic adapter (android) | Add the Android Pubmatic SDK adapter |
| Handle user consent | GDPR and GPP behavior |
Prerequisites
Make sure you can access the PubMatic monetization dashboard and your LevelPlay project in the Unity Dashboard. You must also have an Android app ready to configure.Create a PubMatic account
To create a PubMatic account, reach out to PubMatic at sdk-support@pubmatic.com. The PubMatic team will assist you with account creation and approval for Pubmatic inventory through LevelPlay. Once your account is approved, sign in to the Pubmatic monetization dashboard. If you already created ad units in your Pubmatic monetization dashboard, skip to Activate PubMatic in LevelPlay.Create an app and ad units
Add your Android app and create ad units in the Pubmatic dashboard before you can activate PubMatic in LevelPlay.Add your app
- Log in to the Pubmatic monetization dashboard.
- Select Set Up > Apps.
- Click Add App.
- In the General section:
- Select Android as the platform.
- Enter a valid Google Play URL.
- Review or edit the auto-generated app name.
- In the Configuration section:
- Select your Integration Path.
- Set Sub-Integration Path to "LevelPlay - SDK Bidding".
- Complete any additional fields that appear.
- In the Advanced section:
- Ensure the currency is set to USD.
- Click Add App.
Create ad units
- Select Set Up > Ad Units.
- Select your app. The ad units associated with the app will display.
- Click Create Ad Unit.
- Enter an ad unit ID.
- Select an ad format and complete the required fields.
- Click Save or Save & Create Another.
Manage bidder partners
- Select Set Up > Bidder Partners.
- Select your app.
- Use the toggles to enable or disable ad units for each bidder partner.
Activate PubMatic in your LevelPlay setup
After configuring your app and ad units in PubMatic, activate Pubmatic inside LevelPlay to link your credentials to your placements.- In LevelPlay, open Monetize > Setup > SDK Networks.
- Select Pubmatic from the list of available networks.
- Enter the required parameters, click Activate, then Save.
- Select Pubmatic again from your configured networks and click Setup.
- Enter the following values from your PubMatic dashboard:
- Publisher ID: found in your PubMatic publisher account
- Profile ID: found on the Apps page
- Ad Unit ID: found in the Ad Units section
- Set the status to Active and click Save.
Add the PubMatic adapter (Android)
To complete the integration, add the PubMatic SDK and the LevelPlay PubMatic adapter to your Android project.Add the PubMatic Maven repository
Add the following repository to the allprojects > repositories block of your project-level build.gradle file:allprojects { repositories { maven { url "https://repo.pubmatic.com/artifactory/public-repos" } }}
Add the adapter dependencies
Add these dependencies to your app module’s build.gradle file (the adapter name will be finalized by the LevelPlay team):dependencies { implementation 'com.unity3d.ads-mediation:pubmatic-adapter:1.0.0' implementation 'com.pubmatic.sdk:openwrap:4.10.+'}
Handle user consent
- Pubmatic SDK retrieves GDPR values using the IAB TCF 2.0 standard through shared preferences or user defaults, ideally via a CMP SDK.
- Pubmatic also supports the IAB GPP standard for retrieving GPP consent signals.
- Refer to the Pubmatic SDK Advanced Topics for information on passing consent values.