clarity icon indicating copy to clipboard operation
clarity copied to clipboard

Custom identify `user id` not being used

Open johnbacon opened this issue 3 years ago • 49 comments

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 IDs (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

johnbacon avatar Aug 26 '21 14:08 johnbacon

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.

milannankov avatar Nov 07 '21 12:11 milannankov

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.

agtenr avatar Jan 25 '22 06:01 agtenr

Any updates on this?

remy727 avatar Mar 18 '22 19:03 remy727

Also wondering if there's an update on this, looks like we're seeing the same thing

noahsark769 avatar Apr 19 '22 07:04 noahsark769

+1

amit-feldman avatar May 22 '22 11:05 amit-feldman

Is it possible someone from MS could take a look?

oeddyo avatar Jun 16 '22 09:06 oeddyo

+1

straxico avatar Aug 07 '22 09:08 straxico

+1

subratamal avatar Aug 11 '22 20:08 subratamal

+1

yelianjie avatar Aug 18 '22 13:08 yelianjie

+1

LeoTanoue avatar Aug 26 '22 12:08 LeoTanoue

Any updates?

ahendouz avatar Aug 30 '22 11:08 ahendouz

We've recently experienced this problem also, any updates?

SamPPCProtect avatar Sep 07 '22 10:09 SamPPCProtect

@johnbacon ,Please use Custom user ID under Custom filters instead of user ID, Custom Tags in Clarity.

ClaritySupport avatar Oct 17 '22 10:10 ClaritySupport

@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.

straxico avatar Oct 17 '22 11:10 straxico

@ClaritySupport – as @straxico mentioned, this is unfortunately not an acceptable solution.

Are you official Clarity support?

johnbacon avatar Oct 19 '22 15:10 johnbacon

@ClaritySupport – as @straxico mentioned, this is unfortunately not an acceptable solution.

Are you official Clarity support?

no . i suggest to see posthog

straxico avatar Oct 19 '22 23:10 straxico

@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.

image

ClaritySupport avatar Oct 20 '22 07:10 ClaritySupport

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?

GFoley83 avatar Nov 28 '22 20:11 GFoley83

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 avatar Feb 20 '23 23:02 NegTakashiro

@NegTakashiro ,Could you please enter it in the Custom user ID filter within the Custom filters section.

image

ClaritySupport avatar Feb 21 '23 08:02 ClaritySupport

@NegTakashiro ,Could you please enter it in the Custom user ID filter within the Custom filters section.

image

I have this on my webpage: window.clarity('identify', 43)

But if I filter for that identifier, this is the result:

Schermata 2023-02-21 alle 17 28 56

I also tried window.clarity('set', 'myuserid', 43) but I can't see any custom tag dropdown select:

Schermata 2023-02-21 alle 17 30 31

santilorenzo avatar Feb 21 '23 16:02 santilorenzo

@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 avatar Feb 22 '23 01:02 NegTakashiro

@NegTakashiro ,Could you please enter it in the Custom user ID filter within the Custom filters section. image

I have this on my webpage: window.clarity('identify', 43)

But if I filter for that identifier, this is the result:

Schermata 2023-02-21 alle 17 28 56

I also tried window.clarity('set', 'myuserid', 43) but I can't see any custom tag dropdown select:

Schermata 2023-02-21 alle 17 30 31

@santilorenzo Have you tried to make it a string? window.clarity('identify', '43')?

NegTakashiro avatar Feb 22 '23 16:02 NegTakashiro

@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.

ClaritySupport avatar Feb 24 '23 19:02 ClaritySupport

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 avatar May 17 '23 05:05 kepboy

@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 avatar May 17 '23 17:05 ClaritySupport

@ClaritySupport I have an interesting update: image

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

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 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

merobal avatar May 23 '23 10:05 merobal

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.

ayusshar avatar Jun 16 '23 08:06 ayusshar

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: @.@.>>

ClaritySupport avatar Jun 16 '23 12:06 ClaritySupport

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: @.@.>>

ClaritySupport avatar Jun 21 '23 09:06 ClaritySupport