By default, Matomo’s Page URL report includes the average time spent on page for each page URL viewed. However, the URL only includes the page path and query parameters of viewed web pages, and it does not include the full URL with the domain.

If you track multiple domains within the same Matomo site, you can create a Custom Dimension at the Action scope to distinguish between pages with identical paths on different domains.

Use the Matomo tracking code or Matomo Tag Manager to capture the full URL, including the domain, along with the standard Pages metrics (such as time on page, bounce rate, and exit rate). Once set up and data has been collected, view the tracked full URLs report and key metrics in Matomo > Behaviour > [Name of your Custom Dimension].

Create an Action scope Custom Dimension

  1. Go to Matomo settings Settings Cog Icon > Measurables > Custom Dimensions.
  2. Create a new Custom Dimension at the Action scope and provide a descriptive name.
  3. Activate the dimension and click Create.
  4. Note the ID (index) of the Custom Dimension.

matomo define custom dimension

Use the Matomo tracking code

If you’re not using Matomo Tag Manager, you can modify your Matomo JavaScript tracking code directly to track the full URL using a Custom Dimension.

  1. Add the line to your tracking code before trackPageView(): _paq.push(['setCustomDimension', 1, window.location.href]);
  2. Matomo captures the full URL of the current page and sends this value as a Custom Dimension at the action level.

Example of the modified tracking code:

var _paq = window._paq = window._paq || [];

// Set the full URL as an Action-level Custom Dimension
_paq.push(['setCustomDimension', 1, window.location.href]); // Replace 1 with your actual dimension index

_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
  var u="//your-matomo-domain.example.com/";
  _paq.push(['setTrackerUrl', u+'matomo.php']);
  _paq.push(['setSiteId', 'YOUR_SITE_ID']);
  var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
  g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();

Use Matomo Tag Manager

If you’re not using the Matomo tracking code in your website’s code, you can configure Matomo Tag Manager to track the full URL using a Custom Dimension.

By default, the Tag Manager container contains the Matomo Analytics tracking tag linked to the Pageview trigger and Matomo Configuration variable.

  1. In Tag Manager, open the Matomo Configuration variable and scroll down to the Custom Dimension section.
  2. Enter the Index (ID of the new Custom Dimension).
  3. In the Value field, choose the preconfigured variable {{Page URL}}. This will populate your new Custom Dimension with the full URL.
  4. You can also set conditions on triggers to send the full URL Custom Dimension only in specific cases (e.g., for certain pages, referrers, or user types).
  5. Click Save.
  6. Use the Preview and Debug mode in Tag Manager to test your configuration.
  7. Once successfully tested, publish the changes to your live environment.

This method enables a clear view of engagement for full URLs across multi-domain setups.

Click here to watch the video tutorial

Previous FAQ: How do I measure and give users access to reports for page sections / categories / mini-sites / languages?