Opt-in/out

#GDPR

The plugin will immediately start tracking, but it is possible to disable the plugin at the start and enable it later on, maybe after a cookie banner.

import { createApp } from "vue";
import App from "./App.vue";
import VueGtag from "vue-gtag";

createApp(App).use(VueGtag, {
  config: { id: "GA_MEASUREMENT_ID" },
  enabled: false
}).mount("#app");

The gtag.js documentation says that it is possible to download the script if the script is disabled and it won't go against policy rules.

In case you might want to go a little more advanced, you could still opt for the custom bootstrap solution.

Last updated