smartlook / smartlook-client

Official Smartlook client for easy frontend integration.
https://smartlook.com
MIT License
28 stars 9 forks source link

Getting custom user properties #25

Closed ilyai closed 2 years ago

ilyai commented 2 years ago

Is it possible to obtain custom user properties from Smartlook client when there wasn't an explicit call to identify() since the page was loaded (i.e. when Smartlook identified a user with its own data stored previously in cookies / local storage)?

The problem that I need to access user's email from custom properties but seems that the client only provides random alpha-numeric ID string values (visitorId / sessionId / recordId).

Joozty commented 2 years ago

Hi @ilyai 👋

No data such as email, name and so on are stored in cookies. We keep only our internal identificators there which are actually these "random alpha-numeric string values" you are referring to. You can read more about it here.

Also, there is no way to access custom user properties from smartlook client when you call identify API. It does not really make sense to expose them because if you passed it down to our client you already have this kind of information. Obviously, if the user accesses a different page of yours (or reloads) you could use our backend API for accessing more detail about the visitor but I would strongly advise you not to use this API on the client side as you would expose your API key and all information to the world. Anyway, I would recommend you contact our support if you need any further assistance.

Hope this helps 🙂