MatteoGabriele / vue-gtag

Global Site Tag plugin for Vue (gtag.js)
https://matteo-gabriele.gitbook.io/vue-gtag/
MIT License
864 stars 64 forks source link

this.$gtag.event("xyz") doesn't appear to be functioning #129

Closed jenkins6g closed 4 years ago

jenkins6g commented 4 years ago

Not sure if this is a bug or if I am not following the documentation correctly.

Description

mounted() { this.track(); }, methods: { track() { this.$gtag.event("xyz"); }, },

I have the code above on the home page of my vue app, I am not seeing events being registered on google analytics when I go to the url.

Expected behavior

I expect the code above to fire a Google Analytics Event with an action of 'xyz', a default category of 'general', and a default label of '(not set)'. In addition, I expect to see this event appear on the Google Analytics Dashboard under Behavior --> Events tab.

Actual behavior

I do not see any events appear on the Google Analytics Dashboard. However, I can see navigational behaviors on the Google Analytics Dashboard.

Environment

Run this command in the project folder and fill in their results:

npm ls vue-gtag: vue-gtag@1.6.2

Then, specify:

  1. Operating system: macOS Mojave, Version 10.14.6
  2. Browser and version: Chrome 81

Reproducible Demo

mounted() { this.track(); }, methods: { track() { this.$gtag.event("xyz"); }, },

I have the code above on the home page of my vue app, I am not seeing events being registered on the google analytics dashboard when I go to the url www.mentallyapp.co or other users go to the url.

NickeManarin commented 4 years ago

Did you select the correct date span?

By default, Google Analytics does not display the report with an incomplete day.

jenkins6g commented 4 years ago

@NickeManarin thanks for the update, I saw that the event was being triggered with the GTM/GA Debug chrome extension so was pretty confused. I see the event now on Google Analytics, thanks!