ua parser enrichmentΒΆ

This enrichment uses the ua-parser library to parse the useragent and attach a ua_parser_context to each event. It can be used as a replacement of the user_agent_utils enrichment.

{
    "schema": "iglu:com.snowplowanalytics.snowplow/ua_parser_config/jsonschema/1-0-0",
    "data": {
        "vendor": "com.snowplowanalytics.snowplow",
        "name": "ua_parser_config",
        "enabled": true,
        "parameters": {}
    }
}

You can additionally specify a database:

{
  "schema": "iglu:com.snowplowanalytics.snowplow/ua_parser_config/jsonschema/1-0-0",
  "data": {
    "vendor": "com.snowplowanalytics.snowplow",
    "name": "ua_parser_config",
    "enabled": true,
    "parameters": {
      "uri": "s3://snowplow-hosted-assets/third-party/ua-parser",
      "database": "regexes-latest.yaml"
    }
  }
}

The context generated by the enrichment adheres to this schema.

The input value for the enrichment comes from ua parameter which is mapped to useragent field in atomic.events table.

This enrichment uses 3rd party ua_parser Java library. This library handles some useragent strings (such as mobile app useragents) better than user-agent-utils, which is relied on in User agent utils enrichment.

As an example, the useragent string

Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36

Will be parsed with the following result:

Parameter Value
useragent_family Chrome
useragent_major 48
useragent_minor  
useragent_patch 2564
os_family Windows 7
os_major  
os_minor  
os_patch_minor  
device_family Other

If ua-parser is enabled, then the Snowplow Enrichment process will write its results into a new context, ua_parser_context. As a result the following fields in the dedicated com_snowplowanalytics_snowplow_ua_parser_context_1 table would be populated.