Track navigation with Analytics from single pages that have Javascript navigation

Asked

Viewed 233 times

7

I recently created a personal page and would like to track the most visited areas of the site.
The problem is that the page is composed of a single file (ex: index.html) and the navigation is all done in Javascript, that is, the page is loaded only once.
Is there any way in Google Analytics to track users' browsing according to menu navigation?

1 answer

9


Google Analytics has an event tracking system that I believe applies to your needs. The details are here:

https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

You add a row at the point you want to measure by creating an event (for example, a click on a top menu item).

If you use ga.js, it looks like this:

_gaq.push(['_trackEvent', 'clique-no-menu', 'menu-superior', 'resumo']);

If you use the new Analytics.js, it looks like this:

ga('send', 'event', 'button', 'click', 'menu-superior', 'resumo');

Then just go to the Event Tracking part of Google Analytics and assemble your analysis.

Note: If you are open to other options, recommend the Mixpanel, that was done just for this. The idea is the same as the Event Tracker of Google Analytics, but particularly, I find it much simpler and intuitive.

  • Very good. This solution fits any type of application that is asynchronous. I’ve already implemented a Flash site using this.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.