Mobile app version of vmapp.org
Login or Join
Gail5422790

: Google Analytics is not tracking time on page I'm using some kind of a server setup that uses Node.js/Express to build a web-application (a collaborative whiteboard). The way I have things setup

@Gail5422790

Posted in: #GoogleAnalytics #GoogleSearchConsole

I'm using some kind of a server setup that uses Node.js/Express to build a web-application (a collaborative whiteboard).

The way I have things setup on my server is this.

My user visits this URL:
example.io/go/roomName
The roomName part is not really a subpage. I redirect to page sitename.io/go/ via my server-setup(Express Routes) and I use the last part of my URL as a parameter of some sort to create some WebSocket connections.

So for example all these addresses will land the user to the same page (which is example.com/go). example.io/go/physicsRoom www.example.io/go/mathsRoom example.io/go/whateverRoom www.example.io/go/helloWorldRoom




Long story short:

The last part of the URL is not an actual "page". It's simply used as somekind of a parameter.



The problem.

The issue I'm seeing is erroneous/unreliable Google Analytics tracking data.

There are certain cases where I should be getting in Google Analytics a certain 2:00 hours Avg. Time on Page but instead it records it as 0:00. In general I seem to be getting unreliable/erroneous tracking.

What I think is the issue.

I'm thinking that the whole setup where my URL does not redirect to the last part of the URL(it's not an actual page but is simply there to be used as a parameter), is what's confusing/causing incompatibility issues with Google Analytics.

Here's the Google Analytics data (I'm getting 0:00 time in places where I should be getting at least 2hours +).

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gail5422790

1 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

By default Google Analytics doesn't know when a user leaves the page unless they go to another page. If your visitors view only a single page they get 0:00 as their time on site (and average time per page.) It sounds like you have implemented a single page application, so this is going to be an issue for you.

You can fix this by implementing events. As the user interacts with your page you can ping Google Analytics through JavaScript to send it tracked events. The time on site will then include any time until the user's last event.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme