as-ideas / oil

191 stars 56 forks source link

Withdraw consent #267

Closed danielstockton closed 3 years ago

danielstockton commented 5 years ago

In order to be compliant, the user should be able to withdraw consent. However, there doesn't seem to be any documented way of re-opening the CMP after choices have been made. There should be an API to re-open the overlay and change the settings, other than clearing the cookie.

danielstockton commented 5 years ago

The workaround I found was to read the value of the cookie and remember it, call AS_OIL.triggerOptOut() and AS_OIL.reload(), and then re-save the cookie with the previous data.

david-robinson-practiceweb commented 4 years ago

@danielstockton It looks like the functionality you need is documented at https://oil.axelspringer.com/release/1.3.5/docs/index.html#oil-cpc-api

Essentially you add a div container with id oil-preference-center and a CTA/link which invokes window.AS_OIL.showPreferenceCenter() Rather than opening the overlay again it embeds the same CMP interface in the container.

They have an example at http://oil.axelspringer.com/demos/cpc-integrated-in-page.html - after completing the initial consent activity, click on the small "Insert CPC" to add the embedded CPC