Get visitor location
Ecwid.getVisitorLocation()
Ecwid.getVisitorLocation()
This method gets the visitor's location based on their shipping or billing address (when entered), or IP. The call works even for signed-out customers.
Request example:
Fields available in the response:
Name
Type
Description
countryCode
string
Country code (null
if not found) in ISO 639-1.
stateCode
string
State code (null
if not found) in ISO 639-1.
source
string
The source of the received country code and state code.
One of:
SHIPPING_ADDRESS
BILLING_ADDRESS
IP_ADDRESS
Last updated
Was this helpful?