ua parser enrichment

Ben Fradet edited this page Aug 21, 2018 · 11 revisions

HOME > SNOWPLOW SETUP GUIDE > Step 3: Setting up Enrich > Configurable enrichments > ua-parser enrichment

Compatibility

JSON Schema iglu:com.snowplowanalytics.snowplow/ua_parser_config/jsonschema/1-0-1

Compatibility r109+

Data provider ua-parser

Overview

This enrichment uses the ua-parser library to parse the useragent and attach a ua_parser_context to each event.

Example

{
  "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"
    }
  }
}

You can check the hosted assets page to know more about the database we host.

The context generated by the enrichment adheres to this schema.

Data sources

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

Algorithm

This enrichment uses 3rd party ua_parser Java library.

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

Data generated

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.

Field Purpose
useragent_family Useragent family (browser) name
useragent_major Useragent major version
useragent_minor Useragent minor version
useragent_patch Useragent patch version
useragent_version Full version of the useragent
os_family Operation system name
os_major Operation system major version
os_minor Operation system minor version
os_patch Operation system patch version
os_patch_minor Operation system patch minor version
os_version Operation system full version
device_family Device type
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.