Example project on how to use the Avocarrot SDK with other Ad Networks, in your Android projects.
For any technical help or questions, please get in touch with support
===
You can use Avocarrot as a Network
in Mopub's Mediation platform.
===
- Integrate with Mopub SDK (https://github.com/mopub/mopub-android-sdk/wiki/Getting-Started)
- Install Avocarrot SDK (Download SDK)
More info how to install Avocarrot SDK on Document Section
===
Create an "Avocarrot" Network
in Mopub's dashboard and connect it to your Ad Units.
- In Mopub's dashboard select
Networks
>Add New network
- Then select
Custom Native Network
- Complete the fields accordingly to the Ad Unit that you want to use
===
For Interstitial Ad Units (Natural Pause
in Avocarrot => Fullscreen
, Medium
etc formats in Mopub), you need to :
- Complete the following in Mopub Dashboard:
Custom Event Class
com.mopub.mobileads.AvocarrotInterstitialMopub
Custom Event Class Data
{"apiKey":"<AvocarrotApiKey>","placementKey":"<AvocarrotPlacementKey>"}
Get your api & placement keys from the Avocarrot Dashboard.
Please note that for Mopub Interstitial
you should create an Avocarrot "Natural Pause"
placement.
- Include the
AvocarrotInterstitialMopub
in your project.
===
For Native Ad Units (such as List
, Feed
in Avocarrot's Dashboard => Native (Custom Layout)
Format in Mopub) you need to :
- Complete the following in Mopub Dashboard:
Custom Event Class
com.mopub.nativeads.AvocarrotNativeMopub
Custom Event Class Data
{"apiKey":"<AvocarrotApiKey>","placementKey":"<AvocarrotPlacementKey>"}
Get your api & placement keys from the Avocarrot Dashboard.
Please note that for Mopub Native
you should create an Avocarrot "Create your own"
placement.
-
Include the
AvocarrotNativeMopub
in your project. -
Add AdChoice Icon in you layout by adding PrivacyInfo. Check example :
NativeMopubActivity.java
===
Congratulations! You have now successfully integrated Avocarrot and you should have received your first ad.
- If you have any problem, you can enable the logger or/and sandbox mode by adding
"sandbox":"true" , "logger":"true"
in Custom Event Class Data. - Please have in mind, that any time you make a change to the Mopub dashboard, try to fetch an ad a couple times and then wait a few minutes for Mopub's cache to clear.
- You can also try cloning the example project below to make sure everything is running ok
- If at any point you need any technical help, please get in touch with [support] (https://app.avocarrot.com/#/docs/contact)
- git clone https://github.com/Avocarrot/android-adapters.git
- cd android-adapters
- git submodule update --init --recursive
- Import to Android Studio
- Update your Mediation Ad Unit Ids in res/string.xml
- Run in the emulator and you should receive ads normally in the Example App