microsoft / clarity

A behavioral analytics library that uses dom mutations and user interactions to generate aggregated insights.
https://clarity.microsoft.com
MIT License
2.09k stars 208 forks source link

A different session/recording and unique user are created for each page even when cookies are enabled #523

Open Arkansio opened 8 months ago

Arkansio commented 8 months ago

Hello,

I'm integrating Clarity on a Shopify Embedded App Admin and the rendering works fine but every time I navigate to another page it creates a new session with a new user ID, so it's impossible to track and all my records have a single page.

It's a React application, and the script is placed in the index.html.

As an embedded application, my application is currently running in an iframe from the Shopify interface, the script is in my app, I see renders when the script is loaded, so no problems there.

Cookies are enabled and the "MUID" cookie is sent with each "collect" request. The script is not loaded twice because I only see "collect" requests.

Another problem is that I think Clarity now treats my sessions as bots and deletes them when they are no longer "live".

What is the problem? Have you had a similar experience?

Thank you very much.

perryharlock-solirius commented 8 months ago

I am having exactly the same issue with a NextJS application. Cookies are enabled. Every new page starts a new session so it is impossible to see a users journey.

perryharlock-solirius commented 8 months ago

This seemed to be linked to using Civic Cookie Consent. I added the clarity cookies to the list of analytics cookies in Civic Cookie and live recordings started showing users journeys as individual sessions.

AbdelrhmanMagdy commented 5 months ago

Hello, could you please send the details and the project id with "clarityMS@microsoft.com" to investigate further?