Device Application Object: Location attributesAdded by IBM | Edited by IBM on April 12, 2013 | Version 2 (Show original)
|You can use location to tailor the content that displays. The Device application object contains five location attributes that you can use in rules that you create: latitude, longitude, country, state, and city.
To receive latitude and longitude information from a user's device:
- You must enable the geolocation theme module on IBM® WebSphere® Portal.
- The user that accesses your site must use a device that is location aware and selected to share location information about their device to your site.
- The client software on the device (the browser) must support HTML5.
Country, state, and city attributes are resolved from the latitude and longitude coordinates of the user's device or from the IP address that is obtained by using a reverse geocoding service. A reverse geocoding service is not provided with WebSphere
Portal. Use the geolocation interface and registration mechanism that is provided with WebSphere
Portal to define how to deploy the service you use.
Enabling the geolocation theme moduleParent topic: Device application object
Unlike the other application objects that are installed by default, the geolocation features of the Device application object are not enabled after you run the ConfigEngine enable-new-8001-features
or the ConfigEngine enable-content-targeting-extension
task. To enable the geolocation features, you can modify the JSON profiles to include the geolocation theme module, provide a resolver JAR, or use both methods.
Retrieving the location of users or devices
To implement the geolocation interface, you must provide methods to resolve coordinates or IP address to one or more of the location attributes (country, state, or city). You can determine the location of a device by using reverse geocoding or by using service providers. Reverse geocoding converts latitude and longitude coordinates into a location (such as country, state, or city) by using a geolocation JAR that you provide or by using an external geolocation service provider.
Example: Creating a segment that uses the state attribute
Learn more about the Device application object through an example that uses a location attribute (state). In this example, you are creating two segments by using a profiler rule: North Carolina and California. Each segment views content that is based on the location of the device.