Stay organized with collections
Save and categorize content based on your preferences.
Recent updates to the Google Publisher
Policies
have introduced new notice and consent requirements for publishers who pass
precise location data of users to Google, for ads-related purposes.
If this policy applies to you, the following snippet shows one way you could
inform your users of this data sharing:
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];
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-12 UTC."],[[["Google Publisher Policies have been updated with new notice and consent requirements for publishers sharing users' precise location data for ads."],["Publishers need to inform users about the sharing of their location data with Google for personalized advertising, analytics, and attribution."],["The 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."],["Publishers are responsible for ensuring transparency and accurately informing users about all purposes for which their precise location data is shared."]]],["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"]]