To discuss and provide feedback on our products, join the official AdMob Discord channel in the Google Advertising and Measurement Community server.

Precise location data policy

  • Recent updates to Google Publisher Policies require publishers to provide notice and obtain consent from users when precise location data is shared with Google for ads-related purposes.

  • Publishers who share precise location data need to inform users about this practice.

  • The provided code snippets in Swift and Objective-C offer example implementations for presenting a consent overlay to users regarding location data usage and sharing.

  • The example consent overlay message explains that location data may be used and shared with third parties for personalized advertising, analytics, and attribution.

  • Publishers should customize the provided code snippet to accurately reflect their specific data sharing practices and inform users of all relevant purposes for sharing precise location data.

Select platform: Android iOS

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=[UIAlertController
alertControllerWithTitle:@"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=[UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(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];

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月11日 UTC.