I am using Matomo in a Single Page Application (with Angular).
When I initialize Matomo, I generate a UUID / or retrieve it in the localStorage to set the User ID.
ex :
// Init
window._paq.push(['setUserId', "5c818ccb-cb24-8358-90ee-ca6e43e84695"]);
window._paq.push(['setSiteId', siteId]);
window._paq.push(['setCustomUrl', window.location.href]);
window._paq.push(['trackPageView']);
// At every route chnage
window._paq.push(['setCustomUrl', window.location.href]);
window._paq.push(['trackPageView']);
I have read in the documentation that : "The User ID will be converted (hashed) into a Visitor ID hexadecimal string. The hashed User ID becomes the Visitor ID"
When I go to the visit logs on the server :
The same user going through different routes in the application is considered as different visits.
Example with Chrome Browser :
www.site.com/#/page1
User Id : 9ee75c12-23e1-1bd4-fca3-c810e1fd8859
Visitor Id : e620f52c46a48cf3
Visit ID : 2282555
www.site.com/#/page2
User Id : 9ee75c12-23e1-1bd4-fca3-c810e1fd8859 (same User ID)
Visitor Id : eb869e31e61f090 (different Visitor ID)
Visit ID : 2282558 (different Visit ID)
Is it the right behaviour ? What am I doing Wrong ?