Skip to main content

UA parser enrichment

This enrichment uses theΒ ua-parser libraryΒ to parse the user agent and provide information about the user's device.

Collecting and separating out all the valuable device information to be found in the user agent is a great way to get insight into the types of devices and operating systems and versions your users are using. This helps with deciding which to support as well as in decisions around functionality releases.

With the device family field which is part of the context you can also benefit from the lookup done with our database to sort the multitude of different devices into higher level device types like desktop, mobile, tablet, other, etc.

note

The YAUAA Enrichment supersedes this enrichment and is preferable in most cases as it will generate a richer dataset.

You can continue to use the UA Parser Enrichment. It is handy if you have memory constraints running the Enrich application, as it uses significantly less memory than the YAUAA enrichment. Additionally, the UA Parser enrichment does further parsing of the Operating System and Browser Version numbers.

Both enrichments will produce an additional entity attached to an event, based on the information available in the User-Agent header of the request from a user’s browser.

UA Parser vs YAUAA Output
UA Parser FieldYAUAA FieldExample (Firefox 106 on Mac OS X)
device_familydeviceClassDesktop
❌deviceNameApple Macintosh
❌deviceBrandApple
❌deviceCpuIntel
❌deviceCpuBits32
❌deviceFirmwareVersion
❌deviceVersion
❌operatingSystemClassDesktop
os_familyoperatingSystemNameMac OS X
os_versionoperatingSystemVersion10.15
os_majoroperatingSystemVersionMajor10
os_minor❌15
os_patch❌
os_patch_minoroperatingSystemVersionBuild
❌operatingSystemNameVersionMac OS X 10.15
❌operatingSystemNameVersionMajorMac OS X 10
❌layoutEngineClassBrowser
❌layoutEngineNameGecko
❌layoutEngineVersionGecko 106.0
❌layoutEngineVersionMajorGecko 106
❌layoutEngineNameVersion106.0
❌layoutEngineNameVersionMajor106
❌layoutEngineBuild20100101
❌agentClassBrowser
useragent_familyagentNameFirefox
useragent_versionagentVersion106.0
useragent_majoragentVersionMajor106
useragent_minor❌0
useragent_patch❌
❌agentNameVersionFirefox 106.0
❌agentNameVersionMajorFirefox 106
❌agentBuild
❌agentLanguage
❌agentLanguageCode
❌agentInformationEmail
❌agentInformationUrl
❌agentSecurity
❌agentUuid
❌webviewAppName
❌webviewAppVersion
❌webviewAppVersionMajor
❌webviewAppNameVersionMajor
❌facebookCarrier
❌facebookDeviceClass
❌facebookDeviceName
❌facebookDeviceVersion
❌facebookFBOP
❌facebookFBSS
❌facebookOperatingSystemName
❌facebookOperatingSystemVersion
❌anonymized
❌hackerAttackVector
❌hackerToolkit
❌koboAffiliate
❌koboPlatformId
❌iECompatibilityVersion
❌iECompatibilityVersionMajor
❌iECompatibilityNameVersion
❌iECompatibilityNameVersionMajor
❌carrier
❌gSAInstallationID
❌networkType

Configuration​

Testing with Micro

Unsure if your enrichment configuration is correct or works as expected? You can easily test it using Snowplow Micro on your machine. Follow the Micro usage guide to set up Micro and configure it to use your enrichment.

Input​

This enrichment uses the field useragent.

Output​

This enrichment adds a new context to the enriched event with this schema.

FieldDescription
useragent_familyUseragent family (browser) name
useragent_majorUseragent major version
useragent_minorUseragent minor version
useragent_patchUseragent patch version
useragent_versionFull version of the useragent
os_familyOperation system name
os_majorOperation system major version
os_minorOperation system minor version
os_patchOperation system patch version
os_patch_minorOperation system patch minor version
os_versionOperation system full version
device_familyDevice type

As an example, the User-Agent string

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

would be parsed with the following result:

PARAMETERVALUE
useragent_familyChrome
useragent_major48
useragent_minor-
useragent_patch2564
os_familyWindows 7
os_major-
os_minor-
os_patch_minor-
os_versionWindows 7
device_familyComputer

*empty values denoted by β€œ-β€œ

Was this page helpful?