Sessions mixed up with different environments

When viewing the visits log in Matomo, some of the sessions have pages or actions logged coming from 2 or more different domains. See below screenshot (screenshot anonymised):

We have a (web)application that works locally at our clients servers (on-premise) or in some instances in a cloud environment. All visitors of our application have an account, these accounts are not connected or interchangeable between different environments.

In Matomo we created a single website for our application. In our tracking code we disable Cookies but send a unique user ID based on account information and environment information. So we can never have the same userid. We filter (segment) data per client, so we created custom variables with information like a unique client code (see screenshot Instance: Client 1).

With this setup of Matomo we can see the total usage of our application and can narrow it down per client with segments. This is all working fine except in some rare cases sessions mixup different environments.

We are using Matomo 4.4.1

Any ideas why this could be happening?


Can you confirm this:
is the user ID?

Are you sure the user ID can never be the same between 2 different sites? (eg. on Matomo forum and on Matomo GitHub, I personally use the same user ID, also I already found websites where my favorite user ID was already taken). If not, you could append the website to the user ID, then the new built user ID would become really unique!

Which version of Matomo do you use?

Hi Philippe,

Thank you for your response!
We currently use Matomo version 4.4.1

I have checked the user ID and can confirm that it is indeed not completely unique.
Our clients can have multiple instances of our application running, between these instances the same user ID can exist.

The issue happens when, for example client A has 2 instances of our application (2 websites): and Each user account on these 2 different websites gets the same user ID because he uses the same account details. So far i think that makes sense… If we want to completely separate this we should append the website domain to the user ID as you suggest.

So summarized this means: Matomo puts activity from 2 different domains in one session if it is the same user.

Is there a way to separate these sessions without having to make the user ID completely unique? We still want to see if it was the same user between these 2 website but we don’t want it to be a combined session, website 1 en website 2 are two different things.

No Idea…
Maybe @Lukas?

We do disable cookies in the javascript code with: _paq.push(['disableCookies']);

The Matomo documentation says “When cookies are disabled, some data in Matomo will be less accurate.” on this page:

But it says nothing about inaccurate sessions. Anyone else have experience with this?

Maybe you can track on 2 measurables then use the roll up premium feature…

I am not sure your problem comes from the cookie…
You can maybe test temporarily the activation of the cookie, I am almost sure your sessions will still be mixed…

Thank you Philippe, i will look into it