as-ideas / oil

191 stars 56 forks source link

the event 'oil_shown' is always sent in a certain configuration #191

Closed jtamary closed 6 years ago

jtamary commented 6 years ago

When using the gdprApplies conditionally, the event 'oil_shown' is always sent even when the UI is not shown since it's not a GDPR country.

I think that the problem is because the user haven't opted in if he's not from a GDRP country: https://github.com/as-ideas/oil/blob/d77b22e655a4a1ee4fbbf2a2a7e4b0ebddfd8618/src/scripts/core/core_oil.js#L60

and we check the gdprApplies only in: https://github.com/as-ideas/oil/blob/master/src/scripts/userview/userview_modal.js#L126

but we send the event when optin is false: https://github.com/as-ideas/oil/blob/d77b22e655a4a1ee4fbbf2a2a7e4b0ebddfd8618/src/scripts/core/core_oil.js#L72

Thanks, Jonathan

subsend commented 6 years ago

Hi jtamary, thx you for reporting this. we fixed this issue in https://github.com/as-ideas/oil/commit/a82603388c98fca3cc6cb22f1372f61408485ac5