Get started
vue-gtag documentation page
Last updated
vue-gtag documentation page
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 you start, ensure you have a basic understanding of the Google Global Site Tag (gtag.js). Key parts of the plugin API include links to official documentation for further assistance.
If you encounter difficulties understanding something and the documentation is insufficient, create an issue on GitHub.
I suggest using the `configure` method to install vue-gtag, as it has a smaller initial bundle size and won't add all methods to the Vue instance. While you won't be able to use $gtag in your templates, you can still import each method individually as needed.
Use the `createGtag` method if you wish to install global properties. This will increase the bundle size because all methods will be bundled together when injected into the Vue instance. You will be able to use $gtag in your template.
Use the config property to add additional parameters to your initial config call
The plugin initializes automatically by default but can be delayed if necessary.