Integrating Chartboost with Mediation

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from Chartboost via mediation. It covers how to add Chartboost to an ad unit's mediation configuration, how to set up Automatic data collection, and how to integrate the Chartboost SDK and adapter into an iOS app.

Supported ad formats and features

The DFP mediation adapter for Chartboost has the following capabilities:

Rewarded Video
Native Ads - Custom Rendering
Smart Banners
Automatic data collection


  • Xcode 6.0 or higher
  • iOS Deployment target of 8.0 or higher
  • Minimum required Google Mobile Ads SDK 7.10.1 or higher

Step 1: Set up Chartboost

Sign up for a Chartboost account and log in once your account is verified. Click the + APP button on the left sidebar. Fill out the form and click save to add your app to Chartboost.

Chartboost add app

Create a new campaign to enable ads for your app. To create a new campaign navigate to Campaigns > Publishing from the left-side menu and click Add a Campaign (or + Add Campaign at the top right corner of your dashboard if you already have other campaigns) and choose Network Publishing when prompted.

Chartboost add campaign

Enter a Name for your publishing campaign, select the Ad Type, select iOS as the Platform and then add your app to the Apps Publishing this Campaign. Click Save to finish adding the campaign.

Chartboost campaign

Select Rewarded Video under APP SETTINGS and add the values for Rewarded Currency Name and Reward per View. Also, uncheck the Pre-Roll and Post-Roll checkboxes under Advanced Settings inorder to avoid showing conflicting reward values.

Chartboost app settings

You will now obtain all the parameters that will be used in setting up the ad unit ID in the next section. In your Chartboost dashboard for your app, navigate to APP SETTINGS > Basic Settings to locate your App ID and App Signature.

Chartboost app settings

DFP requires the Chartboost User ID and User Signature for setting up your DFP ad unit ID. You can find these parameters on your Chartboost dashboard by navigating to Tools > API Explorer. Your User ID and User Signature are located under the Authentication section.

Chartboost api explorer

Step 2: Configure mediation settings for your DFP ad unit

Sign in to your DFP account. Navigate to Delivery > Yield Groups and click the Create Yield Group button.

DFP create yield group button

Enter a Yield Group Name, select your Ad Format, and set the Environment to Mobile App. Under the Targeting section, select the ad unit ID to which you want to add mediation.

DFP create yield group

Next, click the + Add Another Yield Partner button.

If you already have a Yield Partner for Chartboost Ads, you can simply select it. Otherwise, select Create a new Yield Partner.

Select Chartboost as the Yield partner and enter a unique Name. Check the checkbox for Enable automatic data collection of estimated CPM to optimize Mediation to enable ANO, and enter the User ID and User Signature obtained in the previous section. Click Save when done.

Once the Yield partner is chosen, select Mobile SDK mediation as the Integration type and iOS as the Operating system. Enter the App ID and the App Signature obtained in the previous section. Also, enter an Ad Location (e.g. "Game Over Screen") that uniquely identifies this placement in your app.

Chartboost Ad Locations (Named Locations are simple names representing a place in your app where you want to show an ad. DFP sends requests to the location specified in the settings. Once requests are sent, Chartboost will add the location to its dashboard for reporting purposes. If no location value is provided, DFP uses "Default" as the location. It is recommended to avoid using "Default" so that DFP ANO can calculate the Chartboost CPM with enough granularity for optimization purposes.

In the Chartboost dashboard, your Ad Locations can be revealed in the Basic Settings page by clicking on Advanced Settings. Please see the Chartboost's Named Locations guide for more details.

Enter a Default CPM value.

Click Save and Activate at the bottom of the page when done.

Using rewarded video ads

In the settings for your rewarded video ad unit, check the Override reward settings from third-party ad networks when using mediation so that you provide the same reward to the user no matter which ad network is served.

If you don't override the reward, the Chartboost adapter passes back the reward specified in the Chartboost UI.

Step 3: Import the Chartboost SDK and adapter

  • Add the following line to your project's Podfile:

    pod 'GoogleMobileAdsMediationChartboost'

  • From the command line run:

    pod install --repo-update

Manual integration

  • Download the latest version of the Chartboost SDK, and link Chartboost.framework in your project.

  • Download the latest version of the Chartboost adapter and link ChartboostAdapter.framework in your project.

Step 4: Additional code required

Project settings

Set Allow Non-modular Includes in Framework Modules to YES under Build Settings of your target.

Step 5: Test your implementation

Test ads can be enabled for your app from Chartboost's dashboard under the APP SETTINGS > Basic Settings as shown below.

Chartboost test mode

Once test mode is enabled, you can request ads using the ad unit ID created earlier and receive a Chartboost test ad.

That's it! You now have a working mediation integration with Chartboost.

Optional steps

Using interstitial and rewarded video ads

Network-specific parameters

The Chartboost adapter supports additional request parameters which can be passed to the adapter using the GADMChartboostExtras class. This class includes the following properties:

  • framework - Set the framework name if you are using any custom framework in your application (for example, Unity).
  • frameworkVersion - Set the framework version you are using in your application.

Here's a code example of how to set these parameters at ad request:


let adRequest = DFPRequest()
let cbExtras = GADMChartboostExtras()
cbExtras.framework = CBFrameworkOther
cbExtras.frameworkVersion = "1.2.3"


DFPRequest *adRequest = [DFPRequest request];
GADMChartboostExtras *cbExtras = [[GADMChartboostExtras alloc] init];
cbExtras.framework = CBFrameworkOther;
cbExtras.frameworkVersion = @"1.2.3";
[adRequest registerAdNetworkExtras:cbExtras];

Additional resources

Send feedback about...

SDK for DFP Users on iOS
Need help? Visit our support page.