Matomo two unique visitor recorded for a single user for visit and events separately

I have added two pieces of code to my website :

  1. Matomo Javascript code
  2. Matomo Tag Manager code (1 Variable & 3 Triggers)

Position of the tracking code places on the html file :

<head>
<tag-manager code>
...........
...........
<tracking-code>
</head>

Usually when a user visits the page their Visit Actions and Events should come under a single user like https://user-images.githubusercontent.com/51264444/75516583-d5c3fa80-5a22-11ea-9c0b-0533a92e1a1b.png

But in my case there are two separate unique users entry created for Visit Action and Events respectively for a single user click a page :

The problem is Matomo captures the visit actions under a user and events under another user.

@Praz_Solver Do you have a Matomo Tag in the tag manager container configured? If so, it may be expected that you end up having two different visits. Ideally, we would get a URL to reproduce the issue. Usually you would be only tracking through Tag Manager or through the tracking code. Maybe you can tell us a bit more what tracking code you are using, what you have configured in the tracking code and why you are using both.

Hi,

we have the same problem: one IP but two users, one for page view, one for events

We load the mtm code on the website, cookiebot is then loaded via mtm and, depending on the user’s decision, Matomo tracking code then loaded with or without a cookie (defined via custom dimension) – which all works correctly so we don’t believe there is any duplicate code on the site

The problem only occurs sometimes, both with cookie and cookieless tracking, but never seems to occur if the browser cache has been cleared beforehand

please see here: https://kontron-ais.com/