Welcome to the documentation for the AppLovin Mediation Amazon Ad Marketplace Adapter!
Introduction
The AppLovin Mediation Amazon Ad Marketplace Adapter allows you to integrate ads from Amazon Ad Marketplace into your iOS or Android applications. This adapter is designed to work with the AppLovin SDK, providing a seamless integration experience for developers.
Getting Started
To get started with the AppLovin Mediation Amazon Ad Marketplace Adapter, you need to follow these steps:
- Ensure that you have integrated the AppLovin SDK into your application by following the AppLovin SDK integration guide.
- Obtain your Amazon Ad Marketplace App Key. This key is required to initialize the Amazon Ad Marketplace SDK.
Initialization
Before you can start displaying Amazon ads, you need to initialize the Amazon Ad Marketplace SDK. This requires your Amazon Ad Marketplace App Key and should be done after initializing the AppLovin SDK.
$amazonAppKey = 'YOUR_AMAZON_APP_KEY';
$amazonAdView = new AmazonAdView($amazonAppKey);
$amazonAdView->setListener($yourAdListener);
Replace 'YOUR_AMAZON_APP_KEY'
with your actual Amazon Ad Marketplace App Key. The $amazonAdView
instance will be used to load and display ads from Amazon.
Loading Ads
To load ads from Amazon Ad Marketplace, you need to call the loadAd()
method on the $amazonAdView
instance.
$amazonAdView->loadAd();
Displaying Ads
To display ads from Amazon, you need to add the $amazonAdView
to your view hierarchy.
$yourView->addView($amazonAdView);
Replace $yourView
with the view where you want to display the ads. You can customize the appearance and position of the ad view to match your application’s design.
Ad Events
The AppLovin Mediation Amazon Ad Marketplace Adapter provides listener callbacks to inform you about various ad events. You need to implement the YourAdListener
interface to handle these events.
The following ad events are available:
- onAdLoaded: Called when an ad is successfully loaded and ready to be displayed.
- onAdFailedToLoad: Called when ad loading fails.
- onAdClicked: Called when the user clicks on an ad.
- onAdImpression: Called when an ad impression is recorded.
To implement the ad listener, create a class that implements the YourAdListener
interface and handle the events accordingly.
class YourAdListenerImpl implements YourAdListener {
@Override
public void onAdLoaded() {
// Handle ad loaded event
}
@Override
public void onAdFailedToLoad(int errorCode) {
// Handle ad failed to load event
}
@Override
public void onAdClicked() {
// Handle ad clicked event
}
@Override
public void onAdImpression() {
// Handle ad impression event
}
}
Replace the // Handle ad event
comments with your own logic to handle the corresponding ad events.
Caching Ads
The AppLovin Mediation Amazon Ad Marketplace Adapter supports ad caching, allowing you to pre-load ads for a smoother user experience.
- Call the
preloadAd()
method on the$amazonAdView
instance to cache an ad. - Use the
isAdLoaded()
method to check if a cached ad is available before callingloadAd()
.
You can then load the pre-cached ad using the loadAd()
method as usual.
Additional Settings
You can configure additional settings for the AppLovin Mediation Amazon Ad Marketplace Adapter. These settings allow you to customize the ad loading process and control the behavior of the adapter.
To configure these settings, you need to create an instance of the MediationSettings
class and pass it as a parameter when initializing the Amazon Ad Marketplace SDK.
$mediationSettings = new MediationSettings();
$mediationSettings->setDebugModeEnabled(true);
$amazonAdView = new AmazonAdView($amazonAppKey, $mediationSettings);
In this example, the setDebugModeEnabled()
method is used to enable debug mode for the Amazon Ad SDK. You can customize the settings according to your requirements.
FAQs
Here are some frequently asked questions about the AppLovin Mediation Amazon Ad Marketplace Adapter:
Q: Can I use this adapter with the AppLovin MAX SDK?
A: No, this adapter is designed specifically for the AppLovin SDK and does not integrate with the MAX SDK. For MAX integration, please refer to the AppLovin MAX documentation.
Q: Does the adapter support rewarded ads?
A: No, the current version of the adapter does not support rewarded ads from Amazon Ad Marketplace. It only supports traditional banner and interstitial ads.
Q: Can I use mediation with other ad networks?
A: Yes, the AppLovin SDK supports mediation with other leading ad networks. You can follow the AppLovin integration guide and include additional adapters for the desired ad networks.
Conclusion
Congratulations! You have successfully integrated the AppLovin Mediation Amazon Ad Marketplace Adapter into your application. You can now display ads from Amazon Ad Marketplace using the AppLovin SDK.