Page MenuHomePhabricator

Parse User-Agent strings with OS like "Windows 7" correctly into the user agent map {hawk}
Closed, DeclinedPublic8 Estimated Story Points

Description

Today, a User-Agent string like "... Windows 7 ..." is parsed into user_agent_map['os_family'] = 'Windows 7' and user_agent_map['os_major'] = '-'.
Shouldn't it be like: user_agent_map['os_family'] = 'Windows' and user_agent_map['os_major'] = '7'?

Event Timeline

mforns created this task.Feb 18 2016, 3:52 PM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 18 2016, 3:52 PM
mforns edited projects, added Analytics; removed Analytics-Kanban.Feb 18 2016, 3:52 PM

needs a user-agent upgrade, can check on the UA Parser github page

Milimetric triaged this task as Medium priority.Feb 18 2016, 6:25 PM
Milimetric moved this task from Incoming to Event Platform on the Analytics board.
Milimetric moved this task from Event Platform to Analytics Query Service on the Analytics board.
Nuria edited projects, added Analytics-Kanban; removed Analytics.Feb 25 2016, 5:37 PM
Nuria added a subscriber: Nuria.

Moving to kanban so this task is up for grabs as it is not so big.

Milimetric set the point value for this task to 8.Mar 3 2016, 5:33 PM
madhuvishy added a subscriber: madhuvishy.EditedMar 4 2016, 2:48 AM

Microsoft claims that the right User agent string for Windows 7 is something like "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)". See - https://msdn.microsoft.com/en-us/library/hh920767(v=vs.85).aspx

Windows NT 6.1 denotes Windows 7 and Windows NT 6.2 denotes Windows 8 So my guess is if a UA string has "Windows 7" in it - it is not probably not a real browser request?

However even if the string is Windows NT 6.1 or 6.2 UA parser doesn't set OS Major - and I wonder if this is expected behavior because windows OS-es have in the past been Windows ME, XP, Vista and those wouldn't be set in OS Major. So may be we shouldn't bother fixing this behavior?

@madhuvishy
This seems correct, you're right. I agree we should leave it as it is.

Nevertheless, my point was: in the case of Windows 7 it would seem logic to me to have os_family be Windows instead of Windows 7, and have os_major be 7 instead of -. I'd say that the UA parser is not taking advantage of the os_major field for Windows systems.

Nuria added a comment.Mar 7 2016, 4:26 PM

It will be good to take the opportunity of having looked into this to upgrade ua parser if proceeds.

We decide to use UA-parser convention which is to separate major version version of windows (like Win7, winXP, win95 for instance) into OS families.

JAllemandou closed this task as Declined.Apr 11 2016, 4:25 PM
JAllemandou moved this task from Next Up to Done on the Analytics-Kanban board.Apr 12 2016, 12:39 PM