Getting started

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 an IAB Transparency and Consent Framework (TCF) approved solution, 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.

Step 1: Register your website

The Asset Key follows the pattern: OGY-XXXXXXXXXXXX, where X is an uppercase letter or digit. In all the following code samples, we will refer to this Asset Key by using the string ASSET_KEY.

Asset key is valid for the domain mentioned during the registration of your asset and all its sub-domain.

Step 2: Integrate Ogury tag

To integrate Choice Manager Web SDK, copy and paste the following snippet in the head tag of your website before all other script tags.

<script>
!function(){"use strict";var a="stub";function i(){a="loading";var t=document.createElement("script")
;t.src="https://www.ogury.mgr.consensu.org/sdk-v2.min.js",t.type="text/javascript",document.head&&document.head.appendChild(t)}
function t(i){var n="string"==typeof i.data;try{var t=n?JSON.parse(i.data):i.data;if(t.__tcfapiCall){var c=t.__tcfapiCall
;window.__tcfapi(c.command,2,function(t,a){var e={__tcfapiReturn:{returnValue:t,success:a,callId:c.callId}};(i.source||window
).postMessage(n?JSON.stringify(e):e,"*")},c.parameter)}}catch(t){}}"function"!=typeof __tcfapi&&(window.__tcfapi=function(){
var t=arguments;if(__tcfapi.a=__tcfapi.a||[],!t.length)return __tcfapi.a;"ping"===t[0]?t[2]({gdprApplies:!0,cmpLoaded:!1,
cmpStatus:a,displayStatus:"hidden",apiVersion:"2.0",cmpVersion:1,cmpId:45,gvlVersion:void 0,tcfPolicyVersion:2},!0
):__tcfapi.a.push([].slice.apply(t))},__tcfapi.msgHandler=t,window.addEventListener("message",t,!1)),function t(){if(
!window.frames.__tcfapiLocator)if(document.body){var a=document.body,e=document.createElement("iframe");e.setAttribute("style",
"display:none"),e.setAttribute("name","__tcfapiLocator"),e.addEventListener("load",i),a.appendChild(e)}else setTimeout(t,5)}()}();
var OGURY_ASSET_KEY = "ASSET_KEY";
</script>

The valueASSET_KEY has to be replaced with the asset key of your registered website.

If you do not have one, please refer to the first step.

You can now use the SDK through the global __tcfapi function. This function is able to manage IAB standard commands. Commands can be called with the following signature:

__tcfapi(Command, version, Callback? Parameter?)

Name

Required

Definition

Command

Yes

The command to be called.

Version

Yes

The TCFVersion that will be used with the command

Callback

No

Function to be called after the execution of the command

Parameter

No

Parameter to be used with the command

Callback is optional, but needs to conform with the following interface:

(result?: Object | string, success?: boolean)

Name

Definition

result

Outcome of a successful call, or the reason of failure

success

Status of the call, false in case of failure, true otherwise

Step 3: Get the user consent

This method is designed to ask the server for the current user's last answer. If the server is unable to retrieve an answer or if the user falls in a case where a notice needs to be displayed, this method will trigger the surfacing of the notice. Otherwise the ask method synchronizes the consent signal and makes it available through the SDK methods.

You can call the ask method as follows:

__tcfapi('ask', 2, callback, [ignored])

When the user saves his preferences or when his previous answer is retrieved on the server, Callback is called with the following interface in first argument:

{
iabString: string // IAB string containing the consent information
isAccepted: boolean // if false, the user has declined every vendor and purpose available
isPartial: boolean // if true, the user has accepted only partially (At least one purpose or vendor)
}

Theask method must be called on each page where you want to collect or use a consent signal to be sure to have an up-to-date consent status.

Integration examples

Call for ask

__tcfapi('ask',
2,
function(result, success) {
if (success) {
// Ask flow is finished or an answer was retrieved
// result contains the following:
// iabString, isAccepted, isPartial
// Custom code
} else {
// An error occured
// Refer to Error Handling page
// Custom code
}
});

Depending on the vendors/tools integrated in your website you may need to forward the consent signal to them. Refer to Step 5: Transmit the consent to vendors' SDKs for more details

Step 4: Allow users to edit their consent

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

The edit method behaves the same way as the ask method but enforces the display. If an error occurred, nothing is displayed to the user. In this case, you need to handle the error to inform the user.

__tcfapi('edit', 2, callback, [ignored])

We recommend to expose a link in your website footer and in your privacy policy allowing your users to edit their preferences

Step 5: Transmit the consent to vendors' SDKs

Ogury Choice Manager is registered to the IAB Europe as a CMP (CMP ID: 45). Our SDK complies with the standard CMP API defined by IAB Transparency and Consent Framework (TCF).

Vendors registered to the IAB Transparency and Consent Framework automatically use Ogury Choice Manager standard API and will take into account the user's consent signal.

Your organisation can be added in the Vendor list if you collect user data. To do so, you first need to add yourself as a vendor in the consent notice. You can then used the vendorId 0 that is reserved to the publisher, and can be used with standard and specifics commands.

For more advanced usage of the consent signal, please refer to API.