dw.util
Class Geolocation

Read-only class representing a position on the earth (latitude and longitude)
and information associated with that location (e.g. country, city, etc). The
Commerce Cloud Digital system can provide geolocation information for a Request
and this information can be used in customer group segmentation rules.
Note: This class is not related to the store locator API (i.e. the GetNearestStores pipelet) which uses a static set of store locations loaded into the system by the merchant.
This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
Properties
available
:
boolean
(Read Only)
Returns 'true' if a valid GeoLocation was found for the IP address
(meaning at least Latitude and Longitude were found), false otherwise.
city
:
String
(Read Only)
Get the city name in English associated with this location.
countryCode
:
String
(Read Only)
Get the ISO country code associated with this location.
countryName
:
String
(Read Only)
Get the country name in English that the system associates with this location on the
earth.
latitude
:
Number
(Read Only)
Get the latitude coordinate associated with this location which is a
number between -90.0 and +90.0.
longitude
:
Number
(Read Only)
Get the longitude coordinate associated with this location which is a
number between -180.0 and +180.0.
metroCode
:
String
(Read Only)
Get the metro code associated with this location.
postalCode
:
String
(Read Only)
Get the postal code associated with this location.
regionCode
:
String
(Read Only)
Get the region (e.g. province or state) code for this location.
regionName
:
String
(Read Only)
Get the region (e.g. province in state) name in English that the system
associates with this location.
Constructor Summary
Method Summary
getCountryCode()
:
String
Get the ISO country code associated with this location.
getCountryName()
:
String
Get the country name in English that the system associates with this location on the earth.
getLatitude()
:
Number
Get the latitude coordinate associated with this location which is a number between -90.0 and +90.0.
getLongitude()
:
Number
Get the longitude coordinate associated with this location which is a number between -180.0 and +180.0.
getMetroCode()
:
String
Get the metro code associated with this location.
getPostalCode()
:
String
Get the postal code associated with this location.
getRegionCode()
:
String
Get the region (e.g.
getRegionName()
:
String
Get the region (e.g.
isAvailable()
:
boolean
Returns 'true' if a valid GeoLocation was found for the IP address (meaning at least Latitude and Longitude were found), false otherwise.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβthis is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Constructor Detail
Geolocation
public Geolocation(countryCode
:
String, countryName
:
String, regionCode
:
String, regionName
:
String, metroCode
:
String, city
:
String, postalCode
:
String, latitude
:
Number, longitude
:
Number)
Constructor for a Geolocation object
Parameters:
countryCode
-
the ISO country code associated with this location. The two-character ISO 3166-1 alpha code for the country.
countryName
-
the country name in English that the system associates with this location on the earth.
regionCode
-
the region (e.g. province or state) code for this location. This is a string up to three characters long containing the subdivision portion of the code.
regionName
-
the region (e.g. province in state) name in English that the system associates with this location.
metroCode
-
the metro code associated with this location. The metro code of the location if the location is in the US. See the Google AdWords API for values
city
-
the city name in English associated with this location.
postalCode
-
the postal code associated with this location.
latitude
-
the latitude coordinate associated with this location which is a number between -90.0 and +90.0.
longitude
-
the longitude coordinate associated with this location which is a number between -180.0 and +180.0.
Method Detail
getCity
getCity()
:
String
Get the city name in English associated with this location.
Returns:
the city that the system associates with this location on the earth.
getCountryCode
getCountryCode()
:
String
Get the ISO country code associated with this location.
Returns:
The two-character ISO 3166-1 alpha code for the country.
getCountryName
getCountryName()
:
String
Get the country name in English that the system associates with this location on the
earth.
Returns:
the country name that the system associates with this location on the earth.
getLatitude
getLatitude()
:
Number
Get the latitude coordinate associated with this location which is a
number between -90.0 and +90.0.
Returns:
The latitude of the location as a floating point number.
getLongitude
getLongitude()
:
Number
Get the longitude coordinate associated with this location which is a
number between -180.0 and +180.0.
Returns:
The longitude of the location as a floating point number.
getMetroCode
getMetroCode()
:
String
Get the metro code associated with this location.
Returns:
The metro code of the location if the location is in the US. See the Google AdWords API for returned values.
getPostalCode
getPostalCode()
:
String
Get the postal code associated with this location.
Returns:
The postal code of the location. Postal codes are not available for all countries. In some countries, this will only contain part of the postal code.
getRegionCode
getRegionCode()
:
String
Get the region (e.g. province or state) code for this location.
Returns:
This is a string up to three characters long containing the subdivision portion of the code.
getRegionName
getRegionName()
:
String
Get the region (e.g. province in state) name in English that the system
associates with this location.
Returns:
the region name that the system associates with this location on the earth.
isAvailable
isAvailable()
:
boolean
Returns 'true' if a valid GeoLocation was found for the IP address
(meaning at least Latitude and Longitude were found), false otherwise.
Returns:
'true' if a valid GeoLocation was found for the IP address (meaning at least Latitude and Longitude were found), false otherwise.