Tracking pages in lowercase via tag manager

We would like to convert all page URLs to lowercase format.

From the FAQs section I can see that a fix to this would be to add:

‘_paq.push([‘setCustomUrl’, location.href.toLowerCase()];’

before the:

_pag.push([‘trackPageView’]);

in the tag snippet. Would this implementation be at all possible through MTM?

Thanks in advance,
Adam

Hi Adam,
nice example. Well I never tried it but you can always add it with the custom HTML tag in Matomo Tag Manager, it would then work fine.

Thanks Ronan,

When setting up the tag can I simply have:

_paq.push([‘setCustomUrl’, location.href.toLowerCase()];

in the html section? And should I select ‘Head Start’ to try and get it to fire before the ‘PageView’?

BR
Adam