MatteoGabriele / vue-gtag

Global Site Tag plugin for Vue (gtag.js)
https://matteo-gabriele.gitbook.io/vue-gtag/
MIT License
861 stars 62 forks source link

setting privacy options still creates cookies #508

Open deefeloper opened 1 year ago

deefeloper commented 1 year ago

Using vue-gtag@1.16.1 (as recommended for vue 2.x and installed by using tag @legacy) I see that it still creates 2 cookie values (used to be 3 without the additional flags).

Maybe anybody can help me in understanding why this happens.

The code I use is:

 Vue.use(VueGtag, {
    config: {
      id: config.googleAnalytics,
      params: {
        client_storage: 'none',
        anonymize_ip: true
      }
    }
  }, router);
EstiT commented 1 year ago

If you deny ad_storage and analytics_storage, then the cookies shouldn't appear

this.$gtag.query('consent', 'default', {
        ad_storage: 'denied',
    analytics_storage: 'denied',
})

https://matteo-gabriele.gitbook.io/vue-gtag/v/master/query https://developers.google.com/tag-platform/devguides/consent#set_consent_defaults