as-ideas / oil

191 stars 56 forks source link

add gdprApplies config and wire it to consent #158

Closed jtamary closed 6 years ago

jtamary commented 6 years ago

Add gdpr applies boolean to config.

This is a simple way to disable vendor consent in CMP for non eu countries. Vendors should honor this configuration as it state in the CMP standard, which the CMP passes the boolean in the cookie and consent.

Related to #156

Love to hear your thoughts.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 364


Files with Coverage Reduction New Missed Lines %
dist/oil.bundle.js 301 23.07%
<!-- Total: 301 -->
Totals Coverage Status
Change from base Build 360: 0.8%
Covered Lines: 934
Relevant Lines: 3284

💛 - Coveralls
phogel commented 6 years ago

@jtamary I have added some functionality. Could you have a look? The expected behaviour is still a bit unclear:

Should the layer remain hidden if gdpr_applies_globally is false? You had a method in an earlier commit named shouldShowOilLayer but removed it again with the last one.

Check the file /demo/gdpr-applies-false.html for how I was thinking this should work: gdpr_applies_globally is false, then you can execute AS_OIL.setGdprApplies(true) and AS_OIL.reload() to display the layer to users that should see it.

However, the test fails. You can test manually by running npm run restart and point your browser to http://localhost:8080/demos/gdpr-applies-false.html – the layer should not show but it is there.

jtamary commented 6 years ago

The layer should remain hidden if gdpr_applies_globally is false. My scenario is very similar to what you've stated. I just need to make sure that the vendors will wait for AS_OIL.setGdprApplies(true) otherwise, they will get gdprAppplies send data for EU users without consent. I think that we could make it work if we set AS_OIL.setGdprApplies(true) before the actual script is loaded.

Again many thanks :)

phogel commented 6 years ago

You can now "activate" GDPR by running AS_OIL.applyGDPR() when the global is set to false.

Somehow our changes are breaking other e2e tests – am working on fixing that now. Should be done in a bit!

phogel commented 6 years ago

@subsend @ltparis2018 Unit tests and e2e tests on Chrome are green