Google の EU ユーザーの同意 ポリシー)を使用するには、 欧州経済領域(EEA)のユーザー向けに特定の情報を開示する Cookie またはその他のローカル ストレージを使用することについて 個人データ(AdID など)を使用して広告を配信する必要がある。 このポリシーには、EU の e プライバシー指令と 一般データ保護規則(GDPR)。
パブリッシャー様がこのポリシーで定められた義務を遂行できるよう、Google では User Messaging Platform(UMP)SDK をご利用ください。UMP SDK が更新され、 対応していますこれらすべての構成を プライバシーと AdMob 説明します。
前提条件
- スタートガイドを完了している。
- GDPR 関連の要件に取り組む場合は、 IAB の要件が EU に与える影響 同意メッセージ
メッセージ タイプを作成する
ユーザー メッセージは、いずれかの 利用可能なユーザー メッセージの種類 [プライバシーと[メッセージ] タブを AdMob あります。UMP SDK は、 アプリケーション ID から AdMob 作成されたユーザー メッセージ 必要があります。アプリケーションにメッセージが構成されていない場合、SDK は エラーが返されます。
詳しくは、 プライバシーとメッセージについて
アプリケーション ID を追加する
アプリケーション ID は、 AdMob 管理画面: ID を これを次のコード スニペットに置き換えます。
同意情報のリクエスト
アプリごとにユーザーの同意情報の更新をリクエストする必要があります
Update()
を使用して起動します。これにより、
ユーザーがまだ同意していない場合に、同意する必要があるかどうか。または、
通知します。
アプリ起動時のステータスの確認方法の例を次に示します。
void Start()
{
// Create a ConsentRequestParameters object.
ConsentRequestParameters request = new ConsentRequestParameters();
// Check the current consent information status.
ConsentInformation.Update(request, OnConsentInfoUpdated);
}
void OnConsentInfoUpdated(FormError consentError)
{
if (consentError != null)
{
// Handle the error.
UnityEngine.Debug.LogError(consentError);
return;
}
// If the error is null, the consent information state was updated.
// You are now ready to check if a form is available.
}
必要に応じて同意フォームを読み込んで表示する
最新の同意ステータスを受け取ったら、
LoadAndShowConsentFormIfRequired()
日付
ConsentForm
クラスを使用して同意フォームを読み込みます。もし
同意ステータスが必須の場合、SDK はフォームを読み込んですぐに表示します
から取得できます。 Action<FormError>
callback
は フォームが閉じられた後に呼び出されます。同意が不要な場合、 Action<FormError>
callback
は直ちに 呼び出されます。
void Start()
{
// Create a ConsentRequestParameters object.
ConsentRequestParameters request = new ConsentRequestParameters();
// Check the current consent information status.
ConsentInformation.Update(request, OnConsentInfoUpdated);
}
void OnConsentInfoUpdated(FormError consentError)
{
if (consentError != null)
{
// Handle the error.
UnityEngine.Debug.LogError(consentError);
return;
}
// If the error is null, the consent information state was updated.
// You are now ready to check if a form is available.
ConsentForm.LoadAndShowConsentFormIfRequired((FormError formError) =>
{
if (formError != null)
{
// Consent gathering failed.
UnityEngine.Debug.LogError(consentError);
return;
}
// Consent has been gathered.
});
}
ユーザーが選択または拒否した後になんらかのアクションを行う必要がある場合
そのロジックを Action<FormError>
callbackに配置します。
選択します。
広告をリクエスト
アプリで広告をリクエストする前に、同意を得ているかどうかを確認してください
CanRequestAds()
を使用してユーザーから取得できます。2 つのモデル
同意を取得する際に確認する項目:
- 現在のセッションで同意が得られたら、
-
Update()
を呼び出した直後。 前回のセッションで同意を取得した可能性があります。レイテンシ おすすめします。コールバックの完了を待たずに、 アプリのリリース後、できるだけ早く広告の読み込みを開始してください。
同意取得プロセス中にエラーが発生した場合でも、 広告をリクエストできます。UMP SDK は、前のステップの あります。
void Start()
{
// Create a ConsentRequestParameters object.
ConsentRequestParameters request = new ConsentRequestParameters();
// Check the current consent information status.
ConsentInformation.Update(request, OnConsentInfoUpdated);
}
void OnConsentInfoUpdated(FormError consentError)
{
if (consentError != null)
{
// Handle the error.
UnityEngine.Debug.LogError(consentError);
return;
}
// If the error is null, the consent information state was updated.
// You are now ready to check if a form is available.
ConsentForm.LoadAndShowConsentFormIfRequired((FormError formError) =>
{
if (formError != null)
{
// Consent gathering failed.
UnityEngine.Debug.LogError(consentError);
return;
}
// Consent has been gathered.
if (ConsentInformation.CanRequestAds())
{
MobileAds.Initialize((InitializationStatus initstatus) =>
{
// TODO: Request an ad.
});
}
});
}
プライバシー設定
一部の同意フォームでは、ユーザーがいつでも同意を変更する必要があります。遵守 必要に応じてプライバシー オプション ボタンを実装できます。
手順は次のとおりです。
- アプリの設定ページのボタンなどの UI 要素を実装する プライバシー オプション フォームをトリガーできます。
- 完了したら
LoadAndShowConsentFormIfRequired()
確認PrivacyOptionsRequirementStatus
プライバシー オプション フォームを提示できる UI 要素です。 - ユーザーが UI 要素を操作すると、
ShowPrivacyOptionsForm()
: ユーザーがフォームを表示できるように ユーザーがいつでもプライバシー オプションを更新できるようにします。
次の例で、プライバシー オプション フォームを
Button
。
[SerializeField, Tooltip("Button to show the privacy options form.")]
private Button _privacyButton;
private void Start()
{
// Enable the privacy settings button.
if (_privacyButton != null)
{
_privacyButton.onClick.AddListener(UpdatePrivacyButton);
// Disable the privacy settings button by default.
_privacyButton.interactable = false;
}
}
/// <summary>
/// Shows the privacy options form to the user.
/// </summary>
public void ShowPrivacyOptionsForm()
{
Debug.Log("Showing privacy options form.");
ConsentForm.ShowPrivacyOptionsForm((FormError showError) =>
{
if (showError != null)
{
Debug.LogError("Error showing privacy options form with error: " + showError.Message);
}
// Enable the privacy settings button.
if (_privacyButton != null)
{
_privacyButton.interactable =
ConsentInformation.PrivacyOptionsRequirementStatus ==
PrivacyOptionsRequirementStatus.Required;
}
});
}
テスト
開発中にアプリで統合をテストする場合は、 テストデバイスをプログラムで登録します。必ず テストデバイス ID を設定するコードを作成します。
-
Update()
を呼び出します。 ログ出力で、次の例のようなメッセージを確認します。 に、デバイス ID と、テストデバイスとして追加する方法が表示されます。
Android
Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("33BE2250B43518CCDA7DE426D04EE231") to set this as a debug device.
iOS
<UMP SDK>To enable debug mode for this device, set: UMPDebugSettings.testDeviceIdentifiers = @[2077ef9a63d2b398840261c8221a0c9b]
テストデバイス ID をクリップボードにコピーします。
コードを変更して
DebugGeography.TestDeviceHashedIds
して渡す テストデバイス ID のリスト。void Start() { var debugSettings = new ConsentDebugSettings { TestDeviceHashedIds = new List<string> { "TEST-DEVICE-HASHED-ID" } }; // Create a ConsentRequestParameters object. ConsentRequestParameters request = new ConsentRequestParameters { ConsentDebugSettings = debugSettings, }; // Check the current consent information status. ConsentInformation.Update(request, OnConsentInfoUpdated); }
地域を強制的に適用する
UMP SDK を使用すると、デバイスが別のデバイスで動作しているかのようにアプリの動作をテストできます。
EEA または英国に居住している( the DebugGeography
field on ConsentDebugSettings
を使用)注:
デバッグ設定はテストデバイスでのみ機能します。
void Start()
{
var debugSettings = new ConsentDebugSettings
{
// Geography appears as in EEA for debug devices.
DebugGeography = DebugGeography.EEA,
TestDeviceHashedIds = new List<string>
{
"TEST-DEVICE-HASHED-ID"
}
};
// Create a ConsentRequestParameters object.
ConsentRequestParameters request = new ConsentRequestParameters
{
ConsentDebugSettings = debugSettings,
};
// Check the current consent information status.
ConsentInformation.Update(request, OnConsentInfoUpdated);
}
同意ステータスをリセットする
UMP SDK でアプリをテストする場合は、
SDK の状態を評価して、ユーザーが初めてインストールする際の動作をシミュレートできるようにします。
SDK には、これを行うための Reset()
メソッドが用意されています。
ConsentInformation.Reset();