humanswitch/consentcookie

Hide omitted trackers

Closed this issue · 6 comments

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

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

That's why I created the template in English 😄

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

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.

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

fixed by #15