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 4
  • Views 1.3k
  • 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 me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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
  • 1 year later...

@Wacha This API isn't documented, but I provided some more details in this thread:

Please let me know if this is helpful by clicking an icon below  ⬇️

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

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.