Last updated
Last updated
The global site tag (gtag.js) is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform. For general gtag.js , read the gtag.js developer guide.
Before starting make sure to know the basic of Google global site tag (gtag.js) already. Important parts of the plugin API have their link to the official documentation to help you out.
Whenever you don't understand something and the documentation lacks information, just create an issue on Github.
Requires Vue 3 installed
This version will be released after vue-gtag@2 major release for Vue 3
There are few ways to install the plugin. The easiest way is to directly pass the property
object when the plugin is installed. This object accepts an id
which is mandatory to bootstrap the tracking system.
During the initial configuration, anything that goes inside the params
object will be attached to the initial config
call.
For example you can pass the user_id
, send_page_view
, the linker
object or anything else you need. Just check the official documentation for that.
Since most of the time this plugin is used for Single Page Applications, the initial configuration will pass send_page_view
as false
by default to manual track pageviews but it can be overwritten.
All other available are listed here and they are all modifiable via Composition Api at any moment.
click for the official manual pageview documentation
vue-gtag documentation page