Hi. How can we help?

Infinite scrolling and Google Analytics

If you want to keep track of all the pages viewed by the user with YITH Infinite scrolling with Google Analytics, just:

  1. Make sure you have enabled the option "Change the URL of the page whenever new items are loaded" from YITH> Infinite Scrolling> Settings
  2. Add the following code to the "Custom JavaScript" box ( YITH> Infinite Scrolling> Settings ):

 

(function($) {  $(document).on( 'yith_infs_url_changed', function( ev, url ){
if( url == location.pathname && typeof ga != 'undefined' ) {
ga('set', 'page', location.pathname);
ga('send', 'pageview');
}
});
})(jQuery);
Was this article helpful?
0 out of 0 found this helpful

Back to Help Center >

Powered by Zendesk