我选择谁作为我的Admob广告技术提供商

时间:2018-05-23 15:36:14

标签: admob cookieconsent

根据GDPR,Google表示我必须选择广告技术提供商'并获得用户'同意。但是,如果任何发布商ID使用常用的广告技术提供商,则不支持Google提供的同意书。这意味着我需要为我的帐户手动选择广告技术提供商,以避免在使用发布商管理的同意收集选项的情况下自行获得同意#39;我在这里空白。

我应该选择哪些,如果我不使用调解而只使用admob,会有什么不同?我应该只使用一个提供商,即Google吗?

编辑:感谢您的downvotes。老实说,我不明白为什么这不是一个有效的问题,除非或许应该在其他地方提出这个问题,我会寻求指导。

3 个答案:

答案 0 :(得分:4)

我一直试图回答这个问题一个星期。 这就是我的工作。

检查您的Adsense帐户,转到"高级报告">"广告网络"并且您将看到您的应用已获得广告的所有广告技术提供商,这应该可以让您了解哪些广告提供商对您有利。

如果您的应用是新的并且没有任何数据,我建议您只使用Google(默认)。

在我的特定情况下,我的应用程序已经启动了8个月,安装了450次,安装了45次。

Google Networks报告的估计收益率为91.5%,预估收益率为97.3%。

当用户想要查看应用与谁共享信息时,将Google作为唯一提供商的IMO看起来会更好,而不是列出其中12个从未听说过的列表。在开始时我想过选择最好的12,但是根据数字它并没有多大意义,并选择坚持使用Google。

免责声明:我对广告网络一无所知,因为我的Admob历史记录,我选择了Google。

答案 1 :(得分:1)

您所说的" Google提供的同意书"是一个由Google制作的开源库,用于显示和收集用户同意。

根据GDRP,此同意书应显示所有admob提供商的隐私政策。但是这个图书馆仅限于显示12个提供商。

所以你有3个选择:

1-你限制自己使用12个admob提供者。

2-您自己表明同意。

3-您从github下载Google图书馆同意书并修改它以显示所有广告提供商

答案 2 :(得分:1)

好,所以我最终实现了自己的同意机制。我认为它符合要求,所以为了他人的利益,这里是:

首先,声明这些变量。这些将用于决定您是否需要出示同意书:

boolean shouldShowConsentForm = false;
boolean goAdFreeChosen = false; // to prevent firing the consent dialog when going into settings.

使用此方法告诉用户您要征求同意:

void showConsentDialogIntro(final Context context) {
    Bundle params = new Bundle();
    params.putString("what", "showConsentDialogIntro");
    mFirebaseAnalytics.logEvent(CONSENT_COLLECTION, params);

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    builder.setTitle("Something important before you continue...").
            setMessage("This app is kept free by showing ads. Tap next to see privacy options regarding this.\n\n(You can change this later in Settings too)").
            setPositiveButton("Next", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    showYesNoDialog(context, true);
                }
            })
            //.setNegativeButton("Cancel", null)
            .show();
}

然后,该方法将为用户提供3种选择-表示同意,不同意或完全删除广告:

private void showYesNoDialog(final Context context, boolean shouldReportInFirebase) {
    if (shouldReportInFirebase) {
        Bundle params = new Bundle();
        params.putString("what", "showYesNoDialog");
        mFirebaseAnalytics.logEvent(CONSENT_COLLECTION, params);
    }

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
    final CharSequence[] items = {"Yes - Shows relevant ads", "No - Shows less relevant ads", "Go Ad free",
            "Learn how our partners collect and use your data"};
    builder.setTitle("Can THIS_APP_NAME use your data to tailor ads for you?").
            setItems(items, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    Bundle params = new Bundle();
                    switch (which) {
                        case 0: // yes
                            ConsentInformation.getInstance(context)
                                    .setConsentStatus(ConsentStatus.PERSONALIZED);
                            shouldShowConsentForm = false;

                            mInterstitialAd.loadAd(new AdRequest.Builder()
                                    .addTestDevice(TEST_DEVICE_FOR_ADS)
                                    .build());

                            params.putString("what", "yes");
                            break;
                        case 1: // no
                            ConsentInformation.getInstance(context)
                                    .setConsentStatus(ConsentStatus.NON_PERSONALIZED);
                            shouldShowConsentForm = false;

                            Bundle extras = new Bundle();
                            extras.putString("npa", "1");
                            mInterstitialAd.loadAd(new AdRequest.Builder()
                                    .addNetworkExtrasBundle(AdMobAdapter.class, extras)
                                    .addTestDevice(TEST_DEVICE_FOR_ADS)
                                    .build());

                            params.putString("what", "no");

                            Snackbar.make(myToolbar, "We'll partner with Google and use a unique identifier to respect your choice.",
                                    Snackbar.LENGTH_LONG).addCallback(new BaseTransientBottomBar.BaseCallback<Snackbar>() {
                                @Override
                                public void onDismissed(Snackbar transientBottomBar, int event) {
                                    super.onDismissed(transientBottomBar, event);
                                    Snackbar.make(myToolbar, "You can change your choice later in Settings.", Snackbar.LENGTH_LONG).show();
                                }
                            })
                                    //.setDuration(3500)
                                    .show(); // 3500 is perhaps the duration for LENGTH_LONG.
/*
                            new Handler().postDelayed(new Runnable() {
                                @Override
                                public void run() {
                                    Snackbar.make(myToolbar, "You can change your choice later in Settings.", Snackbar.LENGTH_LONG).show();
                                }
                            }, 3500);
*/
                            break;
                        case 2: // ad free
                            // drawer.setSelection(settings, true);
                            goAdFreeChosen = true;
                            drawer.setSelection(DRAWER_IDENTIFIER_SETTINGS, true);

                            params.putString("what", "ad_free");
                            break;
                        case 3: // learn more
                            showLearnMoreDialog(context);

                            params.putString("what", "showLearnMoreDialog");
                            break;
                    }
                    mFirebaseAnalytics.logEvent(CONSENT_COLLECTION, params);
                }
            })
            // .setNegativeButton("Cancel", null)
            .show();
}

如果用户点击了解更多信息(上方菜单中的第4个选项),则会向他们显示所有提供商的列表,他们可以点击以查看其各自的隐私政策:

private void showLearnMoreDialog(final Context context) {
    List<AdProvider> adProviders =
            ConsentInformation.getInstance(context).getAdProviders();

    final CharSequence[] itemsName = new CharSequence[adProviders.size()];
    final String[] itemsURL = new String[adProviders.size()];

    int i = 0;
    for (AdProvider adProvider : adProviders) {

        itemsName[i] = adProvider.getName();
        itemsURL[i] = adProvider.getPrivacyPolicyUrlString();
        i++;
    }

    ArrayAdapter adapter = new ArrayAdapter<>(context,
            android.R.layout.simple_list_item_1, itemsName);

    AlertDialog.Builder builder = new AlertDialog.Builder(context);

    builder.setTitle("Tap on our partners to learn more about their privacy policies")
            .setNegativeButton("Back", null)
            .setSingleChoiceItems(adapter, -1, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                            /*        Toast.makeText(context,
                                            "URL: " + itemsURL[which].toExternalForm(), Toast.LENGTH_SHORT).show();*/
                    Intent browserIntent = new Intent(Intent.ACTION_VIEW,
                            Uri.parse(itemsURL[which]));
                    startActivity(browserIntent);

                    Bundle params = new Bundle();
                    params.putString("what", "showLearnMoreDialog_open_privacy_policy");
                    mFirebaseAnalytics.logEvent(CONSENT_COLLECTION, params);
                }
            })
            .setCancelable(true)
            .setOnDismissListener(new DialogInterface.OnDismissListener() {
                @Override
                public void onDismiss(DialogInterface dialog) {
                    showYesNoDialog(context, false);
                }
            })
            .show();
}

请注意,我也已经在其中实现了Firebase分析,但是如果您不想记录这些事件,则可以删除与“参数”相关的行。

您可以使用此方法查看同意状态:

private void getConsentStatusAndLoadAdAccordingly(final Context context) {
    ConsentInformation consentInformation = ConsentInformation.getInstance(context);
    //   consentInformation.addTestDevice(TEST_DEVICE_FOR_ADS);
    //   consentInformation.setDebugGeography(DebugGeography.DEBUG_GEOGRAPHY_EEA); // for forcing Europe area; testing.
    //   consentInformation.setConsentStatus(ConsentStatus.UNKNOWN); // useful for triggering it after saving status; testing.

    String[] publisherIds = {MY_PUBLISHER_ID};
    consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {
        @Override
        public void onConsentInfoUpdated(ConsentStatus consentStatus) {
            loog("consentInformation", "onConsentInfoUpdated");
            // User's consent status successfully updated.
            if (ConsentInformation.getInstance(context).isRequestLocationInEeaOrUnknown()) {
                loog("consentInformation", "isRequestLocationInEeaOrUnknown = true");
                    /* If the isRequestLocationInEeaOrUnknown() method returns false, the user is not
                    located in the European Economic Area and consent is not required under the EU User Consent Policy.

                    If the isRequestLocationInEeaOrUnknown() method returns true:
                    If the returned ConsentStatus is PERSONALIZED or NON_PERSONALIZED, the user has already provided consent.
                    You can now forward consent to the Google Mobile Ads SDK.
                    If the returned ConsentStatus is UNKNOWN, you need to collect consent. */
                loog("consentInformation", "consentStatus = " + consentStatus);

                if (consentStatus == ConsentStatus.UNKNOWN) {
                    // showGoogleConsentForm(DrawerAndFragmentActivity.this);
                    shouldShowConsentForm = true;
                } else if (consentStatus == ConsentStatus.NON_PERSONALIZED) {
                        /* The default behavior of the Google Mobile Ads SDK is to serve personalized ads. If a user
                    has consented to receive only non-personalized ads, you can configure an AdRequest object
                    with the following code to specify that only non-personalized ads should be returned: */
                    Bundle extras = new Bundle();
                    extras.putString("npa", "1");
                    mInterstitialAd.loadAd(new AdRequest.Builder()
                            .addNetworkExtrasBundle(AdMobAdapter.class, extras)
                            .addTestDevice(TEST_DEVICE_FOR_ADS)
                            .build());
                } else if (consentStatus == ConsentStatus.PERSONALIZED) {
                    mInterstitialAd.loadAd(new AdRequest.Builder()
                            .addTestDevice(TEST_DEVICE_FOR_ADS)
                            .build());
                }
            } else {
                loog("consentInformation", "isRequestLocationInEeaOrUnknown = false");
                mInterstitialAd.loadAd(new AdRequest.Builder()
                        .addTestDevice(TEST_DEVICE_FOR_ADS)
                        .build());
            }
        }

        @Override
        public void onFailedToUpdateConsentInfo(String errorDescription) {
            // User's consent status failed to update.
            loog("consentInformation", "onFailedToUpdateConsentInfo: errorDescription = " + errorDescription);

            mInterstitialAd.loadAd(new AdRequest.Builder()
                    .addTestDevice(TEST_DEVICE_FOR_ADS)
                    .build());
        }
    });
}

最后,当您需要决定是展示广告还是展示同意书时,可以使用如下逻辑:(shouldShowAd是一个可选的布尔值,我想将其放在更清晰的位置)

if (shouldShowAd) {
                            if (shouldShowConsentForm) {
                                if (!goAdFreeChosen)
                                    showConsentDialogIntro(DrawerAndFragmentActivity.this);
                                goAdFreeChosen = false;
                            } else {
                                if (mInterstitialAd != null)
                                    if (mInterstitialAd.isLoaded()) {
                                        mInterstitialAd.show();
                                    }
                            }
                        }