Skip to main content
Version: 5.x.x

Google Mobile Ads

This guide shows you how to integrate our BlueStack mediation adapter of Google Mobile Ads SDK with your current iOS app and set up additional request parameters.

Release notes can be found here

Supported ad formats

  • Banners
  • Interstitials
  • Native Ads
  • Rewarded Video

Requirements

  • Use Xcode 15.1 or higher
  • Target iOS 13.0 or higher

Set up Google Ad Manager

The following steps are needed to add us as a Demand partner in Ad Manager. These changes need to be set up in Google Ad Manager.

Add a new Ad Network

First you need to add us as an Ad Network in Google Ad Manager

  1. Under Admin, go to Companies
  2. Click the New Company button and select Ad Network
  3. For the name, you can use BlueStack, but you are free to enter what you want here
  4. For Ad Network, please select Improve Digital
  5. Don't forget to enable the Medation toggle
  6. Other fields can be ignored
  7. Press Save

New ad network

Add Yield Groups

Next we need to add some yield groups. The basic rule is that for each available format you add one yield group (so one for Banner, one for Interstitial, etc.) If you already have Yield Groups set up you can skip this step.

  1. Under Delivery, go to Yield Groups
  2. Click the New Yield Group button
  3. Insert any name you wish to use
  4. Select the correct Ad Format
  5. Inventory type should be set to Mobile App
  6. For Banner, select at least one size that best fits
  7. Please make sure your app's placements are targetted for this Yield Group New yield group

Add A Yield Partner and Define a custom event

Now you have to add us as a Yield partner in the Yield Group you just created, or on a yield group you already have set before.

  1. Open the Yield Group you want to add us as a partner
  2. Scroll down on the page and click the Add yield partner button
  3. As yield partner, choose the company you added in [Add a new Ad Network]
  4. Select integration type Custom Event
  5. Select Platform iOS
  6. Select Status Active
  7. Default CPM will be provided by your Azerion representative
  8. For Label, use: BlueStackCustomEvent
  9. For Class Name, use: BlueStackGoogleMediationAdapter.BlueStackCustomEvent
  10. As parameter, please enter the placement ID provided by your Azerion representative that matches the format you intend to use this yield group for
  11. Repeat for each Yield group / format

Add yield partner

Set up BlueStack Mediation adapter in Application

SDK Integration

Add BlueStack Core SDK:

Please check the Integration Documentation of the BlueStack Core SDK to add it to your application.

Add BlueStack Google Mediation Adapter:

pod 'BlueStackGoogleMediationAdapter'

Import custom event classes in your source file:

#import <BlueStackGoogleMediationAdapter/BlueStackGoogleMediationAdapter.h>
@import GoogleMobileAds;

Set up Ad Formats

info

You must initialize BlueStack SDK using your APP_ID before loading ads of any formats.

You may now use BlueStack Google Adapter to show ads the same way it's described in the Google Ad Manager Documentation. The adapter code and the setup you did on your Google Ad Manager will allow BlueStack Ads to deliver ads.

Before you can create custom events, you need to integrate the banner ad format into your app.

info

You must pass the ViewController to the GADBannerView

GADBannerView *bannerView;
......................
bannerView.rootViewController = self;

Interstitial

Before you can create custom events, you need to integrate the Interstitial ad format into your app.

info

In the Interstitial Ad implementation you must pass the ViewController to the BlueStackCustomEvent

[BlueStackCustomEvent setViewController:self];

Native Ads

Before you can create custom events, you need to integrate the Native ad format into your app.

info

In the Native Ad implementation you must pass the ViewController to the BlueStackCustomEvent

[BlueStackCustomEvent setViewController:self];

Rewarded video Ads

Before you can create custom events, you need to integrate the Rewarded video ad format into your app.

info

In the Rewarded video implementation you must pass the ViewController to the BlueStackCustomEvent

[BlueStackCustomEvent setViewController:self];

Custom targeting / Keywords

If you need to send your custom key-value pairs. You can specify key-value-targeting and keywords information in the ad request as follows,and you must send your custom key-value pairs also as follows,add the extras to the registerAdNetworkExtras method as follows:

GADRequest* request = [GADRequest request];
BlueStackCustomEventMediationExtras *extras = [[BlueStackCustomEventMediationExtras alloc] initWithKeywords:@"target=mngadsdemo;version=5.1.3" customTargetingBlueStack:@{ @"age" :@"25",@"consent" :@"test",@"gender" :@"male"}];
[request registerAdNetworkExtras:extras];