Multiple domain tracking

The property property can accept an object, but also an array of objects and so it is possible to setup automatically multiple domains tracking out of the box.

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

const app = createApp(App);

app.use(VueGtag, {
  property: [
    { id: 'GA_MEASUREMENT_ID_1' },
    { id: 'GA_MEASUREMENT_ID_2' }
  ]
});

By default the main domain will be the first item of the array, but you can pass the default property as true inside one of the items to make that the main domain.

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

const app = createApp(App);

app.use(VueGtag, {
  property: [
    { id: 'GA_MEASUREMENT_ID_1' },
    { id: 'GA_MEASUREMENT_ID_2', default: true }
  ]
});

With this setup the initial configuration will be sent 2 times and every other event will be fired for both domains.

Last updated