Collect the user consent

As of November 13, 2023, Ogury Choice Manager is deprecated, meaning it will no longer be supported or updated.

Consequently, no new consent notices will be delivered through Ogury Choice Manager's APIs. Therefore, it is strongly advised against using Ogury Choice Manager in new versions of applications. In case you have migrated to a new Consent Management Platform (CMP), ensure that Ogury and its partners are included as vendors.

For earlier versions of applications still using Ogury Choice Manager, the API will maintain its functionality, continuing to return consent for users who have previously responded to a consent notice. This will remain in effect until their consent expires.

Ogury Choice Manager handles user consent collection and storage for all your vendors, with a simple integration, ensuring compliance with the GDPR regulation. Your users are shown a single consent notice giving them the choice of the data they want to share, if any.

As a solution approved by the IAB Transparency and Consent Framework (TCF), Ogury Choice Manager not only meets the letter of the law, but is also aligned with all relevant best practice standards.

But where other solutions draw the line here, Ogury Choice Manager goes one step further by incorporating vendors that fall outside of IAB jurisdiction, including Facebook and Google. The net result is a definitive, one-stop consent notice that covers most vendors available on the market today.

Alternatively, if you already have a consent manager you can transmit the consent through the third-party consent manager integration.

Requirements

You have a registered application on your Ogury Dashboard. If not, please refer to the getting started section before the next steps.

Step 1: Setup Choice Manager SDK

In order to use Ogury Choice Manager you have to setup the SDK first. This method must be called before any other method. We recommend to call setup in AppDelgeate class, function didFinishLaunchingWithOptions before starting any UIViewController.

You can call the setup method as follows:

let config = OguryChoiceManagerConfig.default()
OguryChoiceManager.shared().setup(withAssetKey: "ASSET_KEY", andConfig: config)

The setup method takes the following parameters:

  • the Asset Key of your application. If you do not have one, please refer to the first step.

  • a SDK Config object OguryChoiceManagerConfigneeded to pass versions of frameworks that should be used in SDK. If you don't set config.tcfVersion then TCF version 2 will be used.

To collect the user consent for the all registered vendors, call the ask method in the viewDidLoad of your ViewController.

This method displays a consent notice allowing the user to choose with which vendors and purposes they agree to share data. This notice is only displayed when there is no existing consent status for this user. Otherwise the ask method synchronizes the consent signal and makes it available through the SDK methods.

You can call the ask method as follows:

OguryChoiceManager.shared().ask(with: viewController) { (error, response) in        
    
}

The ask method takes the following parameters:

  • the current ViewController

  • a completionBlock to listen to changes of the consent signal. This completion block provides two parameters :

Theask method must be called at each launch of your application to be sure to have an up-to-date consent status.

Integration example

You must initialize Ogury Ads in the completion block of the ask method to have the user consent for the first ad impression.

Note that the Ogury SDK will only serve non-personalized ads, lowering your expected revenue, if (i) you don't initialize the Ogury Ads in these completion block, or if (ii) an error occurs.

Once the Ogury Ads are correctly initialized, the user consent is automatically synchronized across all Ogury products.

import UIKit
import AppNexusSDK
import OguryChoiceManager
import OguryAds

class ViewController: UIViewController {
    
    func viewDidLoad() {
        //Setup SDK
        let config = OguryChoiceManagerConfig.default()
        OguryChoiceManager.shared().setup(withAssetKey: "ASSET_KEY", andConfig: config)
        // get user consent
        OguryChoiceManager.shared().ask(with: self) { (error, response) in
            // start the Ogury SDK
            OguryAds.shared().setup(withAssetKey: "ASSET_KEY")
            
            ANGDPRSettings.setConsentString(OguryChoiceManager.shared().tcfV2.getIABConsentString());

        }
    }
}

As per the GDPR regulation, publishers need to ensure the users can access and edit their consent choices through their application at any time.

The edit method forces the display of the consent notice and let users update their choices. If an error occurred, nothing is displayed to the user. In this case, you need to handle the error to inform the user.

OguryChoiceManager.shared().edit(with: viewController) { (error, response) in        

}

The edit method takes the following parameters:

  • the current ViewController

  • a completionBlock to listen to changes of the consent signal. This completion block provides two parameters :

We recommend to expose a button to edit the consent in the application settings.

Step 4: Finish your integration

Congratulations! Ogury Choice Manager is now implemented. You can now go back to the getting started section and finish your integration.

Advanced Topics

Possible user answer‌

In the reponse parameter of completion block, you can get the answer of the user through an Answer object. The Answer has one of the following values:

Error handling

If Ogury Choice Manager fails to get the consent signal for any reason during an ask or an edit, the completion block provides an error parameter. This parameter contains the cause of the failure.‌

To get this cause, you can call the following method:

error.code

The error can be one of the following:

Last updated