Matomo: Preventing duplicate page tracking

This documentation is part of the Getting started guide. You can view the complete guide here: Discover how to efficiently set up and utilise Matomo for your analytics requirements..

👋 Welcome to the Stackhero documentation!

Stackhero offers a Matomo cloud solution that simplifies web analytics:

  • Unlimited websites, members, segments, goals, and data retention: analyse everything you need, for as long as you require.
  • Effortless updates: keep your analytics platform up to date with a single click.
  • Custom domain name with HTTPS: run Matomo at a secure, branded URL, such as https://analytics.your-company.com.
  • High performance and enhanced security: your data is hosted on private, dedicated infrastructure to ensure reliability and confidentiality.

With Stackhero, you can deploy Matomo analytics in just a few minutes and manage all your sites from a single location. Try our Matomo cloud hosting to simplify your analytics and focus on what matters most.

Matomo differentiates between pages like index.html and INDEX.html. If case sensitivity is not crucial for your site, you can normalise URLs by adding the following code to your Matomo JavaScript Tracking tag:

// Add this code:
_paq.push(['setCustomUrl', location.href.toLowerCase()]);
// Just before this line:
// _paq.push(['trackPageView']);

For additional guidance, check out the official Matomo FAQ.