Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say "Page Views" is a very important metric on your website (KPI) but you want to introduce the nice looking infinity scrolling on certain heavily used pages.

What are the possibilities in order to introduce infinite scroll without losing page views, e.g. is there a legal way of resubmitting a page view to Google Analytics?

share|improve this question
up vote 7 down vote accepted

Yes, you can create virtual pageviews in Google Analytics. When the user goes over a certain point in the page, a pageview is recorded.

You can find information on how to set up virtual pageviews here:


This should be done with JavaScript. jQuery Waypoints is a good library to help:


You should select the virtual URL to put in the code carefully. For example you can set them as subpages of the main page.

_gaq.push(['_trackPageview', '/example-page/point-1']);

_gaq.push(['_trackPageview', '/example-page/point-2']);

_gaq.push(['_trackPageview', '/example-page/point-3']);
share|improve this answer
Thanks a lot. I don't find any explanation about whether these virtual pageviews are counted as normal "Page View" in Google Analytics or whether these statistics are counted elsewhere... Do you have a link? – basZero Jan 21 '14 at 13:57
It's in the 1st link above: "This is because virtual pageviews will add to your total pageview count. – Osvaldo Jan 21 '14 at 17:52
Many thanks for your time. +1 your comment – basZero Jan 21 '14 at 21:26

If you use jquery infinitescroll plugin to do paging, just try as below:

  // other options
  dataType: 'json',
  appendCallback: false,
  nextSelector: '.page-nav:last a',
}, function(json, opts) {
   ga('send', 'pageview', $('.page-nav:last a').attr('href'));
  // Do something with JSON data, create DOM elements, etc ..
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.