Appearance
AdMob Mediation Integration by Custom Event
Supported Ad Formats
| AdMob Ad Format | Minimum required version of Opera adapter |
|---|---|
| Native | 2.0.0.0 |
| AdSize.BANNER | 2.0.0.0 |
| AdSize.MEDIUM_RECTANGLE | 2.0.0.0 |
| Interstitial | 2.0.0.0 |
| Rewarded | 2.0.0.0 |
| AppOpen | 2.5.0.0 |
Configure Custom Event in the AdMob Console
You need to add Opera to the mediation configuration for your ad unit.
First, sign in to your AdMob account. Next, navigate to the Mediation tab. If you have an existing mediation group you'd like to modify, click the name of that mediation group to edit it, and skip ahead to Add Opera Ads as a Custom Event. To create a new mediation group, select Create Mediation Group.
Add Opera Ads as a Custom Event
Under the Waterfall card in the Ad Sources section, select Add custom event. Fill in the "Label" and "eCPM", and press Continue.
In the Map ad units pop-up window, choose one AdMob ad unit to map to the custom event, and fill in the following:
Class Name:
OpAdxAdmobMediationAdapterThis single adapter class handles all ad formats (Banner, Interstitial, Rewarded, Native, App Open).
Parameter: Enter your Opera Ads configuration in JSON format:
json{ "appId": "pub13423013211200/ep13423013211584/app14170937163904", "placementId": "s14170965187264", "bundleId": "com.example.yourapp" }Key Required Description appIdYes Opera Ads Application ID (format: pub{}/ep{}/app{})placementIdYes Opera Ads Placement ID (format: s{})bundleIdYes Your iOS app Bundle ID
Add Dependencies
Add to your Podfile:
ruby
platform :ios, '13.0'
target 'YourApp' do
use_frameworks!
# Google Mobile Ads SDK
pod 'Google-Mobile-Ads-SDK', '>= 12.8'
# Opera Ads SDK
pod 'OpAdxSdk', '~> 2.9.1'
# Opera Ads AdMob Adapter
pod 'OpAdxAdapterAdmob', '~> 2.9.1.0'
endThen run:
bash
pod installAdditional Code Required
The AdMob SDK automatically initializes the Opera Ads SDK when loading ads. No additional initialization code is required.
Initialize AdMob SDK
Swift:
swift
import GoogleMobileAds
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Initialize Google Mobile Ads SDK
GADMobileAds.sharedInstance().start { status in
print("AdMob SDK initialized")
}
// Opera Ads SDK will be auto-initialized by the adapter
return true
}
}Objective-C:
objective-c
#import <GoogleMobileAds/GoogleMobileAds.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize Google Mobile Ads SDK
[[GADMobileAds sharedInstance] startWithCompletionHandler:^(GADInitializationStatus *status) {
NSLog(@"AdMob SDK initialized");
}];
// Opera Ads SDK will be auto-initialized by the adapter
return YES;
}
@endPrivacy Compliance
GDPR
Please refer to GDPR. The Opera Ads SDK reads the application's consent string automatically.
COPPA
Please refer to COPPA. You can set COPPA status via the SDK init config's .coppa() builder method.
CCPA (US Privacy)
Please refer to US Privacy. You can set the CCPA status via the SDK init config's .usPrivacy() builder method.
