Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

Desktop browsers return as Other. #493

Closed
mamoorkhan opened this issue Jan 8, 2015 · 11 comments
Closed

Desktop browsers return as Other. #493

mamoorkhan opened this issue Jan 8, 2015 · 11 comments

Comments

@mamoorkhan
Copy link

Using the UAParser for CSharp, when useragents of different desktop browsers are presented to the parser, it correctly identifies the OS and Browser but returns 'Other' as Device type.

@Ironholds
Copy link
Collaborator

...yes. What do you think it should be doing?

@mamoorkhan
Copy link
Author

It should be saying as desktop or pc or mac, something like that, which give a more clearer image, as in other could be some older era phones also

@Ironholds
Copy link
Collaborator

And it knows that it's a desktop how? And, PC is a specific model, how?

The entire point of "other" is "the user agent does not include an explicit string identifying the device model, so we can't provide that device model". Desktop browsers don't do that; there's no way to determine if it's a PC, or a Mac, or a netbook, or, as you note, an older phone. The parser can only work from the information that's actually in the user agent.

@mamoorkhan
Copy link
Author

it can just simply point out that its a PC, simple

@Ironholds
Copy link
Collaborator

Except the goal is to identify specific device models, not device classes, and you haven't explained how it would "simply" do this (or provided example user agents which would allow this information to be extracted, and have a problem).

@mamoorkhan
Copy link
Author

with the OS classified into device classes

@Ironholds
Copy link
Collaborator

Except, again, the goal is to identify devices, not device classes, and OS is not uniformly a mapper to the actual hardware. Nor is it uniformly a mapper to a single class of hardware.

@mamoorkhan
Copy link
Author

can you point me in a direction if I want to know the device class too?

@Ironholds
Copy link
Collaborator

No; there isn't a project for that that I'm aware of. It has been discussed as a future feature but we haven't started work on it yet.

@mamoorkhan
Copy link
Author

best of luck with that

@mrjgreen
Copy link

mrjgreen commented Jan 9, 2015

Just to add to this, if your application really needs to log some sort of device type for desktops and "Other" isn't acceptable to your users, you could make a reasonable effort by adding some simple custom logic after the UA Parser stage. Something like this may give you an acceptable output:

if($device === 'Other')
{
    $device = contains($osFamily, 'mac os') ? 'Mac' : 'PC'; // Or whatever identifiers you want
}

We have a similar issue to contend with - essentially our users don't understand the difficulties of user agent parsing, they just want to know how many Mac users VS PC users they have, so we have no choice but to try and provide that information, even if the results are spurious. Our logic is slightly more complex than this and also uses this extended set of regexes which include brand/model, which commenthol has been trying to get merged into the core for some time now.

It all depends on what you need and how much work you are willing to do but as @Ironholds has said, it is impossible to tell what the desktop model is from the user agent string because the information is not supplied.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants