Google EU 사용자 동의 정책에 따라 유럽 경제 지역 (EEA)과 영국에서 사용자에게 특정 정보를 공개해야 하며, 법적으로 필요한 경우 쿠키 또는 기타 로컬 저장소를 사용하고 개인 정보 (예: 광고 ID)를 사용하여 광고를 게재한다는 점에 대해 EEA 사용자의 동의를 받아야 합니다. 이 정책에는 EU 온라인 개인 정보 보호 지침 및 개인 정보 보호법 (GDPR)의 요구사항이 반영되어 있습니다.
게시자가 이 정책의 의무 조항을 준수할 수 있도록 Google에서는 사용자 메시지 플랫폼 (UMP) SDK를 제공합니다. UMP SDK가 최신 IAB 표준을 지원하도록 업데이트되었습니다. 이제 이러한 모든 구성을 Ad Manager 개인 정보 보호 및 메시지에서 편리하게 처리할 수 있습니다.
기본 요건
- 시작 가이드에 따라 필요한 과정을 완료합니다.
- Ad Manager 계정의 개인 정보 보호 및 메시지 탭에서 메시지를 구성합니다. 자세한 내용은 개인 정보 보호 및 메시지를 참고하세요.
- GDPR 관련 요구사항을 처리하는 경우 IAB 요구사항이 EU 동의 메시지에 미치는 영향
사용자 메시지 유형
지원되는 메시지의 전체 목록은 사용자 메시지 유형 을 참고하세요. 각 메시지 유형을 구현하는 방법에 관한 구체적인 안내는 왼쪽 탐색 메뉴를 참고하세요.
SDK 가져오기
CocoaPods (권장)
UMP SDK는 Google 모바일 광고 SDK 7.64.0부터 Google 모바일 광고 SDK 포드의 종속 항목으로 포함됩니다.
SDK를 iOS 프로젝트로 가져오는 가장 쉬운 방법은 CocoaPods를 사용하는 것입니다. 프로젝트의 Podfile을 열고 다음 행을 앱의 타겟에 추가하세요.
pod 'Google-Mobile-Ads-SDK'
그런 후 다음 명령어를 실행하세요.
pod install --repo-update
CocoaPods를 처음 사용하는 경우에는 Podfile을 생성하고 사용하는 방법에 대한 자세한 내용을 보려면 CocoaPods 사용을 참고하세요.
수동 다운로드
SDK를 가져오는 다른 방법은 수동으로 수행하는 것입니다.
그런 다음 프레임워크를 Xcode 프로젝트로 드래그하여 필요한 경우 항목 복사를 선택합니다.
그런 다음 다음을 사용하여 필요한 모든 파일에 프레임워크를 포함할 수 있습니다.
Swift
import UserMessagingPlatform
Objective-C
#include <UserMessagingPlatform/UserMessagingPlatform.h>
Info.plist 업데이트
Ad Manager의 모바일 앱 섹션에서 앱 ID를 확인합니다.하여
Info.plist
에 추가하세요.
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>
메시지를 표시해야 하는지 결정
양식을 로드하기 전에 requestConsentInfoUpdateWithParameters:completionHandler:
를 사용하여 앱을 실행할 때마다 사용자 동의 정보 업데이트를 요청해야 합니다.
이를 통해 사용자가 아직 동의를 제공하지 않았다면 동의를 제공해야 하는지 또는 동의가 만료되었는지를 판단할 수 있습니다.
다음은 앱 시작 시 상태를 확인하는 방법의 예입니다.
Swift
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Create a UMPRequestParameters object. let parameters = UMPRequestParameters() // Set tag for under age of consent. Here false means users are not under age. parameters.tagForUnderAgeOfConsent = false // Request an update to the consent information. UMPConsentInformation.sharedInstance.requestConsentInfoUpdate( with: parameters, completionHandler: { error in if error != nil { // Handle the error. } else { // The consent information state was updated. // You are now ready to check if a form is // available. } }) }
Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Create a UMPRequestParameters object. UMPRequestParameters *parameters = [[UMPRequestParameters alloc] init]; // Set tag for under age of consent. Here NO means users are not under age. parameters.tagForUnderAgeOfConsent = NO; // Request an update to the consent information. [UMPConsentInformation.sharedInstance requestConsentInfoUpdateWithParameters:parameters completionHandler:^(NSError *_Nullable error) { if (error) { // Handle the error. } else { // The consent information state was updated. // You are now ready to check if a form is // available. } }]; }
가능한 경우 양식 로드
양식을 표시하기 전에 먼저 양식을 사용할 수 있는지 확인해야 합니다. 사용자가 제한적인 광고 추적을 사용 설정했거나 동의 연령 미만으로 태그를 지정한 경우 양식을 사용할 수 없습니다.
양식의 사용 가능 여부를 확인하려면 앞서 만든the formStatus
property on the UMPConsentInformation
instance 를 사용하세요.
그런 다음 래퍼 메서드를 추가하여 양식을 로드합니다.
Swift
// Request an update to the consent information. UMPConsentInformation.sharedInstance.requestConsentInfoUpdate( withParameters: parameters, completionHandler: { [self] error in // The consent information has updated. if error != nil { // Handle the error. } else { // The consent information state was updated. // You are now ready to see if a form is available. let formStatus = UMPConsentInformation.sharedInstance.formStatus if formStatus == UMPFormStatus.available { loadForm() } } }) ... func loadForm() { }
Objective-C
// Request an update to the consent information. [UMPConsentInformation.sharedInstance requestConsentInfoUpdateWithParameters:parameters completionHandler:^(NSError* _Nullable error) { // The consent information has updated. if (error) { // Handle the error. } else { // The consent information state was updated. // You are now ready to see if a form is available. UMPFormStatus formStatus = UMPConsentInformation.sharedInstance .formStatus; if (formStatus == UMPFormStatusAvailable) { [self loadForm]; } } }]; ... - (void) loadForm { }
양식을 로드하려면 the static loadWithCompletionHandler:
method on the UMPConsentForm
class를 사용하세요.
Swift
func loadForm() { // Loads a consent form. Must be called on the main thread. UMPConsentForm.load( withCompletionHandler: { form, loadError in if loadError != nil { // Handle the error } else { // Present the form } }) }
Objective-C
- (void)loadForm { [UMPConsentForm loadWithCompletionHandler:^(UMPConsentForm *form, NSError *loadError) { if (loadError) { // Handle the error } else { // Present the form } }]; }
필요한 경우 양식 제출
양식의 사용 가능 여부를 확인하고 로드한 후에는UMPConsentForm
인스턴스의presentFromViewController:completionHandler:
메서드를 사용하여 양식을 표시하세요.
앞에서UMPConsentInformation
객체를 사용하여consent status 를 확인하고loadForm
메서드를 업데이트합니다.
Swift
func loadForm() { UMPConsentForm.load(withCompletionHandler: { form, loadError in if loadError != nil { // Handle the error. } else { // Present the form. You can also hold on to the reference to present // later. if UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatus.required { form?.present( from: self, completionHandler: { dismissError in if UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatus.obtained { // App can start requesting ads. } // Handle dismissal by reloading form. loadForm(); }) } else { // Keep the form available for changes to user consent. } } }) }
Objective-C
- (void)loadForm { [UMPConsentForm loadWithCompletionHandler:^(UMPConsentForm *form, NSError *loadError) { if (loadError) { // Handle the error. } else { // Present the form. You can also hold on to the reference to present // later. if (UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatusRequired) { [form presentFromViewController:self completionHandler:^(NSError *_Nullable dismissError) { if (UMPConsentInformation.sharedInstance.consentStatus == UMPConsentStatusObtained) { // App can start requesting ads. } // Handle dismissal by reloading form. [self loadForm]; }]; } else { // Keep the form available for changes to user consent. } } }]; }
사용자가 선택하거나 양식을 닫은 후 작업을 실행해야 하는 경우 이 로직을 양식의 완료 핸들러 또는 콜백에 배치합니다.
테스트
지역 강제 설정
UMP SDK는 the debugGeography
property of type UMPDebugGeography
on UMPDebugSettings
를 사용하여 기기가 EEA 또는 영국에 있는 것처럼 앱 동작을 테스트할 수 있는 방법을 제공합니다.
디버그 기능을 사용하려면 앱의 디버그 설정에서 테스트 기기의 해시 ID를 제공해야 합니다. 이 값을 설정하지 않고requestConsentInfoUpdateWithParameters:completionHandler:
를 호출하면 실행 시 앱에서 필수 ID 해시를 로깅합니다.
Swift
let parameters = UMPRequestParameters() let debugSettings = UMPDebugSettings() debugSettings.testDeviceIdentifiers = ["TEST-DEVICE-HASHED-ID"] debugSettings.geography = UMPDebugGeography.EEA parameters.debugSettings = debugSettings UMPConsentInformation.sharedInstance.requestConsentInfoUpdate( with: parameters, completionHandler: { error in ... })
Objective-C
UMPRequestParameters *parameters = [[UMPRequestParameters alloc] init]; UMPDebugSettings *debugSettings = [[UMPDebugSettings alloc] init]; debugSettings.testDeviceIdentifiers = @[ @"TEST-DEVICE-HASHED-ID" ]; debugSettings.geography = UMPDebugGeographyEEA; parameters.debugSettings = debugSettings; [UMPConsentInformation.sharedInstance requestConsentInfoUpdateWithParameters:parameters completionHandler:^(NSError *_Nullable error){ ... }];
UMPDebugGeography
에는 다음 옵션 중 하나로 지리를 강제하는 옵션이 있습니다.
디버그 지리 | 설명 |
---|---|
UMPDebugGeographyDisabled |
디버그 지역 사용 중지됨 |
UMPDebugGeographyEEA |
디버그 기기의 경우 EEA에 지역이 표시됩니다. |
UMPDebugGeographyNotEEA |
디버그 기기의 지역이 EEA에 없는 것으로 표시됩니다. |
디버그 설정은 테스트 기기에서만 작동합니다. 에뮬레이터는 기본적으로 테스트를 기본적으로 사용 설정하므로 기기 ID 목록에 추가할 필요가 없습니다.
동의 상태 재설정
UMP SDK로 앱을 테스트할 때 사용자의 첫 설치 환경을 시뮬레이션할 수 있도록 SDK 상태를 재설정하는 것이 도움이 될 수 있습니다.
SDK는 이를 위한 reset
메서드를 제공합니다.
Swift
UMPConsentInformation.sharedInstance.reset()
Objective-C
[UMPConsentInformation.sharedInstance reset];
UMP SDK를 프로젝트에서 완전히 삭제하기로 결정한 경우에도
reset
를 호출해야 합니다.