Hi Wim!

Just a thought: if we don't reload the page when clicking an internal link, how does statistics services like Google Analytics can count the click as a visit?

Thank you for all your work and good luck with this one :)

Comments

DuaelFr created an issue. See original summary.

moshe weitzman’s picture

Title: External statistics support » External analytics support
wim leers’s picture

Project: Turbolinks » RefreshLess
wim leers’s picture

We'd want to trigger an event that JS can listen to. Then it's up to the JS that is the glue between a particular analytics service and Drupal to also trigger that analytics service when a page is loaded using RefreshLess.

wim leers’s picture

Title: External analytics support » External analytics support: listen for a 'refreshless:load' event
Category: Task » Support request
Status: Active » Fixed
Related issues: +#2695777: Announce new content to screenreader users when navigating using RefreshLess

#2695777: Announce new content to screenreader users when navigating using RefreshLess added a refreshless:load event. Which means this is effectively a duplicate… or rather, a support request.

In the case of Google Analytics, that means they have to do something like this:

window.addEventListener('refreshless:load', function() {
  ga('set', {page: window.location.toString(), title: document.title});
  ga('send', 'pageview');
});

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.