Недавние обновления политик Google для издателей ввели новые требования к уведомлениям и согласию для издателей, которые передают Google точные данные о местоположении пользователей для рекламных целей.
Если эта политика применима к вам, следующий фрагмент показывает один из способов, с помощью которого вы можете проинформировать своих пользователей об этом обмене данными:
Быстрый
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,["Последнее обновление: 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,["# Precise location data policy\n\nSelect 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\n### Swift\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\n### Objective-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."]]