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 Ad Manager mediation adapter for Chartboost has the following capabilities:

Formats
Banners
Interstitials
Rewarded Video
Rewarded Video (new APIs)
Native Ads - Custom Rendering
Features
Smart Banners
Automatic data collection

Requirements

  • iOS deployment target of 8.0 or higher
  • Latest Google Mobile Ads SDK

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

Then, in your Chartboost dashboard for your app, navigate to App Settings > Basic Settings to locate your App ID and App Signature.

Chartboost app settings

Ad Manager requires the Chartboost User ID and User Signature for setting up your Ad Manager 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 Ad Manager ad unit

Sign in to your Ad Manager account. Navigate to Delivery > Yield groups and click the New yield group button.

Enter a unique Name for your yield group, set the Status to Active, select your Ad Format, and set the Inventory type to Mobile App. Under the Targeting > Inventory section, select the Ad Unit ID to which you want to add mediation.

Next, click the Add yield partner button.

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

Select Chartboost as the Ad network and enter a unique Name. Enable Mediation and turn on Automatic data collection, and enter the User ID and User Signature obtained in the previous section. You don't need to enter a Username and Password. Click Save when done.

Once the Yield partner is selected, choose Mobile SDK mediation as the Integration type, iOS as the Platform, and Active as the Status. 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 and a Default CPM value.

Chartboost Ad Locations (Named Locations) are simple names representing a place in your app where you want to show an ad. Ad Manager sends requests to the location specified in the settings. Once requests are sent, Chartboost will add the location to its dashboard for reporting 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.

Click Save at the bottom of the page when done.

Using rewarded video ads

In the settings for your rewarded video ad unit, provide values for the reward amount and reward type. Then, to ensure you provide the same reward to the user no matter which ad network is served, check the Override reward settings from third-party ad networks when using mediation box.

If you don't apply this setting, 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 and CHAMoatMobileAppKit.framework in your project.

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

  • Add the following frameworks to your project:

    • StoreKit
    • Foundation
    • CoreGraphics
    • WebKit
    • AVFoundation
    • UIKit

Step 4: Additional code required

Project settings

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

Add value -ObjC in Other Linker Flags under your project’s Build Settings for both Debug and Release.

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.

Step 6: Prepare app for production

After you are able to receive Chartboost test ads, your app will be placed on Chartboost's Publisher App Review. Once your app is approved, you can then create your Publishing Campaign to configure your app for live Chartboost ads.

Navigate to Monetization > Publishing Campaigns 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 Placement Type, and select iOS as the Platform. If your app has been approved by Chartboost, you'll be able to select your app and apply it to this campaign. Fill out the rest of the form and click Save to finish adding the campaign.

Chartboost campaign

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

Optional steps

Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network's use. Google currently is unable to pass the user's consent choice to such networks automatically.

The section below shows you how to enable or disable personalized ads for Chartboost.

In SDK version 8.2.0, Chartboost added the addDataUseConsent method. The following sample code sets data use consent to CHBGDPRConsentNonBehavioral. If you choose to call this method, it is recommended that you do so prior to requesting ads via the Google Mobile Ads SDK.

Swift

let dataUseConsent = CHBDataUseConsent.GDPR(CHBDataUseConsent.GDPR.Consent.nonBehavioral)
Chartboost.addDataUseConsent(dataUseConsent)

Objective-C

CHBGDPRDataUseConsent *dataUseConsent = [CHBGDPRDataUseConsent gdprConsent:CHBGDPRConsentNonBehavioral];
[Chartboost addDataUseConsent:dataUseConsent];

See Chartboost's GDPR article for more details.

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:

Swift

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

Objective-C

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

Additional resources

Chartboost iOS Mediation Adapter Changelog

Version 8.2.1.0

  • Verified compatibility with Chartboost SDK 8.2.1.
  • Now requires Google Mobile Ads SDK version 7.64.0 or higher.
  • Now requires minimum iOS version of 9.0.

Build and tested with

  • Google Mobile Ads SDK version 7.64.0.
  • Chartboost SDK version 8.2.1.

Version 8.2.0.0

  • Verified compatibility with Chartboost SDK 8.2.0.
  • Now requires Google Mobile Ads SDK version 7.61.0 or higher.

Build and tested with

  • Google Mobile Ads SDK version 7.61.0.
  • Chartboost SDK version 8.2.0.

Version 8.1.0.1

  • Updated the minimum required Google Mobile Ads SDK version to 7.60.0.
  • Updated the adapter to use Chartboost's new API and removed deprecated APIs.
  • Adapter now supports loading multiple ads of the same format using the same Chartboost location.
  • If the reward is not overridden in the AdMob or Ad Manager UI, the reward value for rewarded ads is now the value specified in the Chartboost UI instead of 0.

Build and tested with

  • Google Mobile Ads SDK version 7.60.0.
  • Chartboost SDK version 8.1.0.

Version 8.1.0.0

  • Verified compatibility with Chartboost SDK 8.1.0.
  • Updated the minimum required Google Mobile Ads SDK version to 7.59.0.
  • Removed support for the i386 architecture.

Build and tested with

  • Google Mobile Ads SDK version 7.59.0.
  • Chartboost SDK version 8.1.0.

Version 8.0.4.0

  • Verified compatibility with Chartboost SDK 8.0.4.

Build and tested with

  • Google Mobile Ads SDK version 7.52.0.
  • Chartboost SDK version 8.0.4.

Version 8.0.1.1

  • Fixed an issue where requesting banner ads returns no fills.

Version 8.0.1.0

  • Verified compatibility with Chartboost SDK 8.0.1.
  • Added support to request banner ads.

Version 7.5.0.1

  • Added code to correctly initialize the Chartboost SDK.

Version 7.5.0.0

  • Verified compatibility with Chartboost SDK 7.5.0.
  • Updated the adapter to use the new rewarded API.
  • Updated the adapter to handle multiple interstitial requests.
  • Now requires Google Mobile Ads SDK version 7.42.2 or higher.

Version 7.3.0.0

  • Verified compatibility with Chartboost SDK 7.3.0.

Version 7.2.0.1

  • Added adapterDidCompletePlayingRewardBasedVideoAd: callback to the adapter.

Version 7.2.0.0

  • Verified compatibility with Chartboost SDK 7.2.0.

Version 7.1.2.0

  • Verified compatibility with Chartboost SDK 7.1.2.

Version 7.1.1.0

  • Verified compatibility with Chartboost SDK 7.1.1.

Version 7.1.0.0

  • Verified compatibility with Chartboost SDK 7.1.0.

Version 7.0.4.0

  • Verified compatibility with Chartboost SDK 7.0.4.

Version 7.0.3.0

  • Verified compatibility with Chartboost SDK 7.0.3.

Version 7.0.2.0

  • Verified compatibility with Chartboost SDK 7.0.2.
  • Added support for two new Chartboost error codes.

Version 7.0.1.0

  • Verified compatibility with Chartboost SDK 7.0.1.

Version 7.0.0.0

  • Verified compatibility with Chartboost SDK 7.0.0.

Version 6.6.3.0

  • Verified compatibility with Chartboost SDK 6.6.3.
  • Removed the support for 'armv7s' architecture.
  • Fixed a bug where publishers faced a compilation issue in Swift when importing ChartboostAdapter.framework as a module which was importing non-modular Chartboost SDK.

Version 6.6.2.0

  • Verified compatibility with Chartboost SDK 6.6.2.

Version 6.6.1.0

  • Verified compatibility with Chartboost SDK 6.6.1.

Version 6.6.0.0

  • Verified compatibility with Chartboost SDK 6.6.0.

Version 6.5.2.1

  • Enabled bitcode support.
  • Now distributing Chartboost adapter as a framework.
  • To import ChartboostAdapter.framework in your project, make sure to set Allow Non-modular Includes in Framework Modules to YES under Build Settings of your target.

Version 6.5.2.0

  • Changed the version naming system to [Chartboost SDK version].[adapter patch version].
  • Updated the minimum required Chartboost SDK to v6.5.1.
  • Updated the minimum required Google Mobile Ads SDK to v7.10.1.
  • Fixed a bug to support multiple Chartboost ad locations.
  • Apps now get the interstitialWillDismissScreen: callback when the interstitial ad is about to dismiss.
  • Apps now get the rewardBasedVideoAdDidOpen: callback when a reward-based video ad is opened.

Version 1.1.0

  • Removed Chartboost Ad Location from Chartboost extras. Ad Location is now specified in the AdMob console when configuring Chartboost for mediation.

Version 1.0.0

  • Initial release. Supports reward-based video ads and interstitial ads.