Using Custom Dimension to track use of Anchor Navigation

I use Custom Dimensions to track some aspects of user interactions and it usually works very well with extractions.

Now I have added a new Custom Dimension to track the use of an anchor navigation that only exists on one page type. The clicked menu item is added to the URL with the parameter #.

Example URL for menu item “deadline”:

https:///en/service/L100039.9236083#deadline

I use the following regular expression for the extraction:

.*/service/.*#(.*)

This does not track, however. I get no results at all for this custom dimension.

Neither does just setting # as a parameter for the custom dimension work.

Any ideas why? Is # one of the parameters that Matomo automatically ignores?

Hi @vanye
How do you track exactly?
Where do you use the regular expression?

Hi Philippe,

we use Matomo as a log analyzer, meaning we import the logfiles from the Webserver every night.

I use the regular expression in the setup of the custom dimension.

Hi @vanye
As links in internal page don’t hit the server (If I am not wrong), the link should not be visible in the server log (the browser won’t reload the page, as it has already been loaded)… And Matomo won’t catch it.
I think you don’t see the “page” in the Matomo visitor log (in case of link to an anchor of the page that is the source page itself)…
Also, there is a configuration in the measurable to track or not the hash (in case of link to an anchor of a page that is not the source page itself):

Hi @heurteph-ei,

yes, of course. I am sorry, this is the first time I use Matomo as a logfile tool instead of scripting.

Thank you very much!