This guide shows you how to use the Google Mobile Ads SDK to load and display ads from Line using 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 a Unity app.
Supported integrations and ad formats
The AdMob mediation adapter for Line has the following capabilities:
Integration | |
---|---|
Bidding | |
Waterfall | 1 |
Formats | |
Banner | |
Interstitial | |
Rewarded |
1 Waterfall integration is in open beta.
Requirements
- Unity 4 or higher
- Latest Google Mobile Ads SDK
- To deploy on Android
- Android API level 21 or higher
- To deploy on iOS
- iOS deployment target of 12.0 or higher
- A working Unity project configured with Google Mobile Ads SDK. See Get Started for details.
- Complete the mediation Get started guide
Step 1: Set up configurations in Line UI
अपने Line खाते में लॉग इन करें.
नया ऐप्लिकेशन जोड़ें
広告枠管理 (विज्ञापन स्लॉट मैनेजमेंट) > メディア (Media) पर क्लिक करें. इसके बाद, 規作成 (नया बनाएं) पर क्लिक करें.
फ़ॉर्म भरें और 登録 (रजिस्टर करें) पर क्लिक करें.
ऐप्लिकेशन आईडी को ध्यान से पढ़ें.
विज्ञापन प्लेसमेंट बनाना
उस ऐप्लिकेशन के आईडी पर क्लिक करें जिसमें विज्ञापन प्लेसमेंट जोड़ना है. इसके बाद, 詳細 (Detail) चुनें.
AdMobロッシ 追加 (स्लॉट जोड़ें) पर क्लिक करें.
फ़ॉर्म भरें और फ़ॉर्म भरने के बाद, (登録) रजिस्टर करें पर क्लिक करें.
स्लॉट आईडी को नोट करें.
Step 2: Set up Line demand in AdMob UI
अपनी विज्ञापन यूनिट के लिए मीडिएशन सेटिंग कॉन्फ़िगर करना
Android
निर्देशों के लिए, Android की गाइड में दूसरा चरण देखें.
iOS
निर्देशों के लिए, iOS की गाइड में दूसरा चरण देखें.
Step 3: Import the Line SDK and adapter
Download the latest version of Google Mobile Ads mediation plugin for Line
from the download link in the
Changelog and extract
GoogleMobileAdsLineMediation.unitypackage
from the zip file.
In your Unity project editor, select Assets > Import Package >
Custom Package and find the GoogleMobileAdsLineMediation.unitypackage
file you downloaded. Make sure that all the files are selected and click
Import.
Then, select Assets > Play Services Resolver > Android Resolver >
Force Resolve. The Unity Play Services Resolver library will perform
dependency resolution from scratch and copy the declared dependencies into the
Assets/Plugins/Android
directory of your Unity app.
Step 4: Add required code
Android
No additional code is required for Line integration.
iOS
SKAdNetwork integration
Follow Line's documentation
to add the SKAdNetwork identifiers to your project's Info.plist
file.
Step 5: Test your implementation
टेस्ट विज्ञापनों को चालू करें
पक्का करें कि आपने AdMob.
लाइन टेस्ट विज्ञापन चालू करने के तरीके लाइन के Android और iOS दस्तावेज़ में दिए गए निर्देशों का पालन करें.
टेस्ट विज्ञापनों की पुष्टि करें
यह पुष्टि करने के लिए कि Lineसे आपको टेस्ट विज्ञापन मिल रहे हैं, विज्ञापन जांचने वाले टूल में विज्ञापन के एक सोर्स को टेस्ट करने की सुविधा चालू करें. इसके लिए, Line (Waterfall) विज्ञापन सोर्स का इस्तेमाल करें.
Optional steps
Network-specific parameters
The Line Unity mediation plugin supports the following additional request
parameter which can be passed to the adapter through the LineMediationExtras
class:
SetEnableAdSound(boolean)
: 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:
using GoogleMobileAds.Api;
using GoogleMobileAds.Mediation.Line.Api;
// ...
var adRequest = new AdRequest();
var lineExtras = new LineMediationExtras();
lineExtras.SetEnableAdSound(true);
adRequest.MediationExtras.Add(lineExtras);
Error codes
If the adapter fails to receive an ad from Line,
publishers can check the underlying error from the ad response using
ResponseInfo
under the following classes:
Android
com.line.ads
com.google.ads.mediation.line.LineMediationAdapter
iOS
GADMediationAdapterLine
Here are the codes and accompanying messages thrown by the Line adapter when an ad fails to load:
Android
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. |
iOS
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 Unity Mediation Plugin Changelog
Version 1.3.0
- Supports Line Android adapter version 2.8.20240722.0.
- Supports Line iOS adapter version 2.8.20240612.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.2.0.
Version 1.2.0
- Supports Line Android adapter version 2.7.20240515.0.
- Supports Line iOS adapter version 2.8.20240612.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.1.
Version 1.1.2
- Supports Line Android adapter version 2.7.20240515.0.
- Supports Line iOS adapter version 2.7.20240411.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0.
Version 1.1.1
- Supports Line Android adapter version 2.7.20240214.1.
- Supports Line iOS adapter version 2.7.20240411.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0.
Version 1.1.0
- Added the
LineMediationExtras
class with the following methods to support passing mediation extras.SetEnabledAdSound(bool)
- Supports Line Android adapter version 2.7.20240214.1.
- Supports Line iOS adapter version 2.7.20240318.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.0.0.
Version 1.0.0
- Initial Release.
- Supports Line Android adapter version 2.6.20230607.0.
- Supports Line iOS adapter version 2.6.20230609.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 8.5.1.