Third-party consent manager
Ogury requires an explicit consent from the user to use their personal data. In addition to our Ogury Choice Manager, the Ogury SDK can collect the consent automatically from third-party consent manager (see case A for more details). Additionally we provide APIs to transmit the consent from third-party consent manager to the Ogury SDK in case it is not compatible with the automatic way (see case B and case C for more details).

Requirements

You have a registered application on your Ogury dashboard. If not, you can refer to the Getting started section before the next steps.
To use automatic TCFV2 string retrieval (case A), make sure you have the SDK version 5.0.7 or latest.

Initialize the Ogury SDK

Before passing the user's consent programmatically (in both case B and case C), you must first initialize the Ogury SDK by calling the start method:
1
OguryConfiguration.Builder oguryConfigurationBuilder = new OguryConfiguration.Builder(this, "OGY-XXXXXXXXXXXX");
2
Ogury.start(oguryConfigurationBuilder.build());
Copied!
The start method takes an OguryConfiguration object as parameters. The OguryConfiguration is built from its Builder which takes the following parameters:
  • the Application context.
  • the Asset Key of your application. If you do not have one yet, you can refer to the Getting started section to create it.

Case A: Your CMP generates a TCFv2 consent string and is compatible with the IAB GDPR Consent Framework

The Ogury SDK (from version 5.0.7) will automatically synchronize the user's consent before each ad request.
The user's consent is read from the Shared preferences as specified in IAB GDPR Consent Framework and synchronized every time the user changes its choices. Your CMP must be initialized before doing any ad request in order for the consent to be retrieved.
Compatible third-party consent managers:
If you are using an Ogury SDK version prior to 5.0.7, you must update your Ogury SDK or use the method in case B.

Case B: Your CMP generates a TCFv2 consent string and is NOT leveraging the IAB GDPR Consent Framework

If your consent notice is registered in the IAB CMP list and produces IAB-specified consent string, but is not leveraging the IAB GDPR Consent Framework you can pass the consent to Ogury SDK.
Call the following method once the consent has been collected after having initialized the Ogury SDK:
1
OguryChoiceManagerExternal.TcfV2.setConsent(iabString, new Integer[0]);
Copied!
The setConsent method takes the following parameters:
The IAB-specified Consent String must be valid and be generated by a whitelisted CMP. Otherwise the call to the setConsent method will be ignored.
If, at any point, user consent is changed, call this method again with updated values.

Integration example

1
public class MyActivity extends Activity {
2
3
@Override protected void onCreate(Bundle savedInstanceState) {
4
super.onCreate(savedInstanceState);
5
6
OguryConfiguration.Builder oguryConfigurationBuilder = new OguryConfiguration.Builder(this, "OGY-XXXXXXXXXXXX");
7
Ogury.start(oguryConfigurationBuilder.build());
8
9
YourCmp.getConsent(this, yourCmpConsentListener);
10
}
11
12
private final YourCmpConsentListener yourCmpConsentListener = new YourCmpConsentListener() {
13
@Override public void onComplete(OguryChoiceManager.Answer answer) {
14
// Transmit the user consent to Ogury
15
OguryChoiceManagerExternal.TcfV2.setConsent(YourCmp.getIabString(), new Integer[0]);
16
17
// and start IronSource and other vendor SDKs
18
}
19
@Override public void onError(OguryError error) {
20
// handle error
21
// and start IronSource and other vendor SDKs
22
}
23
};
24
25
}
Copied!

Case C: Your CMP is not compatible with TCFv2

This feature is submitted to a whitelist. Please contact your account manager before starting using this method.
We provide an alternative programmatic way to provide a true/false user's consent to the Ogury SDK in case of any of the previous methods did not work.
Before using this method, to be compliant with last GDPR requirements, you must include a link to Ogury's Privacy Policy in your own privacy policy.
If you have not done it before, you must initialize the Ogury SDK before calling this method.
1
OguryChoiceManagerExternal.setConsent(consentBoolean, consentManagerName);
Copied!
The setConsent method take the following parameter:
  • a boolean indicating whether the user has consented or not.
  • the name of the consent manager provider collecting the consent. The value must formatted in snake case
    • If you are using a third-party solution, enter the name of this solution in SCREAMING_SNAKE_CASE (all capital letters, space replaced by an underscore).
    • If you are using an in-house solution, use "CUSTOM".
If, at any point, user consent is changed, call this method again with updated values.

Finish your integration

You can go back to the Getting started to finish your integration.