Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
Great bug report, thanks! We can improve this regex which is also currently used in optOut.js. I will put it in the queue for prioritisation by the product team.
I experienced, that the tracked hostname was wrong when query parameters are provided, which include the @ (at) symbol.
Expected Behavior
hostname is extracted correctly from href / url
Current Behavior
string after last @-sign is treated as domain name
Possible Solution
fix the RegExp in piwik.js
Steps to Reproduce (for Bugs)
To reproduce, I copied the getHostName function from piwik.js into seperate file:
output should IMO always be 'www.example.org'
node hostname.js
Context
Your Environment