Include full URL in Page reports

Hi all, wondering if it’s possible to show the full URL in the Behaviour --> Pages reports? I’m tracking many subdomains with the same tracking code and all the subdomains have similar page structures (these are all wordpress sites in a multisite installation.)
The Page Title report is displaying the pages associated with their domain names (including the subdomain) but I would like this to be the same with the Pages report too. (also the Entry Pages and Exit Pages reports).

thanks.
stuart

bump. having the same issue

Wondering if you ever found a solution to this? I desperately need to do the same. We have 100+ subdomains and without this solution, It appears every homepage will look like the same page.

Hi,
you can do this replacing this line in general Matomo tracking code.
_paq.push([‘trackPageView’]);

by this:

var p = location.hostname+window.location.pathname + window.location.search;
_paq.push([‘setCustomUrl’, p]);
_paq.push([‘trackPageView’, p]);

You will see the url dupped in profile view, but in page report your domains will appear in tree table :wink:

Hi David,
thank you for that suggestion. The link in the page report for these pages is then no longer correct. It looks right in the browser, but Matomo makes the “href” to https://mydomain.com/mydomain.com/url.html

Hi,

I am not up-to-date on the issue, but maybe you need to include the protocol in the URL:

var p = location.protocol+"//"+ location.hostname+window.location.pathname + window.location.search;

so you are sending "https://forum.matomo.org/t/include-full-url-in-page-reports/31146/4" instead of "forum.matomo.org/t/include-full-url-in-page-reports/31146/4"

Hi Lukas,
when I include the protocol like in your example, then page url is the same like in standard (without setting setCustomUrl ) .

But I tried a workaround with a “fake folder” named like my subdomain
var p = "My subdomain/.." +window.location.pathname + window.location.search;
_paq.push([‘trackPageView’, p]);

The URL “href” in Matomo backend will now set to https://mydomain.com/My subdomain/../url.html what is the same like https://mydomain.com/url.html - that is what I want.

It looks like below in the screenhots. My fake folder and the two points folder are now categories in the Page Url report which cluster all the url’s of my subdomain. This idea is based on the description here to control the tree structure with separators https://matomo.org/faq/how-to/faq_62/

grafik
or in flat view
grafik

In the visitor log is the fake folder to see, but the link url is correct too - I think this is acceptable as workarround:

grafik

Hope I haven’t missed anything

Regards Udo