Basic Functions

Cookie Data

The Opt-In Layer sets a cookie that stores all necessary data about user's consents. It ensure traceability in terms of an audit trail. See current cookie here:

Opt-In given:
OIL version:
Locale Variant Name:
Locale Variant Version:
Custom Purpose Ids:
Consent String:
Reset Consents

If you have given the consent and want to show oil banner again, click on the reset button. All your consent data will be removed immediately.

Simulate Banner Timeout

Oil banner supports auto-hide feature using configuration parameter 'timeout'. You can try it out yourself by entering timeout value in seconds in the field below and clicking start button.

Cookie Preference Center (CPC)

You can add an integrated version of the OIL Cookie Preference Center to your page to give the user the chance to reverse his initial selection (or even Opt-Out).

CMP Api Call getVendorConsents()

From specification Consent Management Provider JavaScript API v1.1: Transparency & Consent Framework:
The vendorIds array contains the vendor ids (as identified in the Global Vendor List) for which consent is being requested. If vendorIds is null or empty, the operation will return consent status for all vendors in the vendor list. The callback function will be called with a VendorConsents object as the parameter. If vendorIds is provided and not empty, then VendorConsents.vendorConsents will only included IDs from vendorIds, The callback is called only after consent is obtained from the UI or existing cookies. The consent will be returned false ("No Consent") for any invalid vendorId. The boolean success parameter passed to the callback indicates whether the call to getVendorConsents() was successful.

Invoke the getVendorConsents() command as follows:

  • Without vendor ids: __cmp('getVendorConsents', null, (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });
  • With vendor ids: __cmp('getVendorConsents', [8, 12, 28], (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });

Enter a comma separated list of vendor ids (empty list is allowed), click button and see what OIL layer currently returns for getVendorConsents() calls:

CMP Api Call getConsentData()

From specification Consent Management Provider JavaScript API v1.1: Transparency & Consent Framework:
If consentStringVersion is provided, then fetch that version if available (else returns null). If consentStringVersion is null, then the latest supported version of the consent string is returned. The callback is called only after consent is obtained from the UI or existing cookies. The boolean success parameter passed to the callback indicates whether the call to getConsentData() was successful.

Invoke the getConsentData() command as follows:

  • Without consent string version: __cmp('getConsentData', null, (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });
  • With consent string version (currently only '1' is possible): __cmp('getConsentData', '1', (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });

Enter a consent string version (empty string is allowed), click button and see what OIL layer currently returns for getConsentData() calls:

CMP Api Call ping()

From specification Consent Management Provider JavaScript API v1.1: Transparency & Consent Framework:
The "ping" command invokes the callback immediately with information about whether the main CMP script has loaded yet and if GDPR has been configured for all users or just EU users. (This requires this command's implementation and this configuration to be in the stub).

Invoke the ping() command as follows: __cmp('ping', null, (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });

Here is what OIL layer currently returns for ping() calls:

Success:
Result:

      

CMP Api Call getPublisherConsents()

From specification Consent Management Provider JavaScript API v1.1: Transparency & Consent Framework:
The purposeIds lists the purpose ids the publisher is requesting consent for. If this array is null or empty, it will default to all configured purposes. PurposeId's 1-24 indicate standard purposes, while 25-88 indicate custom (publisher-configured) purposes. The callback function will be called with a PublisherConsents object as the parameter. The purpose ids would be set by the publisher using a CMP-defined initialization function. The callback is called only after consent is obtained from the UI or existing cookies. The boolean success parameter passed to the callback indicates whether the call to getPublisherConsents() was successful.

Invoke the getPublisherConsents() command as follows:

  • Without purpose ids: __cmp('getPublisherConsents', null, (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });
  • With purpose ids: __cmp('getPublisherConsents', [1, 2, 28], (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });

Enter a comma separated list of purpose ids (empty list is allowed), click button and see what OIL layer currently returns for getPublisherConsents() calls:

CMP Api Call getVendorList()

From specification Consent Management Provider JavaScript API v1.1: Transparency & Consent Framework:
The callback function will be called with the GlobalVendorList parameter being the vendor list object of the requested version. If the vendorListVersion is null, the vendor list for the vendorListVersion in the current consent string is returned. If no consent string value is currently set, the latest version of the vendor list is returned. If the vendorListVersion value is ?LATEST?, the latest version available is returned. If the vendorListVersion is invalid, the callback function will be called with 'null' as the first argument and false as the success argument. The boolean success parameter passed to the callback indicates whether the call to getVendorList() was successful.
NOTE: Parameter vendorListVersion is currently not supported by OIL!

Invoke the getVendorList() command as follows: __cmp('getVendorList', null, (result, success) => { console.log('success ' + success + '; result = ' + JSON.stringify(result)) });

Here is what OIL layer currently returns for getVendorList() calls:

Success:
Result:

      

Soft Blocking of <script> tags

Example code for managed <script> tags:
    <script data-managed="as-oil"
            data-type="text/javascript"
            data-purposes="1"
            type="as-oil"
            id="managedScriptTag">
      document.getElementById("demoText").innerHTML = "This text will be shown with given consent!";
    </script>
          
    <script data-managed="as-oil"
            data-type="text/javascript"
            data-src="oilDemoScript.js"
            data-purposes="1"
            type="as-oil"
            id="managedScriptTag">
    </script>
          
Try it out!

If OIL layer is currently shown, click 'OK' to give consent. Otherwise, click the 'Reset' button!


Soft Blocking of <img> tags

Example code for a managed <img> tag:
    <img data-managed="as-oil"
         data-src="simpleImage.png"
         data-title="Simple Image"
         data-display="block"
         data-purposes="1"
         alt="A simple image"
         height="50"
         width="50"
         id="imgId"
         class="imgClass"
         style="border: 1px solid #ddd; border-radius: 10px;">
          
Try it out!

If OIL layer is currently shown, click 'OK' to give consent. Otherwise, click the 'Reset' button!



A simple image