vue-gtag
Github
v1
v1
  • Get started
  • Bootstrap options
  • Auto tracking
  • Multiple domain tracking
  • Plugin hooks
  • API
  • Opt-in/out
  • Global namespace
  • Access gtag instance directly
  • Debug
  • Plugin options
  • Methods
    • pageview
    • event
    • screenview
    • customMap
    • purchase
    • linker
    • set
    • time
    • config
    • exception
Powered by GitBook
On this page

Global namespace

With gtag.js it's possible to customize the name of your global gtag instance to avoid conflicting with already installed library instances in your application.

import Vue from "vue";
import VueGtag from "vue-gtag";

Vue.use(VueGtag, {
  config: { id: "UA-1234567-1" },
  globalObjectName: 'foo'
});

From now on the plugin will start using the instance name specified in the options, but you will still be able to use this.$gtag inside your Vue project without any changes.

PreviousOpt-in/outNextAccess gtag instance directly

Last updated 5 years ago