AmazingDreams / vue-matomo

Vue plugin for Matomo Analytics
MIT License
278 stars 61 forks source link

Add conditions to tracking #84

Open Vayel opened 3 years ago

Vayel commented 3 years ago

Hi!

Thanks for this project! It would be nice to be able to disable tracking on some pages based on some conditions. For instance, disabling tracking on some pages for users with certain roles (available in the Vuex store for instance).

Currently, we can just disable tracking statically on some pages with meta.analyticsIgnore.

Thanks!

samastur commented 3 years ago

You can do this using by calling .setConsentGiven and .forgetConsentGiven methods.