このガイドでは、ターゲティング情報を広告リクエストに提供する方法について説明します。1 つの Android API Demo アプリをダウンロードできます。
前提条件
- スタートガイドを完了している。
RequestConfiguration
RequestConfiguration
グローバルに適用するターゲット設定情報を収集するオブジェクトで、
MobileAds
静的メソッドを使用できます。
リクエストの構成を更新するには、既存の 必要な更新を行って、次のように設定します。
Java
RequestConfiguration requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.build();
MobileAds.setRequestConfiguration(requestConfiguration);
Kotlin
var requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.build()
MobileAds.setRequestConfiguration(requestConfiguration)
子ども向けの設定
児童オンライン プライバシー保護法(Children's Online Privacy Protection Act) (COPPA)、 [子供向け取り扱いタグ]という設定があります このタグを設定すると、この通知が正確であることを証明したことになります かつ、アプリの所有者の正式な代理人である。 この設定を不正使用した場合、アカウントが停止される可能性があることを理解しています。 ログインします。
アプリ デベロッパーは、Google にアプリの情報を 子ども向けコンテンツであることを 確認することもできますGoogle Chat で コンテンツを子ども向けとして取り扱う場合、Google は その広告リクエストで IBA とリマーケティング広告を無効にする。
この設定は、Google Play 開発者サービス SDK のすべてのバージョンで使用できます
RequestConfiguration.Builder.setTagForChildDirectedTreatment(int)
を使用:
setTagForChildDirectedTreatment
に発信TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE
を指定して、 COPPA を遵守するため、子ども向けコンテンツとして扱われます。これにより Android 広告 ID の送信 (AAID)。setTagForChildDirectedTreatment
に発信TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE
は、 COPPA を遵守するため、子ども向けコンテンツとして扱われます。setTagForChildDirectedTreatment
に発信TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED
を指定します。 COPPA に照らして、広告リクエストでコンテンツをどのように取り扱うかを指定します。
次の例は、コンテンツを COPPA を遵守する子ども向けコンテンツ:
Java
RequestConfiguration requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setTagForChildDirectedTreatment(RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE)
.build();
MobileAds.setRequestConfiguration(requestConfiguration);
Kotlin
var requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setTagForChildDirectedTreatment(RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE)
.build()
MobileAds.setRequestConfiguration(requestConfiguration)
同意年齢に満たないユーザー
広告リクエストにマークを付けることで、 欧州経済領域(EEA)に居住し、同意年齢に満たない。この機能は 国際法の一般条項の データ保護規則(GDPR)。なお、 遵守する必要があります欧州連合のガイダンスを確認し、 ご自身で弁護士に依頼することをおすすめしますGoogle のツールは、 特定のパブリッシャーの義務を免除してはいけません。 あります。 GDPR がパブリッシャー様に与える影響について、詳細をご確認ください。
この機能を使用する場合は、欧州の同意年齢に満たないユーザー用の [タグ] が (TFUA)パラメータが広告リクエストに含まれている。このパラメータを指定すると、 すべての広告リクエストに対して、リマーケティングを含むパーソナライズド広告また、 は、広告測定ピクセルや 配信します。
子ども向けの設定と同様に、
TFUA パラメータを設定する RequestConfiguration.Builder
:
setTagForUnderAgeOfConsent()
次のように指定します。
setTagForUnderAgeOfConsent()
にTAG_FOR_UNDER_AGE_OF_CONSENT_TRUE
で発信 その広告リクエストを 欧州経済領域(EEA)に居住し、また、 Android の広告 ID と (AAID)。setTagForUnderAgeOfConsent()
にTAG_FOR_UNDER_AGE_OF_CONSENT_FALSE
で発信 その広告リクエストで広告の処理を行わないように指定します。 (同意年齢に満たない)setTagForUnderAgeOfConsent()
に発信TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED
は、メッセージがまだ入力されていない では、広告リクエストを 欧州経済領域(EEA)に居住し、同意年齢に満たない。
次の例は、広告リクエストに TFUA を含める必要があることを示しています。
Java
RequestConfiguration requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setTagForUnderAgeOfConsent(RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE)
.build();
MobileAds.setRequestConfiguration(requestConfiguration);
Kotlin
var requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setTagForUnderAgeOfConsent(RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE)
.build()
MobileAds.setRequestConfiguration(requestConfiguration)
子ども向けの設定を有効にするタグ
と setTagForUnderAgeOfConsent()
の両方を同時に true
に設定しないでください。
設定されている場合は、子供向けの設定が優先されます。
広告コンテンツのフィルタリング
Google Play の不適切な広告に関するポリシーに準拠する 1 つの広告内の関連付けられたオファー、すべての広告、関連付けられたオファーを含む アプリ内に提示する特典が、コンテンツに適したものである必要があります。 評価: (コンテンツ自体がその他の点で Google に準拠している場合でも) Play のポリシー。
広告レーティングの上限などのツールを使用すると、 表示される広告のコンテンツです。コンテンツのレーティングの上限は、 プラットフォーム ポリシーの遵守に役立ちます。
アプリでは、
setMaxAdContentRating
メソッドを呼び出します。これが設定されている場合に返される AdMob 広告のコンテンツのレーティングが
なります。このネットワーク追加パラメータに指定できる値は、
デジタル コンテンツ ラベルの分類。次のいずれかである必要があります。
文字列:
MAX_AD_CONTENT_RATING_G
MAX_AD_CONTENT_RATING_PG
MAX_AD_CONTENT_RATING_T
MAX_AD_CONTENT_RATING_MA
次のコードは、RequestConfiguration
オブジェクトを構成して、
返される広告コンテンツが、デジタル コンテンツ ラベルの「No」
G
より大きい:
Java
RequestConfiguration requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setMaxAdContentRating(RequestConfiguration.MAX_AD_CONTENT_RATING_G)
.build();
MobileAds.setRequestConfiguration(requestConfiguration);
Kotlin
var requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setMaxAdContentRating(RequestConfiguration.MAX_AD_CONTENT_RATING_G)
.build()
MobileAds.setRequestConfiguration(requestConfiguration)
以下の詳細を確認する
パブリッシャー様のプライバシーの取り扱い(ベータ版)
「
パブリッシャー様のプライバシーの取り扱い
(PPT)API は、広告をオフにするかどうかをアプリが指定できるようにするオプションのツールです
すべての広告リクエストで
setPublisherPrivacyPersonalizationState()
メソッドを使用します。
この機能を使用する場合、パブリッシャーのプライバシー保護(PPT)パラメータは次のとおりです。
そのセッションの残りの部分に対する今後のすべての広告リクエストに含まれる。
デフォルトでは、Google への広告リクエストにはパーソナライズド広告が配信されます。次の すべての広告リクエストで広告のパーソナライズがオフになるコード:
Java
RequestConfiguration requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setPublisherPrivacyPersonalizationState(PublisherPrivacyPersonalizationState.DISABLED)
.build();
MobileAds.setRequestConfiguration(requestConfiguration);
Kotlin
var requestConfiguration = MobileAds.getRequestConfiguration()
.toBuilder()
.setPublisherPrivacyPersonalizationState(PublisherPrivacyPersonalizationState.DISABLED)
.build()
MobileAds.setRequestConfiguration(requestConfiguration)
広告リクエスト
AdManagerAdRequest
オブジェクトはターゲティングを収集します。
広告リクエストで送信される情報です
カスタムのターゲット設定
カスタムの Key-Value ペアを渡して、Google アド マネージャーのキャンペーン(
items)を AdManagerAdRequest.Builder.addCustomTargeting()
で指定:
Java
// Example: Pass custom targeting "age=25".
AdManagerAdRequest newRequest = new AdManagerAdRequest.Builder()
.addCustomTargeting("age", "25")
.build();
Kotlin
// Example: Pass custom targeting "age=25".
var newRequest = AdManagerAdRequest.Builder()
.addCustomTargeting("age", "25")
.build()
1 つのキーに複数の値を文字列のリストとして渡すことができます。たとえば、 ターゲットとしています
.addCustomTargeting("age", Arrays.asList("24", "25", "26"))
アド マネージャーのカスタム ターゲティングの例をご確認ください。 をご覧ください。
カテゴリの除外
リクエストにスロットレベルのカテゴリの除外レベルを追加するには、
addCategoryExclusion()
メソッド(AdManagerAdRequest.Builder
提供):
Java
// Example: Exclude "automobile" and "boat" categories.
AdManagerAdRequest newRequest = new AdManagerAdRequest.Builder()
.addCategoryExclusion("automobile")
.addCategoryExclusion("boat")
.build();
Kotlin
// Example: Exclude "automobile" and "boat" categories.
var newRequest = AdManagerAdRequest.Builder()
.addCategoryExclusion("automobile")
.addCategoryExclusion("boat")
.build()
アド マネージャーのカテゴリの除外の例をご覧ください。 をご覧ください。
パブリッシャー指定の識別子
フリークエンシー キャップで使用するパブリッシャー指定の識別子(PPID)を設定できます。 オーディエンス セグメンテーションとターゲティング、広告の順次ローテーションなど オーディエンスに基づいて各種デバイスへの広告配信を管理する。
PPID の設定例を次に示します。
Java
AdManagerAdRequest adRequest = new AdManagerAdRequest.Builder()
.setPublisherProvidedId("AB123456789")
.build();
Kotlin
var adRequest = AdManagerAdRequest.Builder()
.setPublisherProvidedId("AB123456789")
.build()
アド マネージャーの PPID のサンプルをご覧ください。 をご覧ください。 API デモアプリ。
パブリッシャー提供のシグナル
オーディエンス データとコンテキスト データは、 パブリッシャー提供のシグナル 使用することをおすすめしますパブリッシャー提供のシグナルを使用すると、ユーザーデータを使用して オーディエンスの特性を伝えて プログラマティック収益化を のビッダー 取引タイプ: 標準の分類で利用でき、ユーザー ID を共有する必要がありません。対象オーディエンス 行動やインタレスト ベースのデータ(IAB オーディエンス 分類 1.1)とコンテキスト (IAB コンテンツの分類 2.2)をご覧ください。
Java
Bundle extras = new Bundle();
// Set the demographic to an audience with an "Age Range" of 30-34 and an
// interest in mergers and acquisitions.
extras.putIntegerArrayList("IAB_AUDIENCE_1_1", arrayListOf(6,284));
// Set the content to sedan, station wagon and SUV automotive values.
extras.putIntegerArrayList("IAB_CONTENT_2_2", arrayListOf(4,5,6));
AdManagerAdRequest request = new AdManagerAdRequest.Builder()
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
.build()
Kotlin
val extras = Bundle()
// Set the demographic to an audience with an "Age Range" of 30-34 and an
// interest in mergers and acquisitions.
extras.putIntegerArrayList("IAB_AUDIENCE_1_1", arrayListOf(6,284))
// Set the content to sedan, station wagon and SUV automotive values.
extras.putIntegerArrayList("IAB_CONTENT_2_2", arrayListOf(4,5,6))
val request = AdRequest.Builder()
.addNetworkExtrasBundle(AdMobAdapter::class.java, extras)
.build()
コンテンツの URL
コンテンツ ターゲット広告とブランド保護のためにコンテンツの URL を提供するには、
setContentUrl()
AdManagerAdRequest
をビルドする場合:
Java
AdManagerAdRequest.Builder builder = new AdManagerAdRequest.Builder();
builder.setContentUrl("https://www.example.com");
AdManagerAdRequest request = builder.build();
Kotlin
val builder = AdManagerAdRequest.Builder()
builder.setContentUrl("https://www.example.com")
val request = builder.build()
ブランド保護(ベータ版)
さまざまなユーザーを対象とした動的コンテンツを表示するアプリケーションの場合、
URL の短いリストを指定できます。
setNeighboringContentUrls()
メソッドを以下のようにビルドします。AdManagerAdRequest
Java
ArrayList<String> urls = new ArrayList<String>();
urls.add("https://www.mycontenturl1.com");
urls.add("https://www.mycontenturl2.com");
urls.add("https://www.mycontenturl3.com");
urls.add("https://www.mycontenturl4.com");
AdManagerAdRequest requestWithContent = new AdManagerAdRequest.Builder()
.setNeighboringContentUrls(urls)
.build();
Kotlin
var urls = mutableListOf("https://www.mycontenturl1.com", "https://www.mycontenturl2.com",
"https://www.mycontenturl3.com", "https://www.mycontenturl4.com")
var requestWithContent = AdManagerAdRequest.Builder()
.setNeighboringContentUrls(urls)
.build()
.setNeighboringContentUrls()
が .setContentUrl()
と異なる点は、
使用されます