0

Typically, if it were a regular page-by-page website, I would install the analytics javascript before the body tag.

But, with a site where content is on overlays, how can analytics be installed to track views? (i.e. a one page portfolio site)

Thanks for any insight!

Curtis
  • 11
  • 2

2 Answers2

0

In javascript that calls the overlay, you can add:

_gaq.push(['_trackPageview', '/url/of/page']);

or:

ga('send','pageview','/url/of/page');

dkasipovic
  • 5,930
  • 1
  • 19
  • 25
0

See Tracking Google Analytics Page Views with Angular.js. Even though I'm not sure if you are using something like Angular or just straight javascript, you could use a similar technique described there with hash urls that are set when a user clicks on a different part of the page, that way you could track how a user interacts with your single page site by making different urls for their interactions.

For more information see Pushing Functions onto the Queue.

Community
  • 1
  • 1
photoionized
  • 5,092
  • 20
  • 23