应用开屏广告
应用开屏广告与插屏广告类似,但会在用户热启动或冷启动应用时展示:
- 冷启动
- 在设备上创建新应用会话
- 应用不在设备内存中
- 需要启动/加载界面
- 热启动
- bringing the app from background to foreground, or activating the phone when the app is in foreground mode
- 应用在内存中处于挂起状态
- 需要启动/加载界面
最佳实践
- Display a splash/loading screen before you show the app open ad.
Do this no matter how you place the ad.
- Include a call-out to the user that tells them they will see an ad in the Splash/Loading screen.
- 例如“在应用加载时观看赞助商的广告。”
- 确保在广告展示之前用户不会看到实际的应用内容。 正确的顺序是:启动/加载界面 ⇒ 应用开屏广告 ⇒ 应用内容。
- Include a call-out to the user that tells them they will see an ad in the Splash/Loading screen.
- 在加载应用开屏广告前,请确保 AppLovin SDK 已初始化。
- 当应用开屏广告尚未加载时 (即冷启动时),请首先加载开屏广告,稍后再加载其他格式的广告,避免与应用开屏广告同时加载。
- 并行加载多种格式的广告对设备资源和广告需求方的 SDK 来说都是不利的。
- 为避免向用户过度展示应用开屏广告,AppLovin 建议采用以下策略:
- Use a frequency cap that you manage outside AppLovin. This way you have full control over when the ads will serve.
- Implement a cool down period based on user behavior in the app. For example: don’t show an ad during soft launch for some period of time before you show one again, or show an ad during every other soft launch.
- 等待新用户打开应用并使用几次后再展示第一个开屏广告。
留存
在采用开屏广告格式时,请始终考虑用户留存问题。
针对应用开屏广告,您可以选择多种实施策略。
AppLovin recommends that you test by using one or more of the techniques described below. Each application has a unique configuration that allows it to maximize revenue without impacting retention or time spent in the app. User behavior and engagement may change, so AppLovin recommends that you retest your App Open Ads strategies often. Some implementation techniques you may use to test App Open Ads include:
- 向合适的用户展示广告。
这种方法的例子包括:
- 用户初始安装后等待数量不等的天数,然后再在冷启动时显示广告。
- 向最近几天内进行过会话的用户显示。
- 向符合应用内特定条件的用户展示。 例如,用户完成了特定关卡,打开应用达到一定次数,或未与激励广告互动。
- 避免向用户过度展示广告。
这种方法的例子包括:
- 不要抓住每个机会展示广告。 每隔 1 个、2 个或 3 个广告机会展示一次。
- Only show an ad if the user backgrounds the app for a certain amount of time (i.e. 30 seconds, 2 minutes, 15 minutes).
- 展示冷启动广告一段时间内,不要展示热启动应用开屏广告或插屏广告。
- 设置频率上限。如果可能,请根据用户同期群调整上限。
- 使用启动画面通知用户。
- Refer to the section on splash screens in “Best Practices” above.
使用开屏广告
当应用转到前台时,为确保应用开屏广告已准备就绪,您需要预加载 MaxAppOpenAd。
创建一个工具类并在 Application 类中创建实例对象。
该类可以在您需要展示广告之前发出广告请求。
创建一种在广告就绪时显示广告的方法。
在 Lifecycle.Event.ON_START 生命周期事件中调用该方法。
然后,您的应用会尝试在应用打开时展示广告,或在未预加载广告的情况下加载广告。
监听应用前台事件
要获得应用前台事件通知,您需要注册 LifecycleObserver。
您可能需要向应用程序层级 build.gradle 文件中添加生命周期库:
implementation("androidx.lifecycle:lifecycle-process:2.2.0")冷启动和加载界面
请求广告与收到要展示的广告之间存在时间差。 如果应用设计不善,用户会短暂地看到应用,然后突然看到完全无关的广告。 这种现象会损害用户体验,因此应该避免。 处理冷启动的首选方法是在显示任何应用内容之前显示加载界面,在加载界面之后展示广告。 如果应用在加载界面后显示任何应用内容,则不要展示广告。
您可以在应用开屏广告下方显示一个加载界面,并且在广告被关闭之前结束该加载界面。
如果是这种情况的话,您可以在 onAdHidden() 方法中关闭加载界面。
示例
此代码示例假设只有在“热启动”,即应用在内存中挂起时,展示开屏广告。 启动/加载界面不包括在内。 应用开发者必须自行处理启动/加载界面 — 请参阅最佳实践。
public class MyApplication extends Application{ private final ExampleAppOpenManager appOpenManager;
@Override public void onCreate() { super.onCreate();
AppLovinSdk.initializeSdk( this, new AppLovinSdk.SdkInitializationListener() { @Override public void onSdkInitialized(final AppLovinSdkConfiguration configuration) { appOpenManager = new ExampleAppOpenManager( this ); } } ); }}
public class ExampleAppOpenManager implements LifecycleObserver, MaxAdListener{ private final MaxAppOpenAd appOpenAd; private final Context context;
public ExampleAppOpenManager(final Context context) { ProcessLifecycleOwner.get().getLifecycle().addObserver( this );
this.context = context;
appOpenAd = new MaxAppOpenAd( "«ad-unit-ID»" ); appOpenAd.setListener( this ); appOpenAd.loadAd(); }
private void showAdIfReady() { if ( appOpenAd == null || !AppLovinSdk.getInstance( context ).isInitialized() ) return;
if ( appOpenAd.isReady() ) { appOpenAd.showAd( "«test-placement»" ); } else { appOpenAd.loadAd(); } }
@OnLifecycleEvent(Lifecycle.Event.ON_START) public void onStart() { showAdIfReady(); }
@Override public void onAdLoaded(final MaxAd ad) {} @Override public void onAdLoadFailed(final String adUnitId, final MaxError error) {} @Override public void onAdDisplayed(final MaxAd ad) {} @Override public void onAdClicked(final MaxAd ad) {}
@Override public void onAdHidden(final MaxAd ad) { appOpenAd.loadAd(); }
@Override public void onAdDisplayFailed(final MaxAd ad, final MaxError error) { appOpenAd.loadAd(); }}class MyApplication : Application(){ private lateinit var appOpenManager: ExampleAppOpenManager
override fun onCreate() { super.onCreate()
AppLovinSdk.getInstance( this ).initializeSdk({ configuration: AppLovinSdkConfiguration -> { appOpenManager = ExampleAppOpenManager(applicationContext) }) }}
class ExampleAppOpenManager(applicationContext: Context?) : LifecycleObserver, MaxAdListener{ private lateinit var appOpenAd: MaxAppOpenAd private lateinit var context: Context
init { ProcessLifecycleOwner.get().lifecycle.addObserver(this)
context = applicationContext
appOpenAd = MaxAppOpenAd("«ad-unit-ID»") appOpenAd.setListener(this) appOpenAd.loadAd() }
private fun showAdIfReady() { if (appOpenAd == null || !AppLovinSdk.getInstance(context).isInitialized) return
if (appOpenAd.isReady) { appOpenAd.showAd("«test-placement»") } else { appOpenAd.loadAd() } }
@OnLifecycleEvent(Lifecycle.Event.ON_START) fun onStart() { showAdIfReady() }
override fun onAdLoaded(ad: MaxAd) {} override fun onAdLoadFailed(adUnitId: String, error: MaxError) {} override fun onAdDisplayed(ad: MaxAd) {} override fun onAdClicked(ad: MaxAd) {}
override fun onAdHidden(ad: MaxAd) { appOpenAd.loadAd() }
override fun onAdDisplayFailed(ad: MaxAd, error: MaxError) { appOpenAd.loadAd() }}支持的适配器版本
| 广告渠道 | 最低适配器版本 |
|---|---|
| BIGO Ads | 4.5.1.0 |
| Google Bidding 和 Google AdMob | 22.2.0.2 |
| Liftoff Monetize | 6.12.0.2 |
| Mintegral | 16.6.61.1 |
| Pangle | 4.6.0.4.0 |