Some of the Page URLs are tracked in duplicate (for example both “Default.aspx” and “default.aspx” are tracked as different pages), how do I force Matomo to record them as the same custom url?
If in your Page URLs report you are seeing the same page URL appear under different entries, then you can use the setCustomUrl
command which lets you overwrite the default Page URL by your custom URL for one or several pages.
This may be useful if for example you’re seeing the same page appear under “index.html” and/or “index” and/or “/”. You could detect this case in JavaScript in your website and call _paq.push(['setCustomUrl', "/index.html"]);
to track all these pages under the same URL “index.html” in Matomo.
Or if for example you are seeing both “Default.aspx” and “DEFAULT.aspx” and you want to track them as “default.aspx”. In your Matomo Javascript Tracking tag, you can add the following line:
_paq.push(['setCustomUrl', location.href.toLowerCase()]);
just before the line:
_paq.push(['trackPageView']);
Then all your pages will now be tracked as lowercase, eg. “Default.aspx” or “DEFAULT.aspx” will be tracked as “default.aspx”.
If instead of the Javascript Tracker you are using the import_logs.py Log Analytics tool, then you can pass the following option to the import_logs.py
script:
--force-lowercase-path