Questions on visits in relation to custom dimension

We recently started tracking whether our visitors are logged-in or not (a typical question, mentioned also as a use-case of custom dimensions and custom variables). Now, when looking at the reports, it seems to me that visits are considered logged-in/anonymous based on the first page-view. This would mean, that an anonymous visitor that logs-in, is still only counted as “anonymous” in this custom dimension. Thus, we cannot reliably tell, if a visitor that opened a certain protected page, saw the page as shown to anonymous visitors or to logged-in visitors.

Is this assumption correct? If so: Is there another way of tracking logged-in vs. anonymous? Would custom variables help me here, because they are also applied to page views?

Thanks for any help, suggestion!

Hi Uwe Trenkner,

I think you should use Matomo UserID --> User ID User Guide - Analytics Platform - Matomo
This technique let you track logged user using a unique id. It can fix several issues due to multiple devices connection too !
It’s easy to implement if you can access your source code.


Thank you very much for the suggestion and the link. I do have access to the source code, but we are facing a special challenge here: The pages themselves are cached and therefore it would add quite some overhead to implement a dynamic string in the (cached) pages.

Furthermore, we do not really care about tracking individual users. I do understand that it may be interesting to be able to tell that the same user accesses the site or certain pages from different devices. But this is not really our focus. We would just like to get a feeling for how much of our traffic is from logged-in users vs. from anonymous users.

Do you know if custom variables would solve our problem?