# YAUAA enrichment
> Parse user agent strings with advanced detection using Yet Another UserAgent Analyzer for detailed device insights.
> Source: https://docs.snowplow.io/docs/pipeline/enrichments/available-enrichments/yauaa-enrichment/
> Documentation index: https://docs.snowplow.io/llms.txt

The YAUAA (Yet Another User Agent Analyzer) enrichment is a user agent parser and analyzer. It uses the [YAUAA library](https://yauaa.basjes.nl/). The library is stored in memory; there is no interaction with an external system.

If you don't need the full YAUAA output, consider using the [UA parser enrichment](/docs/pipeline/enrichments/available-enrichments/ua-parser-enrichment/) instead.

This enrichment adds an additional entity to the event.

## Input

This enrichment uses the following inputs:

- The `User-Agent` HTTP header of the tracker request.
- The `useragent` field from the [tracker payload](/docs/events/ootb-data/device-and-browser/), if set. This field has priority over the `User-Agent` HTTP header.
- [Client hint](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Client_hints) HTTP request headers.

The supported client hints headers are:

- `Sec-CH-UA` (low entropy)
- `Sec-CH-UA-Mobile` (low entropy)
- `Sec-CH-UA-Platform` (low entropy)
- `Sec-CH-UA-Full-Version-List`
- `Sec-CH-UA-Full-Version` (deprecated)
- `Sec-CH-UA-Arch`
- `Sec-CH-UA-Bitness`
- `Sec-CH-UA-Model`
- `Sec-CH-UA-Platform-Version`

## Configure high-entropy client hints

The YAUAA enrichment does not require you to make any changes to your website, if you are happy with the level of detail you get from the default user agent strings. However, it is possible to improve the accuracy of the user agent data produced by YAUAA, if you are able to configure your website to send [high-entropy client hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Client_hints#high_entropy_hints) to the Collector by following these instructions.

Chromium browsers will include low-entropy client hint HTTP request headers by default. To include the more detailed high-entropy client hint headers, additional configuration is required: specifying the hints to include with `Permissions-Policy` and `Accept-CH`.

Update the URLs to your Collector, and add this configuration to your web server:

```txt
Accept-CH: sec-ch-ua-full-version-list, sec-ch-ua-platform-version, sec-ch-ua-arch, sec-ch-ua-bitness, sec-ch-ua-model
Permissions-Policy: ch-ua-full-version-list=("https://<YOUR COLLECTOR>"), ch-ua-platform-version=("https://<YOUR COLLECTOR>"), ch-ua-arch=("https://<YOUR COLLECTOR>"), ch-ua-bitness=("https://<YOUR COLLECTOR>"), ch-ua-model=("https://<YOUR COLLECTOR>")
```

Alternatively, add the following `meta` tag with `Delegate-CH` to the header section of your site's HTML, updating the URLs to your Collector:

```html
<meta http-equiv="Delegate-CH" content="sec-ch-ua-full-version-list https://<YOUR COLLECTOR>; sec-ch-ua-platform-version https://<YOUR COLLECTOR>; sec-ch-ua-arch https://<YOUR COLLECTOR>; sec-ch-ua-bitness https://<YOUR COLLECTOR>; sec-ch-ua-model https://<YOUR COLLECTOR>">
```

## Configuration

The enrichment takes one parameter:

| Parameter   | Required | Description                                                                                                                  |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `cacheSize` | ❌        | Number of already parsed user agents to keep in memory for faster processing. Default is 10000. Set to 0 to disable caching. |

**Console:**

Configure the parameters in the Console enrichment editor. For example:

```json
{
  "cacheSize": 10000
}
```

**Self-Hosted:**

For Self-Hosted, [provide a complete JSON](/docs/pipeline/enrichments/managing-enrichments/terraform/). For example:

```json
{
  "schema": "iglu:com.snowplowanalytics.snowplow.enrichments/yauaa_enrichment_config/jsonschema/1-0-0",
  "data": {
    "enabled": true,
    "vendor": "com.snowplowanalytics.snowplow.enrichments",
    "name": "yauaa_enrichment_config",
    "parameters": {
      "cacheSize": 10000
    }
  }
}
```

***

> **Tip: Testing with Micro**
>
> Unsure if your enrichment configuration is correct or works as expected? You can easily test it using [Snowplow Micro](/docs/testing/snowplow-micro/), either [through Console](/docs/testing/snowplow-micro/console/) or [on your machine](/docs/testing/snowplow-micro/local/).

## Output

This enrichment adds a `yauaa_context` entity to the event.

If a field can't be determined, it won't be included. However, some fields can have the value `UNKNOWN`. The only field that will always be present is `deviceClass`. Check out the [YAUAA documentation](https://yauaa.basjes.nl/expect/fieldvalues/) for more details on the output fields.

### `yauaa_context`

**Type:** Entity

Schema for an entity generated by the YAUAA enrichment after parsing the user agent

**Properties:**

| Property                                   | Description                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `deviceClass` __                           | _Required._ See https\://yauaa.basjes.nl/README-Output.html Must be one of: `Desktop`, `Anonymized`, `Unknown`, `UNKNOWN`, `Mobile`, `Tablet`, `Phone`, `Watch`, `Virtual Reality`, `eReader`, `Set-top box`, `TV`, `Game Console`, `Handheld Game Console`, `Voice`, `Robot`, `Robot Mobile`, `Spy`, `Hacker` |
| `deviceName` _string_                      | _Optional._ Example: Google Nexus 6                                                                                                                                                                                                                                                                            |
| `deviceBrand` _string_                     | _Optional._ Example: Google                                                                                                                                                                                                                                                                                    |
| `deviceCpu` _string_                       | _Optional._                                                                                                                                                                                                                                                                                                    |
| `deviceCpuBits` _string_                   | _Optional._                                                                                                                                                                                                                                                                                                    |
| `deviceFirmwareVersion` _string_           | _Optional._                                                                                                                                                                                                                                                                                                    |
| `deviceVersion` _string_                   | _Optional._                                                                                                                                                                                                                                                                                                    |
| `operatingSystemClass` __                  | _Optional._ See https\://yauaa.basjes.nl/README-Output.html Must be one of: `Desktop`, `Mobile`, `Cloud`, `Embedded`, `Game Console`, `Hacker`, `Anonymized`, `Unknown`                                                                                                                                        |
| `operatingSystemName` _string_             | _Optional._ Examples: Linux, Android.                                                                                                                                                                                                                                                                          |
| `operatingSystemVersion` _string_          | _Optional._                                                                                                                                                                                                                                                                                                    |
| `operatingSystemNameVersion` _string_      | _Optional._                                                                                                                                                                                                                                                                                                    |
| `operatingSystemVersionBuild` _string_     | _Optional._                                                                                                                                                                                                                                                                                                    |
| `layoutEngineClass` __                     | _Optional._ See https\://yauaa.basjes.nl/README-Output.html Must be one of: `Browser`, `Mobile App`, `Hacker`, `Robot`, `Unknown`                                                                                                                                                                              |
| `layoutEngineName` _string_                | _Optional._                                                                                                                                                                                                                                                                                                    |
| `layoutEngineVersion` _string_             | _Optional._                                                                                                                                                                                                                                                                                                    |
| `layoutEngineVersionMajor` _string_        | _Optional._                                                                                                                                                                                                                                                                                                    |
| `layoutEngineNameVersion` _string_         | _Optional._                                                                                                                                                                                                                                                                                                    |
| `layoutEngineNameVersionMajor` _string_    | _Optional._                                                                                                                                                                                                                                                                                                    |
| `layoutEngineBuild` _string_               | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentClass` __                            | _Optional._ See https\://yauaa.basjes.nl/README-Output.html Must be one of: `Browser`, `Browser Webview`, `Mobile App`, `Robot`, `Robot Mobile`, `Cloud Application`, `Email Client`, `Voice`, `Special`, `Testclient`, `Hacker`, `Unknown`                                                                    |
| `agentName` _string_                       | _Optional._ Example: Chrome.                                                                                                                                                                                                                                                                                   |
| `agentVersion` _string_                    | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentVersionMajor` _string_               | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentNameVersion` _string_                | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentNameVersionMajor` _string_           | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentBuild` _string_                      | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentLanguage` _string_                   | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentLanguageCode` _string_               | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentInformationEmail` _string_           | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentInformationUrl` _string_             | _Optional._                                                                                                                                                                                                                                                                                                    |
| `agentSecurity` _string_                   | _Optional._ Must be one of: `Weak security`, `Strong security`, `Unknown`, `Hacker`                                                                                                                                                                                                                            |
| `agentUuid` _string_                       | _Optional._                                                                                                                                                                                                                                                                                                    |
| `webviewAppName` _string_                  | _Optional._                                                                                                                                                                                                                                                                                                    |
| `webviewAppVersion` _string_               | _Optional._                                                                                                                                                                                                                                                                                                    |
| `webviewAppVersionMajor` _string_          | _Optional._                                                                                                                                                                                                                                                                                                    |
| `webviewAppNameVersionMajor` _string_      | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookCarrier` _string_                 | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookDeviceClass` _string_             | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookDeviceName` _string_              | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookDeviceVersion` _string_           | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookFBOP` _string_                    | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookFBSS` _string_                    | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookOperatingSystemName` _string_     | _Optional._                                                                                                                                                                                                                                                                                                    |
| `facebookOperatingSystemVersion` _string_  | _Optional._                                                                                                                                                                                                                                                                                                    |
| `anonymized` _string_                      | _Optional._                                                                                                                                                                                                                                                                                                    |
| `hackerAttackVector` _string_              | _Optional._                                                                                                                                                                                                                                                                                                    |
| `hackerToolkit` _string_                   | _Optional._                                                                                                                                                                                                                                                                                                    |
| `koboAffiliate` _string_                   | _Optional._                                                                                                                                                                                                                                                                                                    |
| `koboPlatformId` _string_                  | _Optional._                                                                                                                                                                                                                                                                                                    |
| `iECompatibilityVersion` _string_          | _Optional._                                                                                                                                                                                                                                                                                                    |
| `iECompatibilityVersionMajor` _string_     | _Optional._                                                                                                                                                                                                                                                                                                    |
| `iECompatibilityNameVersion` _string_      | _Optional._                                                                                                                                                                                                                                                                                                    |
| `iECompatibilityNameVersionMajor` _string_ | _Optional._                                                                                                                                                                                                                                                                                                    |
| `carrier` _string_                         | _Optional._                                                                                                                                                                                                                                                                                                    |
| `gSAInstallationID` _string_               | _Optional._                                                                                                                                                                                                                                                                                                    |
| `networkType` _string_                     | _Optional._                                                                                                                                                                                                                                                                                                    |
| `operatingSystemNameVersionMajor` _string_ | _Optional._                                                                                                                                                                                                                                                                                                    |
| `operatingSystemVersionMajor` _string_     | _Optional._                                                                                                                                                                                                                                                                                                    |
