Skip to product menu
Skip to main content

​.setVisitorLocation()

This API allows you to set a secondary location for a visitor. The secondary location set using this API will be visible within the visitor information page under the Secondary Location section.

The setLocation() API takes an object with specific keys representing the visitor's location as a parameter.

Note:
If the latitude and longitude of the visitor are set using this API, the visitor's device location will be overridden while showing the current location in the map for the location widget. This is applicable only if a pre-selected location is not added within the bot script. 

Location Properties

PropertyValue
latitudeLatitude of visitor's location(Decimal degrees)
longitudeLongitude of visitor's location(Decimal degrees)
zipCodeZIP code at a visitor's location
cityName of the city
stateName of the state
countryName of the country
countryCodeCountry code for the country

Syntax

CopiedZohoSalesIQ.setVisitorLocation(location: VisitorLocationType)

Example

Copiedvar location = {};
location.latitude = 12.83;
location.longitude = 80.04;
location.zipCode = "603 202";
location.city = "Chennai";
location.state = "Tamil Nadu";
location.country = "India";
location.countryCode = "IN";

ZohoSalesIQ.setVisitorLocation(location);