LogoLogo
Build appsContact API support
Storefronts
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
Storefronts
  • Ecwid storefronts overview
  • Get started
    • Storefront customization options
    • Quickstart: customize storefront with Ecwid JS API
  • Track Storefront events
    • "Page is loaded" events
    • "Customer logged in" event
    • "Cart details are changed" event
    • "New order is placed" event
    • "Instant Site section load" events
  • Get Storefront details
    • Get Ecwid store ID
    • Get storefront language and currency
    • Get visitor location
    • Get public app details
  • Manage customers on the storefront
    • Get logged in customer's details
    • Manage customer's cookie consent
    • Log out customer
  • Open page on the storefront
    • Overview of open page options
    • Open product pages with params
    • Open category pages with params
    • Open search page with params
    • Open account pages with params
  • Manage cart and checkout
    • Get cart details
    • Add product to the cart
    • Remove product from the cart
    • Fully clear the cart
    • Create pre-filled shopping carts
    • Calculate cart details
    • Send customer to the checkout
    • Set customer's email for the checkout
    • Set customer's comments for order
    • Set customer's shipping and billing addresses
    • Set custom order referer
  • Store configuration settings
    • Overview
    • Behavioral configs
    • Design configs

Lightspeed® 2025

On this page

Was this helpful?

  1. Track Storefront events

"Customer logged in" event

Last updated 2 months ago

Was this helpful?

Ecwid.OnSetProfile

This method allows you to track a moment when customers log in and out on the storefront.

It contains a callback function with customer 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
// "ec.apps@lightspeedhq.com"

page argument fields:

Field
Type
Description

email

string

Customer's email.

id

number

Customer's internal ID.

ownerId

number

Internal store ID.

registered

string

Customer's registration date in a stringified UNIX timestamp format. For example, "1718010611".

billingPerson

Customer's saved billing address.

shippingAddresses

Customer's saved shipping addresses.

billingPerson

Field
Type
Description

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

Field
Type
Description

id

number

Ordered ID of saved shipping address.

Starts with 0 and iterates by 1.

person

Details of the saved shipping address.

object

array of objects

object

argument
billingPerson
shippingAddresses
billingPerson