如何为插页式广告添加阈值?

时间:2016-01-05 21:11:30

标签: android android-studio admob interstitial

我有插页式广告的问题。如何为插页式广告添加阈值?

private void setupInterstitial() {
    mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId("ca-app-pub-XXXXXXXXXXXXXXXXXXXXXXXXX");

    requestNewInterstitial();
}

private void requestNewInterstitial() {
    AdRequest adRequest = new AdRequest.Builder()
            .addTestDevice("SEE_YOUR_LOGCAT_TO_GET_YOUR_DEVICE_ID")
            .build();

    mInterstitialAd.loadAd(adRequest);
}


protected void bindViews() {
    ButterKnife.bind(this);
    setupToolbar();
}

protected void setupToolbar() {
    if (mToolbar != null) {
        setSupportActionBar(mToolbar);
    }
    mNavigationView.setNavigationItemSelectedListener(mNavigationListener);
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.hello_world, R.string.hello_world);
    mDrawerLayout.setDrawerListener(mDrawerToggle);
}

public Toolbar getToolbar() {
    return mToolbar;
}

protected void setHamburgerButton() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        getSupportActionBar().setHomeButtonEnabled(true);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
}

@Override
public void onBackPressed() {
    super.onBackPressed();
    if (mInterstitialAd.isLoaded()) {
        mInterstitialAd.show();
    }
}

1 个答案:

答案 0 :(得分:0)

  1. 转到Admob - >货币化标签
  2. 查找广告单元
  3. 点击修改
  4. 设置阈值(频率上限)
  5. 保存
  6. 编辑广告单元页面会向您显示您可以设置阈值的位置。

    enter image description here