User location and device details

Akamai makes user location and device details available to EdgeWorkers. Uniform makes these details available to the classification process using quirks. Quirks, in turn, can be used to configure personalization instructions.

The EdgeWorker has access to Akamai EdgeScape data. Uniform is able to expose this data as quirks so it can be used in the classification process. You must specify which values you want to be exposed in this way by modifying the EdgeWorker code.

The following JavaScript code sample demonstrates how to specify several values to be exposed as quirks:

import { createResponse } from 'create-response'; import { createAkamaiEdgeContext, createAkamaiProxyEdgeHandler } from '@uniformdev/context-edge-akamai'; export async function responseProvider(request) { const manifest = { project: {} }; const context = createAkamaiEdgeContext({ request, manifest }); const handler = createAkamaiProxyEdgeHandler(); const { processed, response } = await handler({ context, request, quirks: { userLocation: ["city", "country"], device: ["isMobile"], } }); return createResponse(response.status, response.headers, response.body); }

Uniform supports the following quirks:

CategoryNameDescription
DeviceacceptsThirdPartyCookietrue if the browser accepts third party cookies; false otherwise.
DevicebrandNameBrand name of the device.
DevicehasAjaxSupporttrue if the device supports the JavaScript functions required to make AJAX calls; false otherwise.
DevicehasCookieSupporttrue if the browser supports cookies; false otherwise.
DevicehasFlashSupporttrue if the browser supports Flash; false otherwise.
DeviceisMobiletrue if the device is a mobile device; false otherwise.
DeviceisTablettrue if the device is a tablet; false otherwise.
DeviceisWirelesstrue if the device is a wireless device; false otherwise.
DevicemarketingNameMarketing name of the device.
DevicemobileBrowserMobile browser name.
DevicemobileBrowserVersionMobile browser version.
DevicemodelNameModel name of the device.
DeviceosDevice operation system.
DeviceosVersionDevice operating system version.
DevicephysicalScreenHeightPhysical screen height (in millimeters).
DevicephysicalScreenWidthPhysical screen width (in millimeters).
DeviceresolutionHeightScreen resolution height (in pixels).
DeviceresolutionWidthScreen resolution width (in pixels).
DevicexhtmlSupportLevelBrowser's level of support for XHTML.
User locationcityThe city (within a 50-mile radius) that the IP address maps to.
User locationcontinentA 2-letter code that identifies the continent that the IP address maps to.
User locationcountryA 2-letter code (ISO-3166) that identifies the country that the IP address maps to.
User locationregionA 2-letter code (ISO-3166) that identifies the state, province, or region that the IP address maps to.
User locationzipCodeThe ZIP code or postal code that the IP address maps to. This value is only available for IP addresses associated with the US, Puerto Rico and Canada.

tip

For details on the specific values that the quirks will be populated with, see the Akamai documentation for the device object and the user location object.

In the previous section you configured the EdgeWorker to make quirks available to the classification process. In order for personalization rules to be configured to use the quirks, the quirks must be defined in Uniform.

If you want to personalize using any of the following quirks, you should install the Akamai integration:

CategoryConfiguration namePublic IDDefinition name
DevicebrandNameaka-device-brandNameDevice Brand Name
DeviceisMobileaka-device-isMobileDevice Is Mobile
DeviceisTabletaka-device-isTabletDevice Is Tablet
DevicemodelNameaka-device-modelNameDevice Model Name
Deviceosaka-device-osDevice Operating System
User locationcityaka-loc-cityCity
User locationcontinentaka-loc-continentContinent Code
User locationcountryaka-loc-countryCountry Code
User locationregionaka-loc-regionRegion Code
  1. In Uniform, open your project.

  2. Navigate to the Integrations tab.

    browse-integrations
  3. Click Akamai.

    add-to-project
  4. Click Add to project.

    integration-added
  5. Navigate to Personalization > Quirks.

    available-quirks

    About this step

    You will see a list of quirks that were added by the Akamai integration.

If you want to personalize using any of the following quirks, you must define the quirks yourself:

CategoryConfiguration namePublic IDData type
DeviceacceptsThirdPartyCookieaka-device-acceptsThirdPartyCookieList: true/false
DevicehasAjaxSupportaka-device-hasAjaxSupportList: true/false
DevicehasCookieSupportaka-device-hasCookieSupportList: true/false
DevicehasFlashSupportaka-device-hasFlashSupportList: true/false
DeviceisWirelessaka-device-isWirelessList: true/false
DevicemarketingNameaka-device-marketingNameText
DevicemobileBrowseraka-device-mobileBrowserText
DevicemobileBrowserVersionaka-device-mobileBrowserVersionText
DeviceosVersionaka-device-osVersionText
DevicephysicalScreenHeightaka-device-physicalScreenHeightText
DevicephysicalScreenWidthaka-device-physicalScreenWidthText
DeviceresolutionHeightaka-device-resolutionHeightText
DeviceresolutionWidthaka-device-resolutionWidthText
DevicexhtmlSupportLevelaka-device-xhtmlSupportLevelText
User locationzipCodeaka-loc-zipCodeText

About this step

When you configure these quirks, you must use the public ID from the table above. This is because the logic in the EdgeWorker will set the quirk values using these values.

Now you can create signals using the quirks you added.

configure-signal

tip

All the defined quirks are listed here, even if the quirk was not specified in the EdgeWorker. If you select a quirk that's not populated, you won't get an error; the quirk won't exist (i.e. the signal operator exists will be false and the operator does not exist will be true. ).