GDPR

General information

The General Data Protection Regulation (GDPR) came into effect in the spring of 2018. GDPR regulates how information about citizens of the European Economic Area and Switzerland can be collected and processed. Its intention is to protect the privacy of confidential data and to ensure the transparency of all processes related to the collection, storage and processing of information on the internet.

The GDPR has an extraterritorial scope that applies to all companies that process the personal data of citizens of the European Economic Area and Switzerland, regardless of where the company is located.

Starting from version 2.11.0, the Yandex Mobile Ads SDK allows you to restrict the collection of data for users located in the European Economic Area and Switzerland who do not consent to data collection.

Quick guide

The user's consent for processing personal data must be sent to the SDK each time the application is launched.

  1. Follow the instructions for connecting the Mobile Ads SDK.
  2. Show a window where the user can accept the user agreement for personal data processing (for more information, see the example).

    Attention.

    This code is a sample, not a step-by-step guide to follow.

    ...
    // Example of creating a dialog window.
    - (void)showGDPRDialog
    {
        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
                                                                                 message:message
                                                                          preferredStyle:UIAlertControllerStyleActionSheet];
        UIAlertAction *acceptAction = [UIAlertAction actionWithTitle:@"Accept"
                                                               style:UIAlertActionStyleDefault
                                                             handler:^(UIAlertAction *action) {
                                                                 [self setUserConsent:YES];
                                                             }];
        [alertController addAction:acceptAction];
        UIAlertAction *declineAction = [UIAlertAction actionWithTitle:@"Decline"
                                                               style:UIAlertActionStyleDefault
                                                             handler:^(UIAlertAction *action) {
                                                                 [self setUserConsent:NO];
                                                             }];
        [alertController addAction:declineAction];
        UIAlertAction *openPrivacyPolicyAction = [UIAlertAction actionWithTitle:@"View privacy policy"
                                                                          style:UIAlertActionStyleDefault
                                                                        handler:^(UIAlertAction *action) {
                                                                            [[UIApplication sharedApplication] openURL:privacyPolicyURL];
                                                                        }];
        [alertController addAction:openPrivacyPolicyAction];
        [self presentViewController:alertController animated:YES completion:nil];
    }
    
    - (void)setUserConsent:(BOOL)userConsent
    {
        [[NSUserDefaults standardUserDefaults] setBool:userConsent forKey:kGDPRUserConsentKey];
    }
    
    - (void)initializeAdsSDK
    {
        BOOL userConsent = [[NSUserDefaults standardUserDefaults] boolForKey:kGDPRUserConsentKey];
        [YMAMobileAds setUserConsent:userConsent];
    }
  3. Use the + setUserConsent: method to pass the received value to the Mobile Ads SDK. Data of users located in the GDPR region will be processed only if the user consents to data processing.