Tracking ajax access


in our individual Joomla / VirtueMart solution the page is updated using ajax access.
Question: How to enable Matomo to collect data for such access resp. how to “formulate” the ajax access ?

Thanks a lot in advance,


You can write your own ajaxSuccess handler and pushing the page to Matomo this way:

$(document).ajaxSuccess(function(event, xhr, settings) {
  _paq.push(['setCustomUrl', '/' + settings.url]);
  _paq.push(['setDocumentTitle', 'My New Title']);

See: How to track single-page websites and web applications using Piwik Analytics - Analytics Platform - Matomo and .ajaxSuccess() | jQuery API Documentation

1 Like