humanswitch / consentcookie

Open source AVG solution for websites
Apache License 2.0
27 stars 10 forks source link

Hide omitted trackers #4

Closed tubbynl closed 6 years ago

tubbynl commented 6 years ago

Description

If trackers are omitted in the settings but are specified in the ConsentCookie for the current user, they still are visible

// An example of ConsentCookie initialized with a custom config
ConsentCookie.init({
    'connections': {
      'cc': {
        'initstate': 'disabled'
      },
      'iq': {
        'initstate': 'optout'
      },
      'ga': {
        'initstate': 'disabled'
      }//, Google Tag Manager omitted
      //'gtm': {
        //'initstate': 'disabled'
      //}
    },
    'moreinfolink': 'https://www.humanswitch.io/over/privacy/'
  });
</script>

ConsentCookie content

cc=-1&iq=0&ga=1&gtm=-1

Expected Behavior

I expected the omitted tracker to not-be-shown

Actual Behavior

It shows, if i clean my local cookies it behaves as expected

Possible Fix

don't initialize trackers not mentioned in the init of they are not mentioned in the settings

Workaround

Remove consentcookie cookie

tubbynl commented 6 years ago

lol, de engelse interface deed mij doen schrijven in engelands ;)

StevenChoo commented 6 years ago

That's why I created the template in English :smile:

tubbynl commented 6 years ago

if you are ok with it i'll try to create an pull request

StevenChoo commented 6 years ago

You can always make a pull request. I have not yet had the time to add the contributing info. Just make sure that the code is ES6 and you are using the eslint config provided by the project as code standard.

tubbynl commented 6 years ago

it's somewhat more specific and debate for how to init, it specifically act's on the connection already being present in the ConsentCookie; updated issue accordingly

workaround; remove local cookies, it will reset

StevenChoo commented 6 years ago

fixed by #15