"Customer logged in" event
Ecwid.OnSetProfile
Ecwid.OnSetProfileThis method allows you to track a moment when customers log in and out on the storefront.
It contains a callback function with customer argument when a customer logs in, and null if a customer has logged out.
Code example:
Ecwid.OnSetProfile.add(function(customer){
console.log(customer.email);
})
// prints
// "[email protected]"customer argument fields:
customer argument fields:string
Customer's email.
id
number
Customer's internal ID.
membership
object membership
Customer's group information. If customer belongs to a general group, this field is omitted from the callback.
ownerId
number
Internal store ID.
registered
string
Customer's registration date in a stringified UNIX timestamp format.
For example, "1718010611".
billingPerson
name
string
Full name of the customer.
companyName
string
Customer's company name.
street
string
Address line 1 and address line 2, separated by \n.
city
string
City.
countryCode
string
Two-letter country code.
countryName
string
Country name.
postalCode
string
Postal/ZIP code.
stateOrProvinceCode
string
State/province code, for example, NY.
phone
string
Customer's phone number.
shippingAddresses
id
number
Ordered ID of saved shipping address.
Starts with 0 and iterates by 1.
membership
id
number
Customer group's ID.
name
string
Name of the customer group.
ownerId
number
ID of the store customer group belongs to.
Last updated
Was this helpful?
