Title

parseuas -- Extract detailed information from user agent strings

Syntax

parseuas varname [if exp] [in range]
[, options]

where varname is a string variable containing the
user agent strings.

Main
browser(newvar) generates a variable containing the information on the browser name

browserversion(newvar) generates a variable containing the information on the version of the browser

os(newvar) generates a variable containing the information on the operating system

device(newvar) generates a variable containing the information on the device type

smartphone(newvar) generates a dummy variable, which indicates whether a smartphone was used

tablet(newvar) generates a dummy variable, which indicates whether a tablet computer was used

Optional
numeric generate numeric variables instead of strings

noisily output of frequency tables for browser name, browser version, operating system, and device type

Description

The parseuas module extracts detailed information from user agent strings.
The user agent is software that acts as interface to the user, for example
a web browser. The client software sending the request to a server is identified
in a user agent header field. The header contains the so-called user agent
string. In general, user agent strings include information on the browser
name, the browser version, the operating system, and the device type.
The parseuas module displays and optionally stores this information in new
variables as specified by the user. For more details regarding user agent strings and how
parseuas extracts information we refer to Roßmann, Gummer, & Kaczmirek (2020).

Example for a user agent string:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36"
(Windows 10 running on a 64-bit personal computer. The browser is Chrome version 85.0.4183.102).

The parseuas module gives the names and versions of several popular web browsers and a residual category:
Android Webkit, Apple Webkit, Chrome, Edge, Firefox, Internet Explorer, Opera,
Safari, Samsung Internet Browser, Silk, Vivaldi, Yandex, and Browser (other)

It codes several types and versions of some widely used operating systems and a residual category:
Android, Chrome OS, iOS, Linux, Mac OS X, Windows, and OS (other)

The parseuas module also codes several categories for the device type:
Mobile phone (Android), Mobile phone (Windows), Mobile phone (iPhone), Mobile phone (other),
Personal computer (Chrome OS), Personal computer (Linux), Personal computer (Mac),
Personal computer (Windows), Tablet (Android), Tablet (Windows), Tablet (iPad), Tablet (other),
Video game console, and Device (other)

Examples

Display information on the device type, the browser name and version,
and the operating system for all cases in the data set.

. parseuas useragentstring, noisily

Display information on the device type, the browser name and version,
and the operating system for the first case in the data set.

. parseuas useragentstring in 1, noisily

Save complete information from user agent strings in numeric variables
for all cases in the data set.

. parseuas useragentstring, bro(browser) browserv(browserversion) os(operatingsystem)
device(device) smart(smartphone) tab(tablet) numeric

Save complete information from user agent strings in string
variables for all cases of group one.

. parseuas useragentstring if group==1, bro(browser)
browserv(browserversion) os(operatingsystem)
device(device) smart(smartphone) tab(tablet)

Authors

Joss Roßmann, GESIS - Leibniz Institute for the Social Sciences, joss.rossmann@gesis.org

Tobias Gummer, GESIS - Leibniz Institute for the Social Sciences, tobias.gummer@gesis.org

Copyright (C) 2020 Joss Roßmann & Tobias Gummer

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details <http://www.gnu.org/licenses/>.

Recommended citation (APA Style, 6th ed.):

Roßmann, J., & Gummer, T. (2020): PARSEUAS: Stata module to extract detailed
information from user agent strings (Version: 1.4) [Computer Software].
Chestnut Hill, MA: Boston College.

References

Roßmann, J., Gummer, T., & Kaczmirek, L. (2020). Working with User Agent Strings in Stata: The parseuas Command. Journal of Statistical Software, 92(1), 1-16.
doi: 10.18637/jss.v092.c01

Notes

The parseuas module partly draws on dictionaries for coding. Use
adoupdate to get the latest version.
The installed version is 1.4 (18-Sep-2020).