Set page category based on a string in the page's URL?

I need to categorize pages based on their URL. I know Matomo automatically uses the folder structure of the path to create categories and a hierarchical view. I need to categorize beyond just the folder structure.

I need to examine the url and if it contains a string or pattern, then set it to a certain category. Is there something built into Matomo to let me do that from the web interface?

Example:

/contactus
/help
/faq
/updatepaymentmethod
/billing?action=makepayment

set category to “Help”
if url contains “contactus”
if path starts with “/help”
if path starts with “/faq”

set category to “Payment”
if url contains “updatepaymentmethod”
if url contains “makepayment”

Hi @Corey ,
In the Matomo Tag Manager you can do this without coding in a variable and then track it as a custom dimension.

However, if you don’t use the Tag Manager, you should create a JavaScript with some if else statements.

Regards Udo

2 Likes