clarity
clarity copied to clipboard
Custom identify `user id` not being used
We've manually integrated Clarity in the <head>
of our website. When a logged-in user is present, we use window.clarity('identify', '*');
to submit their numeric account ID as a string. Like this!
<script>
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "abcd1234");
window.clarity('identify', '7654321'); // Example 7-digit ID as on the site
window.clarity('set', 'Page Type', "Example");
window.clarity('set', "Account ID", "7654321");
window.clarity('set', "User Type", "Example");
</script>
This custom identifier doesn't seem to be used on clarity.microsoft.com or searchable by the User ID
filter. Instead, we see the auto-generated User ID
s (like 8p6jh3
).
What are we doing wrong here? Or does the feature not operate as we imagine?
We've attempted to work around this issue with the Account ID
custom filter as you can see above, but because those filters cannot be copy + pasted and only seem to accept up to three characters, it makes it impractical for our purposes. (This particular use case is for support and engineering to better debug issues that happen.)
CC: @markb423 / @soundslocke
I have got the same issue. I seem to be making the right calls but the user_id that I am providing is not being respected.
@johnbacon , at first I taught that consent might have been required for you to use "identify" but I am calling consent and user_id is still not respected.
I am using Clarity in a React app where the tracking code is loaded in "
" and then I call consent and identify in one of my components. I am also trying to set some addition data that is needed in my context but it is not recorded as well. Here is the simplified version:window.clarity('consent'); window.clarity("identify", "myuserid"); window.clarity("set", "domain", "mydomain");
What I have noticed looking at the source code of Clarity is that there is a check for "active()" - when false, operations like identify will not do anything. So I am wondering the call to identify is called a bit too early.
Any suggestions are welcome.
We are encountering the same issue as well. We cannot get the identify property to work. This is a big issue for us because the distinct user count is way off. Any input from the clarity team would be greatly appreciated.
Any updates on this?
Also wondering if there's an update on this, looks like we're seeing the same thing
+1
Is it possible someone from MS could take a look?
+1
+1
+1
+1
Any updates?
We've recently experienced this problem also, any updates?
@johnbacon ,Please use Custom user ID under Custom filters instead of user ID, Custom Tags in Clarity.
@johnbacon ,Please use Custom user ID under Custom filters instead of user ID, Custom Tags in Clarity.
A single page can have no more than 128 tags. Any other tags will be ignored.
@ClaritySupport – as @straxico mentioned, this is unfortunately not an acceptable solution.
Are you official Clarity support?
@ClaritySupport – as @straxico mentioned, this is unfortunately not an acceptable solution.
Are you official Clarity support?
no . i suggest to see posthog
@johnbacon, Yes we are official Clarity support. Sorry for the confusion. Any id that you sent us via identify API, you can enter it in the Custom user ID filter within the Custom filters section.
Can anyone confirm that this solution worked for them?
@ClaritySupport if you are official support then you should really be a marked as a contributor to this repo. Otherwise it just looks really suspicious as your profile is blank with zero permissions.
@sarveshnagpal Can you confirm this please?
Any updates? Tried with and without "window." prefix, the set command worked without the prefix but no matter what I do or how I present the code, custom user id is never utilized. (Coming from Shopify with a mix of .liquid)
@NegTakashiro ,Could you please enter it in the Custom user ID filter within the Custom filters section.
@NegTakashiro ,Could you please enter it in the Custom user ID filter within the Custom filters section.
I have this on my webpage:
window.clarity('identify', 43)
But if I filter for that identifier, this is the result:
I also tried
window.clarity('set', 'myuserid', 43)
but I can't see any custom tag dropdown select:
@ClaritySupport I am using that field, and to add more context I'm using window.clarity('identify', {{shopify.parameter.here}}, {{another.shopify.parameter}})
Where the "another.shopify.parameter" sort of works and is searchable under custom session id, but the first custom user id field, is not working at all.
@NegTakashiro ,Could you please enter it in the Custom user ID filter within the Custom filters section.
I have this on my webpage:
window.clarity('identify', 43)
But if I filter for that identifier, this is the result:
I also tried
window.clarity('set', 'myuserid', 43)
but I can't see any custom tag dropdown select:
@santilorenzo Have you tried to make it a string? window.clarity('identify', '43')
?
@NegTakashiro , please verify that the user id you're passing to Clarity is valid. Clarity requires that user ids be a string of no more than 255 characters. Additionally, Clarity will not accept user ids that contain certain characters, such as <, >, and &. If you're passing an invalid user id, Clarity may not be able to use it.
I'm trying to get claritry to use my customer ID but when I call clarity("identify", "190-3213-321321")
it returns a promise. Upon success that promise returns an object with two properties, userId and userHint. The userId is a large numeric that must be generated by Clarity. the userHint property contains the first two characters from my custom user Id followed by ***s, i.e. "19***********"
I also call clarity("set", "appUserId", "190-3213-321321")
and it doesn't seem to do anything at all. No custom labels or tags show up in the clarity user interface.
Is this broken? a change and the documentation hasn't been updated? Help...
@kepboy ,Could you please share project iD.The documentation for the change in identity api will be updated soon.
You can still filter by entering value "190-3213-321321" in Custom User Id on the clarity website.
@ClaritySupport I have an interesting update:
Our "Customised user ID" does appear. But when I click on it (so I set it as a filter) it does not show any results.
We use Google Tag Manager, so we send the user_id as a string from today (we sent it as an integer in the past):
But I'm still experiencing the same issue as above.
Summary: Clarity is able to receive the user_id
, but isn't able to use it as a filter.
Project id: fksiplvzvw
Facing similar issues. So I have two problems,
First one is
I have tried below code -
window.clarity('set', 'DoctorID', DoctorID?.toString())
But no custom tags are appearing on my project.
Second one -
When I am using - window.clarity('identify', DoctorID?.toString())
, Clarity is showing this on screen with added hash, so i am not able to make use of Custom User Id filter.
Hello,
Could you please share Clarity project ID and website address to investigate further.
Thanks, Clarity Support Team Visit our docs!: https://docs.microsoft.com/en-us/clarity @.@.> @.***
Confidentiality note: This e-mail, and any attachment to it, contains privileged and confidential information intended only for the use of the individual(s) or entity named in the e-mail. If the reader of the e-mail is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that reading it is strictly prohibited. If you have received this e-mail in error, please immediately return it to the sender and delete it from your system.
From: ayusshar @.>
Sent: Friday, June 16, 2023 1:32 AM
To: microsoft/clarity @.>
Cc: Microsoft Clarity Support @.>; Mention @.>
Subject: Re: [microsoft/clarity] Custom identify user id
not being used (#167)
Facing similar issues. So I have two problems, First one is I have tried below code - window.clarity('set', 'DoctorID', DoctorID?.toString())
But no custom tags are appearing on my project.
Second one - When I am using - window.clarity('identify', DoctorID?.toString()) , Clarity is showing this on screen with added hash, so i am not able to make use of Custom User Id filter.
Reply to this email directly, view it on GitHubhttps://github.com/microsoft/clarity/issues/167#issuecomment-1594317140, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AW5BXQZK6B3ZDZCGQQYYMITXLQKZDANCNFSM5C3OELLA. You are receiving this because you were mentioned.Message ID: @.@.>>
Hello,
We are unable to repro it, see results here: Redmenta - Clarity (microsoft.com)https://clarity.microsoft.com/projects/view/fksiplvzvw/impressions?CustomUserId=is%3B204675456&date=Custom&end=1684997940000&start=1684738800000 when I filter to Custome User ID: 204675456
Thanks, Clarity Support Team Visit our docs!: https://docs.microsoft.com/en-us/clarity @.@.> @.***
Confidentiality note: This e-mail, and any attachment to it, contains privileged and confidential information intended only for the use of the individual(s) or entity named in the e-mail. If the reader of the e-mail is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that reading it is strictly prohibited. If you have received this e-mail in error, please immediately return it to the sender and delete it from your system.
From: Bálint @.>
Sent: Tuesday, May 23, 2023 3:28 AM
To: microsoft/clarity @.>
Cc: Microsoft Clarity Support @.>; Mention @.>
Subject: Re: [microsoft/clarity] Custom identify user id
not being used (#167)
@ClaritySupporthttps://github.com/ClaritySupport I have an interesting update: [image]https://user-images.githubusercontent.com/5844511/240232496-1c1f16b4-6b73-431d-baa4-881c439d3c0c.png
Our "Customised user ID" does appear. But when I click on it (so I set it as a filter) it does not show any results. [image]https://user-images.githubusercontent.com/5844511/240232826-f996f037-d1a2-43af-b263-b91bcab1c1c2.png
We use Google Tag Manager, so we send the user_id as a string from today (we sent it as an integer in the past): [image]https://user-images.githubusercontent.com/5844511/240233813-f3e08a16-d029-42d5-9fc7-32789e2734fe.png But I'm still experiencing the same issue as above.
Summary: Clarity is able to receive the user_id, but isn't able to use it as a filter.
Project id: fksiplvzvw
Reply to this email directly, view it on GitHubhttps://github.com/microsoft/clarity/issues/167#issuecomment-1559009243, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AW5BXQ6GMCGYAFJKDM7L2U3XHSGK7ANCNFSM5C3OELLA. You are receiving this because you were mentioned.Message ID: @.@.>>