Get Started with Glispa Connect

Overview

Examples

Android

Overview

- Native Ads

List/Feed

Custom

- Standard IAB Formats

Banner

Interstitial

Video

- Others

GDPR

Troubleshooting

Admob Android Adapter

Mopub Android Adapter

DFP Android Adapter

iOS

Overview

- Native Ads

List/Feed

Custom

- Standard IAB Formats

Banner

Interstitial

Video

- Others

GDPR

Troubleshooting

- Adapters

Admob iOS Adapter

Mopub iOS Adapter

DFP iOS Adapter

API Documentation

Reporting API

Help

GDPR FAQ

General

Earnings

Payments and Accounting

Integration

Reporting

Legal and Privacy

Updates

SDK Deprecation Schedule

SDK Change Log

Android Change Log

iOS Change Log

Mopub Android Adapter

Updated 1 month ago by Derek Lim

This is an adapter to be used in conjunction with the MoPub Android SDK.

Requirements

  • MoPub Android SDK v4.18.0 or later.
  • Glispa Connect Android SDK v4.10.1 or later.

Integrating Glispa Connect (formerly Avocarrot) Android SDK

  1. Add Glispa Connect Repository to yourbuild.gradlefile:
    repositories {
                maven { url  "https://s3.amazonaws.com/avocarrot-android-builds/dist" }
              }
  2. Add the compile dependency with the latest version of the Glispa Connect adapter
    dependencies {
                  // Banner
                  compile 'com.avocarrot.sdk:adapter-mopub-banner:1.4.15'
                  // Interstitial
                  compile 'com.avocarrot.sdk:adapter-mopub-interstitial:1.4.15'
                  // Native
                  compile 'com.avocarrot.sdk:adapter-mopub-nativead:1.4.15'
              }
    Only add the dependencies according to the ad format you need
  3. The Glispa Connect SDK should be initialised and started before requiring for ads. To ensure that the metrics are not over-counted, it is highly recommended that the Glispa Connect SDK be called in the Application class.

    public class YourApplication extends Application {
                  @Override
                  public void onCreate() {
                      super.onCreate();
                      Avocarrot.onApplicationCreated(this);
                      //...
                  }
                  //...
              }
  4. Add application name to your AndroidManifest.xml file.

    <application android:name=".YourApplication">
                <!-- activities goes here -->
              </application>

Setup MoPub Dashboard

Create an "Glispa Connect" Network in MoPub's dashboard and connect it to your Ad Units.

  1. In MoPub's dashboard select Networks > Add New network
  2. Then select Custom Native Network
  3. For Native Ad Units you need complete the following:
  4. Under Custom Event Class add the appropriate class according to ad format you are using:

    // For Banner
              com.mopub.mobileads.AvocarrotBanner
              // For Interstitial
              com.mopub.mobileads.AvocarrotInterstitial
              // For Native
              com.mopub.nativeads.AvocarrotNativeMopub
  5. Under Custom Event Class Data add your ad unit id:

    {"adUnit":"avocarrotadunit"} or {"adUnitId":"avocarrotadunit"}
    Get your ad unit if from Glispa Connect dashboard

Was this article useful?