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

optOut() is not working #402

Open dn-achim opened 2 years ago

dn-achim commented 2 years ago

Description

Calling this.$gtag.optOut() has no effect.

Expected behavior

After this.$gtag.optOut() tracking should be inactive.

Actual behavior

Tracking continues.

When using optOut(), which is a wrapper of disable(false), the value of config.id is null. So the window property is not set correctly:

window[ga-disable-null]: true

Environment

npm ls vue-gtag: vue-gtag@1.16.1

dasheck0 commented 2 years ago

Can confirm. Also not working for me. npm ls vue-gtag: vue-gtag@2.0.1

EDIT: Since I have a Vue3 project I refactored to vue-gtag-next works like a charm.