Vuejs and Google Analytics

Matteo Gabriele
Apr 22, 2017 · 1 min read

Track all your pages with 5 lines of code

Few months ago I started creating apps with Vuejs and something that you have to face sooner or later is tracking with Google Analytics.

There were no libraries yet available for this purpose, because the community around Vue it’s still kind of young, compared to library like React, and so I just published one myself: vue-analytics

Long story short, now I’m at version 4 of this plugin and here is how you can track your entire application with 5 lines of code

That’s it! You can commit, push and go grab a beer!


Obviously the plugin does more than that, like: tracking events, timings, social interactions, error exceptions and other features that you can find on its documentation right here.

If you have ideas for other features or you find issues, just let me know!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store