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.

If you pass precise location data of your users to Google, the Google Publisher Policies provides you with consent requirements and a notice.

If this policy applies to you, the following example sets the title, message, and button text to inform your users of data sharing:

Swift

func presentConsentOverlayFromViewController(_ rootViewController: UIViewController) {
  if (rootViewController == nil) {
    return;
  }

  DispatchQueue.main.async {
    let alert = UIAlertController(title: "TITLE",
        message: "MESSAGE_TEXT",
        preferredStyle: .alert)
    let alertAction = UIAlertAction(title: "BUTTON_TEXT",
        style: .default,
        handler: { _ in
          print("CONSENT_RECEIVED_LOG_MESSAGE")
        }
    )
    alert.addAction(alertAction)
    rootViewController.present(alert, animated: true, completion: nil)
  }
}

// To use the previous function, and if you are in a view controller, call:
presentConsentOverlayFromViewController(self)

Objective-C

- (void)presentConsentOverlayFromViewController:(UIViewController *)rootViewController {
  if (rootViewController == nil) {
    return;
  }

  dispatch_async(dispatch_get_main_queue(), ^{
      UIAlertController *alert = [UIAlertController
          alertControllerWithTitle:@"TITLE"
          message: @"MESSAGE_TEXT"
          preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *ok = [UIAlertAction
          actionWithTitle:@"BUTTON_TEXT"
          style:UIAlertActionStyleDefault
          handler:^(UIAlertAction *action) {
            [alert dismissViewControllerAnimated:YES completion:^{
            NSLog(@"CONSENT_RECEIVED_LOG_MESSAGE");
            }];
          }];

      [alert addAction:ok];
      [rootViewController presentViewController:alert animated:YES completion:nil];
  });
}

// To use the previous function, and if you are in a view controller, call:
[self presentConsentOverlayFromViewController:self];

Replace the following:

  • TITLE: the title of the consent dialog, for example, Location data.
  • MESSAGE_TEXT: the text of the consent dialog, for example:

    We may use your location and share with third parties for the
    purposes of personalized advertising, analytics, and attributions. To learn
    more, visit our privacy policy at example.com.
    
  • BUTTON_TEXT: the text of the consent dialog button, for example, OK.

  • CONSENT_RECEIVED_LOG_MESSAGE: the log message to record when the user gives consent, for example, Consent received.