Get started
vue-gtag documentation page
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 documentation, 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.
Install
Add plugin to your application
This is the basic installation required to start using the plugin
This is just an example by using the Google Analytics domain ID as a configuration ID, but it is possible to use things like Google Adwords as well, so make sure to read the gtag documentation if you need more insights about what type of tracking code you need to use
After this you will be able to use the gtag
library inside your components contextually by accessing it like this example
Initial config parameters
The config object accepts also a params
property that will add additional parameters to your initial config call
Here is the perfect moment to add the send_page_view property to false if you don't want to send the first page hit on load of your application
Last updated