as-ideas / oil

191 stars 56 forks source link

How can I enable oil only for GDPR countries #156

Closed jtamary closed 6 years ago

jtamary commented 6 years ago

Hi,

I saw that in the stub you have a boolean field "gdprAppliesGlobally" for ping if it's supported for all geos or just EU. On the other hand I saw that in the cookie and interface there is a boolean field ''gdprApplies". However, I cannot understand the flow how to show the UI only for EU countries.

Thanks, Jonathan

Waschnick commented 6 years ago

You can only do this with an external service for geo-ip locations. We use this on our own websites to only show the layer for customers from the EU only. As this is an open source project you would need to have this on your own site.

jtamary commented 6 years ago

So I need a service gor geo location, that is not a problem as we have one. But I do not understand how to integrate the result of the geo location service in to OIL.

Waschnick commented 6 years ago

The field "gdprAppliesGlobally" is an information field for vendors/tags/ads and not for the publisher/website. You just can not load oil or you can set the preview_mode: true and change the configuration after you received the geoinformation. It depends on your setup.

You can start with the configuration:

{
  "preview_mode": true
}

And after you know that he is in the EU you can change the configuration and call AS_OIL.reload()

jtamary commented 6 years ago

Thanks Canard for the prompt response.

My issue is that the stub is loaded within the html which will be sent for all users. The script and configuration are loaded from GTM which we can differentiate EU users from other users.

I read in CMP standard that vendors get in the response the "gdprApplies" boolean which should be set within the CMP. From my understanding it is intended that any CMP should pass this flag.

I understand that OIL cannot determine in geo by itself, but can we expose it in the configuration. So it will be up to my implementation for figure the geo but I will pass it with the configuration of OIL.

Love to hear your thoughts :)

phogel commented 6 years ago

Hey thanks for the updates. We discussed this internally and to satisfy this line from the IAB specs:

the publisher has configured the CMP (via a CMP-specific method not specified by this spec) that they are a EU publisher and thus the CMP UI should be shown for everyone.

We concluded that it would be better to rename the parameter to "gdpr_applies_globally".

Reason is that the parameter value would need to be added to the stub as well. The ping() method should return the correct value for gdprAppliesGlobally, which would not be the case if you configure it only on the CMP itself. You'd be required to put the oil-configuration script before the stub script in the html then.

In case somebody wants to override the return value of getGdprApplies on runtime I would add a helper function like AS_OIL.setGdprApplies(bool). The getGdprApplies() function would then return (gdprApplies || gdprAppliesGlobally).

Would you be fine with changing the parameter name to gdpr_applies_globally? Any other thoughts, concerns on this?

jtamary commented 6 years ago

Thanks for the response :)

My scenario is as follows:

  1. On the html I have the stub
  2. On GTM I have my script and configuration (which at this point I can differentiate between EU countries to non EU countries)

Lets see if my scenario works with your proposal for non EU countries and if I understand you correctly. So before the stub I would add a configuration that state gdprAppliesGlobally: true, since I cannot know at this point in time that the user is from a non EU country and I need to wait for the script to load. on GTM after the script is loaded I would run AS_OIL.setGdprApplies(false)? But (gdprApplies || gdprAppliesGlobally) will still return true which is not correct.

Many thanks, Jonathan

ltparis2018 commented 6 years ago

The IAB specification says: The gdprAppliesGlobally parameter says whether you're a publisher in EU (true) or not (false). If you're a publisher in EU the CMP-UI (OIL-UI) is shown for everyone (including non-EU visitors).

If you want to hide the OIL-UI for non-EU visitors you should set gdprAppliesGlobally parameter to false. Then your setting of gdprApplies will be evaluated.

jtamary commented 6 years ago

Cool! Thanks :)

phogel commented 6 years ago

@jtamary Long story short: if you change the parameter name in your PR to "gdpr_applies_globally" instead of just "gdpr_applies" it would be good to merge!

jtamary commented 6 years ago

@phogel done

phogel commented 6 years ago

@jtamary Merged. Thanks a lot!