Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics trackevent in single-page web app

What is the best (most practical) way to use Google Analytics trackevent for tracking "pageviews" in a single-page web app? trackevent takes four arguments: CATEGORY, ACTION, LABEL, VALUE. The last two are optional. Which field should I use for the view title? A "view" in a single-page web app corresponds to a page in a normal web app.

I can see two options:

1) trackevent('Navigation', 'View title');
2) trackevent('Navigation', 'Click', '', 'View title'); 
trackevent('Navigation', 'Redirect', '', 'View title');

Of course one can do either, but which option is best when it comes to analyzing the data in Google Analytics?

like image 357
Per Quested Aronsson Avatar asked Jun 01 '13 08:06

Per Quested Aronsson


1 Answers

The Angulartics plugin provides web analytics for AngularJS applications. There is an example application which uses Google Analytics.

It supports:

  • page tracking
  • event tracking
  • scroll tracking
like image 85
ndequeker Avatar answered Oct 13 '22 21:10

ndequeker