Untuk mendiskusikan dan memberikan masukan tentang produk kami, bergabunglah ke channel Discord AdMob resmi di server Komunitas Iklan dan Pengukuran Google.
Pembaruan terbaru pada Kebijakan Penayang Google telah memperkenalkan persyaratan izin dan pemberitahuan baru bagi penayang yang meneruskan data lokasi presisi pengguna ke Google, untuk tujuan terkait iklan.
Jika kebijakan ini berlaku untuk Anda, cuplikan berikut menunjukkan salah satu cara Anda dapat memberi tahu pengguna tentang berbagi data ini:
Swift
funcpresentConsentOverlayFromViewController(_rootViewController:UIViewController){if(rootViewController==nil){return;}DispatchQueue.main.async{letalert=UIAlertController(title:"Location data",message:""" We may use your location, and share it with third parties, for the purposes of personalized advertising, analytics, and attribution. To learn more, visit our privacy policy at https://myapp.com/privacy. """,preferredStyle:.alert)letalertAction=UIAlertAction(title:"OK",style:.default,handler:{_in// TODO: replace the below log statement with code that specifies how// you want to handle the user's acknowledgement.print("Got consent.")})alert.addAction(alertAction)rootViewController.present(alert,animated:true,completion:nil)}}// To use the above function assuming you are in a view controller:presentConsentOverlayFromViewController(self)
Objective-C
-(void)presentConsentOverlayFromViewController:(UIViewController*)rootViewController{if(rootViewController==nil){return;}dispatch_async(dispatch_get_main_queue(),^{UIAlertController*alert=[UIAlertControlleralertControllerWithTitle:@"Location data"message:@"We may use your location, and share it with third parties,"@"for the purposes of personalized advertising, analytics, and attribution."@"To learn more, visit our privacy policy at https://myapp.com/privacy."preferredStyle:UIAlertControllerStyleAlert];UIAlertAction*ok=[UIAlertActionactionWithTitle:@"OK"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction*action){[alertdismissViewControllerAnimated:YEScompletion:^{// TODO: replace the below log statement with code that specifies// how you want to handle the user's acknowledgement.NSLog(@"Got consent.");}];}];[alertaddAction:ok];[rootViewControllerpresentViewController:alertanimated:YEScompletion:nil];});}// To use the previous function assuming you are in a view controller:[selfpresentConsentOverlayFromViewController:self];
[null,null,["Terakhir diperbarui pada 2025-08-27 UTC."],[[["\u003cp\u003eGoogle Publisher Policies have been updated with new notice and consent requirements for publishers sharing users' precise location data for ads.\u003c/p\u003e\n"],["\u003cp\u003ePublishers need to inform users about the sharing of their location data with Google for personalized advertising, analytics, and attribution.\u003c/p\u003e\n"],["\u003cp\u003eThe provided code snippets (Swift and Objective-C) offer examples of how to present a consent overlay to users, but should be customized to reflect the publisher's specific data sharing practices.\u003c/p\u003e\n"],["\u003cp\u003ePublishers are responsible for ensuring transparency and accurately informing users about all purposes for which their precise location data is shared.\u003c/p\u003e\n"]]],["Google Publisher Policies now require publishers to notify users and obtain consent before sharing precise location data for ad-related purposes. The provided code examples (Swift and Objective-C) demonstrate presenting an alert to users, informing them that their location might be used and shared for personalized advertising, analytics, and attribution. Users can acknowledge this information by selecting 'OK'. Publishers should customize the alert to match their data practices and replace the example handling with their chosen method.\n"],null,["Select platform: [Android](/admob/android/privacy/precise-location \"View this page for the Android platform docs.\") [iOS](/admob/ios/privacy/precise-location \"View this page for the iOS platform docs.\")\n\n\u003cbr /\u003e\n\nRecent updates to the [Google Publisher\nPolicies](//support.google.com/adsense/answer/9335564#use_of_device_and_location_data)\nhave introduced new notice and consent requirements for publishers who pass\nprecise location data of users to Google, for ads-related purposes.\n\nIf this policy applies to you, the following snippet shows one way you could\ninform your users of this data sharing: \n\nSwift \n\n```swift\nfunc presentConsentOverlayFromViewController(_ rootViewController: UIViewController) {\n if (rootViewController == nil) {\n return;\n }\n\n DispatchQueue.main.async {\n let alert = UIAlertController(title: \"Location data\",\n message: \"\"\"\n We may use your location, and share it with third parties,\n for the purposes of personalized advertising, analytics,\n and attribution.\n To learn more, visit our privacy policy at https://myapp.com/privacy.\n \"\"\",\n preferredStyle: .alert)\n let alertAction = UIAlertAction(title: \"OK\",\n style: .default,\n handler: { _ in\n // TODO: replace the below log statement with code that specifies how\n // you want to handle the user's acknowledgement.\n print(\"Got consent.\")\n }\n )\n alert.addAction(alertAction)\n rootViewController.present(alert, animated: true, completion: nil)\n }\n}\n\n// To use the above function assuming you are in a view controller:\npresentConsentOverlayFromViewController(self)\n```\n\nObjective-C \n\n```objective-c\n- (void)presentConsentOverlayFromViewController:(UIViewController *)rootViewController {\n if (rootViewController == nil) {\n return;\n }\n\n dispatch_async(dispatch_get_main_queue(), ^{\n UIAlertController *alert = [UIAlertController\n alertControllerWithTitle:@\"Location data\"\n message: @\"We may use your location, and share it with third parties,\"\n @\"for the purposes of personalized advertising, analytics, and attribution.\"\n @\"To learn more, visit our privacy policy at https://myapp.com/privacy.\"\n preferredStyle:UIAlertControllerStyleAlert];\n UIAlertAction *ok = [UIAlertAction\n actionWithTitle:@\"OK\"\n style:UIAlertActionStyleDefault\n handler:^(UIAlertAction *action) {\n [alert dismissViewControllerAnimated:YES completion:^{\n // TODO: replace the below log statement with code that specifies\n // how you want to handle the user's acknowledgement.\n NSLog(@\"Got consent.\");\n }];\n }];\n\n [alert addAction:ok];\n [rootViewController presentViewController:alert animated:YES completion:nil];\n });\n}\n\n// To use the previous function assuming you are in a view controller:\n[self presentConsentOverlayFromViewController:self];\n```\n| **Key Point:** This snippet is only an example. Make sure to customize the snippet to accurately reflect your data sharing practices, so users are informed of all the relevant purposes for which you share their precise location data."]]