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

Error in real-time count. #118

Closed theharshin closed 4 years ago

theharshin commented 4 years ago

Description

image

The real-time count of users is very high when compared to Top Active pages. I've used this plugin in 2 of my projects and I'm experiencing this in both of them. I've turned on auto-tracking and provided the router instance.

I don't what might be causing such a high number of active users. I've switched to static analytics code on .html file and it shows the right numbers.

Expected behavior

Show an actual counter.

Actual behavior

An exceptionally high count of real-time users.

Environment

vue-gtag@1.6.2

  1. Operating system: macOS
  2. Browser and version: Firefox Developer Edition.
MatteoGabriele commented 4 years ago

hi @theharshin thanks for you feedback. what do you think it could be? do you have an idea?

thanks a lot

chrisjenx commented 4 years ago

pageTrackerScreenviewEnabled doesn't seem to work correctly. So you only see actual page loads. I was testing this now, as my active pages are whack.

damirbogd commented 4 years ago

@MatteoGabriele having the same issue as chrisjenx

it's seems that real count number is incorrect, however looks like Audience Overview data is correct.

my main.js


import Vue from 'vue'
import App from "./App.vue";
import VueGtag from 'vue-gtag'
import router from './router' //router config

Vue.use(
    VueGtag,
    {
        config: { id: UA-111111111-1 },
        enabled: process.env.NODE_ENV === 'production' ? true : false,
        appName: 'app-name',
    },
    router
)

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')
MatteoGabriele commented 4 years ago

not really sure how to help here. technically if your data locally is sent correctly, the job of the plugin is done: I just automate parts that usually we repeat all the time for all projects, but I just use the library api, so once that fired event is correct, then I don't really know what to do more. could you look if that's correct?

chrisjenx commented 4 years ago

@MatteoGabriele it looks like it doesn't change the page name from the initial load (navigating in html5 mode). This may be something gtag does to try and reduce replicated links - but the first page you load into vue is the only page url that is ever recorded. I checked API calls, looks like router page loads never fire api requests for me...

MatteoGabriele commented 4 years ago

Did u try with my last update? If still the same, could you please make a small repo with the issue "visible" so that I can have a better understanding of it? Thanks a lot

MatteoGabriele commented 4 years ago

well I am unable to do anything about this issue so I will close it. please be free to open it again with something concrete that I can use to tackle the problem