v
v
vue-gtag
Github
Search…
v2
Get started
Migration v1 to v2
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
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.
Previous
API
Next
Global namespace
Last modified
1yr ago
Copy link