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 iOS 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 | 1 |
Waterfall | 2 |
Formats | |
Banner | 3 |
Interstitial | 3 |
Rewarded | |
Native |
2 Waterfall integration is in open beta.
3 This format is only supported in waterfall integration.
Requirements
- iOS deployment target of 12.0 or higher
Latest Google Mobile Ads SDK
Complete the mediation Get started guide
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
Follow the same steps to create ad placements for both bidding and waterfall integrations. Each ad placement can be used for both.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
Configure mediation settings for your ad unit
You need to add Line 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 Line as an ad source.
To create a new mediation group, select Create Mediation Group.
Enter your ad format and platform, then click Continue.
Give your mediation group a name, and select locations to target. Next, set the mediation group status to Enabled, and then click Add Ad Units.
Associate this mediation group with one or more of your existing AdMob ad units. Then click Done.
You should now see the ad units card populated with the ad units you selected:
Add Line as an ad source
Bidding
Under the Bidding card in the Ad Sources section, select Add Ad Source. Then select Line (SDK).
Click How to sign a partnership agreement and set up a bidding partnership with Line.
Click Acknowledge & agree, then click Continue.
If you already have a mapping for Line, you can select it. Otherwise, click Add mapping.
Next, enter the Application ID and Slot ID obtained in the previous section. Then click Done.
Waterfall
Under the Waterfall card in the Ad Sources section, select Add Ad Source. Then select Line.
Select Line. Then enter an eCPM value for Line and click Continue.If you already have a mapping for Line, you can select it. Otherwise, click Add mapping.
Next, enter the Application ID and Slot ID obtained in the previous section. Then click Done.
Step 3: Import the Line SDK and Adapter
Using CocoaPods (recommended)
Add the following line to your project's Podfile:
pod 'GoogleMobileAdsMediationLine'
From the command line run:
pod install --repo-update
Manual integration
- Download the latest version of the Line
SDK and link
FiveAd.framework
in your project. - Download the latest version of the Line adapter from the download link in
Changelog and link
LineAdapter.framework
in your project.
Step 4: Add required code
SKAdNetwork integration
Follow Line's documentation
to add the SKAdNetwork identifiers to your project's Info.plist
file.
Step 5: Test your implementation
Enable test ads
Make sure you register your test device for AdMob.
Follow the instructions in Line's documentation on how to enable Line test ads.
Verify test ads
To verify that you are receiving test ads from Line, enable single ad source testing in ad inspector using the Line (Waterfall) ad source(s).
Optional steps
Network-specific parameters
The Line adapter supports an additional request parameter which can be passed
to the adapter using the GADMediationAdapterLineExtras
class. This class
includes the following properties:
adAudio
- Specifies 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:
Swift
import LineAdapter
// ...
let request = GADRequest()
let extras = GADMediationAdapterLineExtras()
extras.adAudio = GADMediationAdapterLineAdAudio.unmuted
// ...
request.register(extras)
Objective-C
#import <LineAdapter/LineAdapter.h>
// ...
GADRequest *request = [GADRequest request];
GADMediationAdapterLineExtras *extras = [[GADMediationAdapterLineExtras alloc] init];
extras.adAudio = GADMediationAdapterLineAdAudioUnmuted;
// ...
[request registerAdNetworkExtras:extras];
Using native ads
Ad rendering
The Line adapter populates the following
Native ads advanced field descriptions
for a
GADNativeAd
.
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
GADResponseInfo.adNetworkInfoArray
under the following classes:
GADMediationAdapterLine
Here are the codes and accompanying messages thrown by the Line adapter when an ad fails to load:
Error code | Domain | Reason |
---|---|---|
1-10 | Sent by Line SDK | Line SDK returned an SDK-specific error. See Line's documentation for more details. |
101 | com.google.ads.mediation.line | Invalid server parameters (e.g. Missing Application ID or Slot ID). |
102 | com.google.ads.mediation.line | The requested ad size does not match a Line supported banner ad size. |
103 | com.google.ads.mediation.line | Failed to load an information icon image asset in native ad. |
LINE iOS Mediation Adapter Changelog
Version 2.8.20240827.1
- Updated
CFBundleShortVersionString
to have three components instead of four.
Built and tested with:
- Google Mobile Ads SDK version 11.10.0.
- FiveAd SDK version 2.8.20240827.
Version 2.8.20240827.0
- Verified compatibility with FiveAd SDK version 2.8.20240827.
- Added bidding support for banner, interstitial, rewarded, and native ad formats.
Built and tested with:
- Google Mobile Ads SDK version 11.8.0.
- FiveAd SDK version 2.8.20240827.
Version 2.8.20240612.0
- Added audio control for native ad via GADVideoOptions.
- Verified compatibility with FiveAd SDK version 2.8.20240612.
Built and tested with:
- Google Mobile Ads SDK version 11.5.0.
- FiveAd SDK version 2.8.20240612.
Version 2.7.20240411.0
- Verified compatibility with FiveAd SDK version 2.7.20240411.
Built and tested with:
- Google Mobile Ads SDK version 11.3.0.
- FiveAd SDK version 2.7.20240411.
Version 2.7.20240318.0
- Verified compatibility with FiveAd SDK version 2.7.20240318.
Built and tested with:
- Google Mobile Ads SDK version 11.2.0.
- FiveAd SDK version 2.7.20240318.
Version 2.7.20240214.1
- Now requires minimum iOS version 12.0.
- Now requires Google Mobile Ads SDK version 11.0 or higher.
- Included
Info.plist
in the frameworks withinLineAdapter.xcframework
.
Built and tested with:
- Google Mobile Ads SDK version 11.0.1.
- FiveAd SDK version 2.7.20240214.
Version 2.7.20240214.0
- Verified compatibility with FiveAd SDK version 2.7.20240214.
Built and tested with:
- Google Mobile Ads SDK version 11.0.1.
- FiveAd SDK version 2.7.20240214.
Version 2.7.20240126.0
- Verified compatibility with FiveAd SDK version 2.7.20240126.
- Updated the adapter implementation with FiveAd SDK new delegate protocols.
Built and tested with:
- Google Mobile Ads SDK version 10.14.0.
- FiveAd SDK version 2.7.20240126.
Version 2.7.20231115.0
- Verified compatibility with FiveAd SDK version 2.7.20231115.
- Included
GADMediationAdapterLineExtras
header in the modulemap.
Built and tested with:
- Google Mobile Ads SDK version 10.14.0.
- FiveAd SDK version 2.7.20231115.
Version 2.6.20230609.1
- Added
GADMediationAdapterLineAudioState
to manage the initial audio state of the banner, interstitial, and rewarded ad when it is first displayed.
Built and tested with:
- Google Mobile Ads SDK version 10.14.0.
- FiveAd SDK version 2.6.20230609.
Version 2.6.20230609.0
- Initial release!
- Added waterfall support for banner, interstitial, rewarded, and native ad formats.
- Verified compatibility with FiveAd SDK version 2.6.20230609.
Built and tested with:
- Google Mobile Ads SDK version 10.9.0.
- FiveAd SDK version 2.6.20230609.