Awesome Open Source
Awesome Open Source

⚠️ Sorry but vue-analytics is not longer maintained. I would suggest you to switch to vue-gtag. With love, the guy who made the package.


Vue plugin for Google Analytics

Why should I use it?

The plugin isn't just a wrapper of the Google Analytics API, but provides a solution to issues that most of the time you don't want to deal with or you not even know you have to deal with.

For example:

  • Automatic Google Analytics script loading
  • Automatic page tracking
  • Event batching
  • Opt-out from Google Analytics with promise support
  • Multiple domain ID tracking system
  • Vuex support
  • E-commerce API
  • Vue error exception tracking system
  • Debugging API

Does this library support GA4?

Nope! GA4 is only supported by the new gtag.js library which you can find in the vue-gtag package. This package only uses analytics.js which doesn't provide that feature.


Vue ^2.0.0


Google Analytics, GDPR and Vuejs

Vuejs and Google Analytics

Tips & tricks for vue-analytics


npm install vue-analytics

User guide

Issues and features requests

Please drop an issue, if you find something that doesn't work, or a feature request at

Follow me on twitter @matteo_gabriele

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (69,927
vue (4,205
vuejs (1,106
analytics (319
tracking (149
google-analytics (75
vue-plugin (37