as-ideas / oil

191 stars 56 forks source link

showPreferenceCenter() without cookies #262

Closed ArnaudBDev closed 3 years ago

ArnaudBDev commented 5 years ago

Hi,

I found a strange behavior with "Preference Center" integration as explain in the doc here (v1.3.0): https://oil.axelspringer.com/release/1.3.0/docs/index.html#oil-cpc-api

When I have optin or optout, integration works as expected on my page: image

But when I didn't give consent and I want to see my page with details. I got full page preference center hover my page content: image

In the first case, the html is inserted inside

In the second case, html is inserted at the top of the body.

I look into the code and specially at : oilShowPreferenceCenter function inside userview_modal.js and it seems that if wrapper (.as-oil div) exist it insert it inside else it goes to the entryNode (#oil-preference-center).

artek commented 5 years ago

I think we are having related issue. After calling showPreferenceCenter(), OIL Cookie Preference Center is displayed with labels like label_cpc_heading, label_cpc_purpose_desc, label_button_back instead of the text from the configs or the default text.

Screen Shot 2019-07-24 at 3 41 55 PM
jaljo commented 5 years ago

Hey @artek :wave: I experienced the same problem when I itegrated oil on my project. From what I observed, translation from the config loads well, but default translations are not loaded at all, resulting in labels beeing displayed.

A quick workaround is to provide a translation for every locale, even the en one.