Intégrer une ligne à la médiation (bêta)

This guide shows you how to use the Google Mobile Ads SDK to load and display ads from Line using AdMob Mediation, covering waterfall integrations. It covers how to add Line to an ad unit's mediation configuration, and how to integrate the Line SDK and adapter into an Android app.

The dashboard interface for Line uses Japanese text for its labels, buttons, and descriptions. The screenshots in this guide have not been translated. In this guide's descriptions and instructions however, labels and buttons are translated with their English language equivalents in parentheses.

Supported integrations and ad formats

The mediation adapter for Line has the following capabilities:

Integration
Bidding
Waterfall  1
Formats
Banner
Interstitial
Rewarded
Native

1 Waterfall integration is in open beta.

Requirements

  • Android API level 21 or higher

Step 1: Set up configurations in Line UI

Log in to your Line account.

Add a new application

Click 広告枠管理 (Ad Slot Management) > メディア (Media). Then, click 新規作成 (Create New).

Fill out the form and click 登録 (Register).

Take note of the Application ID.

Create an ad placement

Click the ID of the application you want to add an ad placement. Then, select 詳細 (Detail).

Click スロット 追加 (Add Slot).

Fill out the form and once done, click (登録) Register.

Take note of the Slot ID.

Step 2: Set up Line demand in AdMob UI

Configurer les paramètres de médiation pour votre bloc d'annonces

Vous devez ajouter Line à la configuration de la médiation pour votre bloc d'annonces.

Connectez-vous à votre compte AdMob. Accédez ensuite à l'onglet Médiation. Si vous souhaitez modifier un groupe de médiation existant, cliquez sur son nom pour le modifier, puis passez à l'étape Ajouter Line comme source d'annonces.

Pour créer un groupe de médiation, sélectionnez Créer un groupe de médiation.

Saisissez le format de votre annonce et votre plate-forme, puis cliquez sur Continuer.

Attribuez un nom à votre groupe de médiation, puis sélectionnez les zones géographiques à cibler. Définissez ensuite l'état du groupe de médiation sur Activé, puis cliquez sur Ajouter des blocs d'annonces.

Associez ce groupe de médiation à un ou plusieurs de vos blocs d'annoncesAdMob existants. Cliquez ensuite sur Done (OK).

Vous devriez maintenant voir la fiche des blocs d'annonces que vous avez sélectionnés:

Ajouter Line comme source d'annonces

Sous la fiche Waterfall (Cascade d'annonces) de la section Ad Sources (Sources d'annonces), sélectionnez Add Ad Source (Ajouter une source d'annonces). Sélectionnez ensuite Line.

Sélectionnez Line. Ensuite, saisissez une valeur d'eCPM pour Line et cliquez sur Continuer.

Si vous disposez déjà d'un mappage pour Line, vous pouvez le sélectionner. Sinon, cliquez sur Ajouter un mappage.

Saisissez ensuite les Application ID and Slot IDobtenus à la section précédente. Cliquez ensuite sur Done (OK).

Step 3: Import the Line SDK and Adapter

In your app-level build.gradle.kts file, add the following implementation dependencies and configurations. Use the latest versions of the Line SDK and adapter:

dependencies {
    implementation("com.google.android.gms:play-services-ads:23.2.0")
    implementation("com.google.ads.mediation:line:2.7.20240515.0")
}

Manual integration

  1. Download the latest version of the Line SDK's .aar file and add it to your project.

  2. Navigate to the Line adapter artifacts on Google's Maven Repository. Select the latest version, download the Line adapter's .aar file, and add it to your project.

Step 4: Add required code

No additional code is required for Line integration.

Step 5: Test your implementation

Activer les annonces tests

Veillez à enregistrer votre appareil de test pour AdMob.

Suivez les instructions dans Documentation de Line pour savoir comment activer les annonces de test de ligne.

Valider les annonces tests

Pour vérifier que vous recevez des annonces tests deLine, activez le test d'une source d'annonce unique dans l'inspecteur d'annonces à l'aide de Line (Waterfall) sources d'annonces.

Optional steps

Network-specific parameters

The Line adapter supports an additional request parameter which can be passed to the adapter using the LineExtras class. This class constructor includes the following parameters:

enableAdSound
A boolean to specify the default sound start state of banner, interstitial and rewarded ads.

Here's a code example of how to create an ad request that sets these parameters:

Java

LineExtras lineExtras = new LineExtras(true);
Bundle extras = lineExtras.build();

AdRequest request = new AdRequest.Builder()
   .addNetworkExtrasBundle(LineMediationAdapter.class, extras)
   .build();

Kotlin

val lineExtras = LineExtras(true)
val extras = lineExtras.build()

val request = AdRequest.Builder()
   .addNetworkExtrasBundle(LineMediationAdapter::class.java, extras)
   .build()

Using native ads

Ad rendering

The Line adapter populates the following Native ads advanced field descriptions for a NativeAd.

Field Assets always included by Line adapter
Headline
Image
Body
App icon 1
Call to action
Star rating
Store
Price

1 For native ads, the Line SDK does not provide an app icon asset. Instead, the Line adapter populates the app icon with a transparent image.

Error codes

If the adapter fails to receive an ad from Line, you can check the underlying error from the ad response using ResponseInfo.getAdapterResponses() under the following classes:

com.line.ads
com.google.ads.mediation.line.LineMediationAdapter

Here are the codes and accompanying messages thrown by the Line adapter when an ad fails to load:

Error code Domain Reason
1-10 com.five_corp.ad Line SDK returned an SDK-specific error. See Line's documentation for more details.
101 com.google.ads.mediation.line Missing or invalid Application ID.
102 com.google.ads.mediation.line Missing or invalid Slot ID.
103 com.google.ads.mediation.line The requested ad size does not match a Line supported banner ad size.
104 com.google.ads.mediation.line Failed to load an interstitial or rewarded ad due to missing activity context.
105 com.google.ads.mediation.line Line SDK failed to show an interstitial or rewarded ad.
106 com.google.ads.mediation.line Failed to load a native ad due to missing assets.

LINE Android Mediation Adapter Changelog

Version 2.7.20240515.0

  • Updated the minimum required Google Mobile Ads SDK version to 23.1.0.
  • Verified compatibility with FiveAd SDK version 2.7.20240515.0

Built and tested with:

  • Google Mobile Ads SDK version 23.1.0.
  • FiveAd SDK version 2.7.20240515.0

Version 2.7.20240214.1

  • Updated the minimum required Google Mobile Ads SDK version to 23.0.0.
  • Verified compatibility with FiveAd SDK version 2.7.20240214.0.

Built and tested with:

  • Google Mobile Ads SDK version 23.0.0.
  • FiveAd SDK version 2.7.20240214.0.

Version 2.7.20240214.0

  • Verified compatibility with FiveAd SDK version 2.7.20240214.0.

Built and tested with:

  • Google Mobile Ads SDK version 22.6.0.
  • FiveAd SDK version 2.7.20240214.0.

Version 2.7.20240126.0

  • Verified compatibility with FiveAd SDK version 2.7.20240126.0.

Built and tested with:

  • Google Mobile Ads SDK version 22.6.0.
  • FiveAd SDK version 2.7.20240126.0.

Version 2.7.20240112.0

  • Removed deprecated FiveAdViewEventListener in favor of FiveAdCustomLayoutEventListener, FiveAdVideoRewardEventListener, FiveAdInterstitialEventListener and FiveAdNativeEventListener.
  • Verified compatibility with FiveAd SDK version 2.7.20240112.
  • Updated the minimum required Google Mobile Ads SDK version to 22.6.0.

Built and tested with:

  • Google Mobile Ads SDK version 22.6.0.
  • FiveAd SDK version 2.7.20240112.

Version 2.6.20230607.1

  • Added LineExtras class for publishers to define default sound settings for banner, interstitial and rewarded ad formats.
  • Updated the minimum required Google Mobile Ads SDK version to 22.4.0.

Built and tested with:

  • Google Mobile Ads SDK version 22.4.0.
  • FiveAd SDK version 2.6.20230607.

Version 2.6.20230607.0

  • Initial release.
  • Adds support for banner, interstitial, rewarded and native ad formats.
  • Verified compatibility with FiveAd SDK version 2.6.20230607.

Built and tested with:

  • Google Mobile Ads SDK version 22.1.0.
  • FiveAd SDK version 2.6.20230607.