Vue 3 support?
See original GitHub issueHi and thank you for this plugin. While trying to add analytics on vite and vue 3 being in RC3 I was wondering if you have any plans on supporting these. Right now I’m getting:
Uncaught TypeError: Cannot set property '$gtag' of undefined
Many Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (14 by maintainers)
Top Results From Across the Web
Frequently Asked Questions - Vue.js
What browsers does Vue support? #. The latest version of Vue (3.x) only supports browsers with native ES2015 support. This excludes IE11. Vue...
Read more >Vue.js 3 support - BootstrapVue
Quickly integrate Bootstrap v4 components with Vue.js. ... @vue/compat support is designed for early migration to Vue.js 3 and will be eventually replaced ......
Read more >Vue 3 – A roundup of infos about the new version of Vue.js
This version will be available as a LTS (long-term support) version for 18 months, which means that it will still get security updates...
Read more >Which UI Frameworks Support Vue 3? - In Plain English
BootstrapVue (13.2k stars on GitHub) enables the usage of Bootstrap (151k stars on GitHub) components in Vue 2 projects. BootstrapVue does not ...
Read more >Vue - endoflife.date
Vue is a JavaScript framework for building user interfaces. It builds on top of standard ... Release, Released, Active Support, Security Support, Latest ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I have started working on version 2 of the plugin. The intention is to rewrite a better plugin using all the power of the new composition API as well which will allow the developer more control over it. you can check the branch
v2if you want, but it’s in early stages. I will provide avue-gtag@nextpackage when everything will be ready. Another repository is not necessaryso I think I almost got a stable-ish version. I made quite a few changes and I will try to share some of them here before I finish testing, writing the doc and publish.
installation
I published the vue3 version under
vue-gtag-nextpackagethen install the library
the
propertyobject is what in the current v2 version is theconfigobject. ( shape is still{ id: Number, params: Object }I have changed the name because of the conflict with the actualconfiggtag api. nowpropertycan simply be an object or an array of objects for when we want to use multiple domain tracking.plugin options/state
default values
install automatic route tracking
I have separated the 2 features to make plugin a bit more easy to manage
install the application with vue-router
then in the router file, for example, you can use the
trackRoutermethod, which also has option specifically for the automatic routing featuretrackRouter options
default values
components
the usage in components is exactly the same: you can access the
this.$gtagobjectcomposition api
vue 3 obviously introduces the new composition api and this is actually the best part of the refactor: almost everything is reactive and it can be used and modified everywhere.
The
useStatereturns refs that before could have been modified only from the plugin installation. This makes it easier, for example, to create a tracking banner and start tracking only after a user accepts the policy.it is also possible to track using the
useGtagfunctionlet me know if you have any questions. it’s obviously still not ready to production and I am working on it + need to add all missing features as well