# User location and device details

> Uniform makes user details available to the classification process using quirks.

Source: https://docs.uniform.app/docs/integrations/cdn/akamai/user-location-and-device

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.

## Identify EdgeScape data to include

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:

```js
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:

| Category | Name | Description |
| --- | --- | --- |
| Device | `acceptsThirdPartyCookie` | `true` if the browser accepts third party cookies; `false` otherwise. |
| Device | `brandName` | Brand name of the device. |
| Device | `hasAjaxSupport` | `true` if the device supports the JavaScript functions required to make AJAX calls; `false` otherwise. |
| Device | `hasCookieSupport` | `true` if the browser supports cookies; `false` otherwise. |
| Device | `hasFlashSupport` | `true` if the browser supports Flash; `false` otherwise. |
| Device | `isMobile` | `true` if the device is a mobile device; `false` otherwise. |
| Device | `isTablet` | `true` if the device is a tablet; `false` otherwise. |
| Device | `isWireless` | `true` if the device is a wireless device; `false` otherwise. |
| Device | `marketingName` | Marketing name of the device. |
| Device | `mobileBrowser` | Mobile browser name. |
| Device | `mobileBrowserVersion` | Mobile browser version. |
| Device | `modelName` | Model name of the device. |
| Device | `os` | Device operation system. |
| Device | `osVersion` | Device operating system version. |
| Device | `physicalScreenHeight` | Physical screen height (in millimeters). |
| Device | `physicalScreenWidth` | Physical screen width (in millimeters). |
| Device | `resolutionHeight` | Screen resolution height (in pixels). |
| Device | `resolutionWidth` | Screen resolution width (in pixels). |
| Device | `xhtmlSupportLevel` | Browser's level of support for XHTML. |
| User location | `city` | The city (within a 50-mile radius) that the IP address maps to. |
| User location | `continent` | A 2-letter code that identifies the continent that the IP address maps to. |
| User location | `country` | A 2-letter code (ISO-3166) that identifies the country that the IP address maps to. |
| User location | `region` | A 2-letter code (ISO-3166) that identifies the state, province, or region that the IP address maps to. |
| User location | `zipCode` | The 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](https://techdocs.akamai.com/edgeworkers/docs/device-object)
> and the [user location object](https://techdocs.akamai.com/edgeworkers/docs/user-location-object).

## Add quirk definitions

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.

### Pre-configured quirk definitions

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

| Category | Configuration name | Public ID | Definition name |
| --- | --- | --- | --- |
| Device | `brandName` | `aka-device-brandName` | Device Brand Name |
| Device | `isMobile` | `aka-device-isMobile` | Device Is Mobile |
| Device | `isTablet` | `aka-device-isTablet` | Device Is Tablet |
| Device | `modelName` | `aka-device-modelName` | Device Model Name |
| Device | `os` | `aka-device-os` | Device Operating System |
| User location | `city` | `aka-loc-city` | City |
| User location | `continent` | `aka-loc-continent` | Continent Code |
| User location | `country` | `aka-loc-country` | Country Code |
| User location | `region` | `aka-loc-region` | Region Code |

1. In Uniform, open your project.
2. Navigate to **Settings > Integrations**.

   ![](https://docs.uniform.app/images/integrations/cdn/akamai/browse-integrations.png)
3. Click **Akamai**.

   ![](https://docs.uniform.app/images/integrations/cdn/akamai/add-to-project.png)
4. Click **Add to project**.

   ![](https://docs.uniform.app/images/integrations/cdn/akamai/integration-added.png)
5. Navigate to **Optimization > Quirks**.

   ![](https://docs.uniform.app/images/integrations/cdn/akamai/available-quirks.png)

   > **Note:**
   >
   > You will see a list of quirks that were added by the Akamai integration.

### Manual quirk definition

If you want to personalize using any of the following quirks, you
must [define the quirks](https://docs.uniform.app/docs/guides/classification/quirks) yourself:

| Category | Configuration name | Public ID | Data type |
| --- | --- | --- | --- |
| Device | `acceptsThirdPartyCookie` | `aka-device-acceptsThirdPartyCookie` | List: `true/false` |
| Device | `hasAjaxSupport` | `aka-device-hasAjaxSupport` | List: `true/false` |
| Device | `hasCookieSupport` | `aka-device-hasCookieSupport` | List: `true/false` |
| Device | `hasFlashSupport` | `aka-device-hasFlashSupport` | List: `true/false` |
| Device | `isWireless` | `aka-device-isWireless` | List: `true/false` |
| Device | `marketingName` | `aka-device-marketingName` | Text |
| Device | `mobileBrowser` | `aka-device-mobileBrowser` | Text |
| Device | `mobileBrowserVersion` | `aka-device-mobileBrowserVersion` | Text |
| Device | `osVersion` | `aka-device-osVersion` | Text |
| Device | `physicalScreenHeight` | `aka-device-physicalScreenHeight` | Text |
| Device | `physicalScreenWidth` | `aka-device-physicalScreenWidth` | Text |
| Device | `resolutionHeight` | `aka-device-resolutionHeight` | Text |
| Device | `resolutionWidth` | `aka-device-resolutionWidth` | Text |
| Device | `xhtmlSupportLevel` | `aka-device-xhtmlSupportLevel` | Text |
| User location | `zipCode` | `aka-loc-zipCode` | Text |

> **Note:**
>
> 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.

## Create signal using quirk

Now you can create [signals](https://docs.uniform.app/docs/guides/classification/signals) using the quirks you added.

![](https://docs.uniform.app/images/integrations/cdn/akamai/configure-signal.png)

> **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`. ).
