Jump to content

How to get logged in Customer Email / ID ?

Recommended Posts

Hi,
I need to retrieve the loggedin user email or id, I have read the following article and using it for now but the problem is, ID gets reset when customer removes cookies.
Is there any way I can get a unique identifier which do not reset after deleting cookies.

Thank you.

 

 

Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

30 minutes ago, Qaisar said:

I need to retrieve the loggedin user email or id

You could use JS to call the User Account API and check if the user is authenticated.

If they are, you can return some information about the customer such as their email address, name and customer id.

About: Squarespace Circle Leader since 2017. I value honesty, transparency, diversity and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. 
Content: Links in my posts may refer to SF Digital products or may be affiliate links.

Catch up on all the release notes and announcements 2023 [for Circle members only]. There's a public version here too!
If I helped, you can thank me by clicking one of the emojis below. If you prefer, you can buy me a coffee.
Improve your online store with our extensions.

Link to comment
On 11/13/2022 at 2:02 PM, paul2009 said:

You could use JS to call the User Account API and check if the user is authenticated.

If they are, you can return some information about the customer such as their email address, name and customer id.


Thanks for the answer @paul2009 but can you share more details or point me to the right documentation?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.