Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] New Module for device from User-Agent #8217

Closed
maphe opened this issue Mar 25, 2022 · 9 comments
Closed

[Feature Request] New Module for device from User-Agent #8217

maphe opened this issue Mar 25, 2022 · 9 comments
Labels

Comments

@maphe
Copy link
Contributor

maphe commented Mar 25, 2022

Type of issue

Feature Request

Description

Is there any chance for a new Prebid Module that would generate a populated device open RTB object (as much as possible)? As of now we can get the User Agent string from the adapter but we cannot use a third party library that would parse the UA and make a comprehensive open RTB device object (things like devicetype, make, model, h and w, etc). Also doing some sort of custom parsing in the adapter would make maintenance a bit painful.

I imagine something similar to the User module that centralizes the generation of user ids.

I know it is doable server side from the UA string but having it client side could make the bids respond faster.

@patmmccann
Copy link
Collaborator

patmmccann commented Mar 25, 2022

Part of your request (h&w) is done: 11492e9

Do you think it is useful to buyers to get https://github.com/InteractiveAdvertisingBureau/AdCOM/blob/master/AdCOM%20v1.0%20FINAL.md#list_devicetypes ?

They can parse ua's for themselves generally, ua parsing generally feels like a task better achieved server side.

@maphe
Copy link
Contributor Author

maphe commented Mar 25, 2022

Nice, thanks for pointing it out. Any chance to see some other device data being added in the future?

@patmmccann
Copy link
Collaborator

patmmccann commented Mar 25, 2022

It is a huge file https://github.com/ua-parser/uap-core/blob/master/regexes.yaml ; mobile / not mobile seems easy to achieve but make and model seems unlikely, especially as the world moves to make these ua strings less detailed, not more.

@maphe
Copy link
Contributor Author

maphe commented Mar 25, 2022

Yeah we had some back and forth internally to figure out where we wanna do it, obviously doing it within the adapter is not realistic so we might end up with some server side processing but it's a trade off too as we're delaying the bid. Having some stuff provided by the prebid core would be nice, but I understand some are trickier to obtain.

For context, buyers seem to be pretty inconsistent on what they do themselves with the User-Agent, and the ones that don't parse it on their own seem to expect a more complete device object. I know device type, make and model have be mentioned lately. I can probably come back with a more detailed list of valuable attributes if you think there's a chance they get managed by the prebid core.

@patmmccann
Copy link
Collaborator

I can't see this being in core, but a module to enrich the first party data in the ortb2 object is already a thing; this could be part of that module if it is pretty terse, or its own module if the parsing is expensive with regards to the number of regex's

@maphe
Copy link
Contributor Author

maphe commented Mar 25, 2022

Ok great, I'll keep an eye out for it. Thank you

@dgirardi
Copy link
Collaborator

dgirardi commented Mar 25, 2022

The processing is not any faster client side, you may be able to bid faster but the auction had to start later (if you care about the nanoseconds)...

There's an argument to be made for client-side maybe being more fair, as it won't penalize bidders that choose to sniff the UA. However, I suspect that any bidder that finds that info important will end up generating it server-side anyway, as when a new agent appears updating your fleet is a lot easier than asking every client in the universe to update Prebid.

@patmmccann
Copy link
Collaborator

Timeout RTD provider has this functionality, but appears wrong

function getDeviceType() {
const userAgent = window.navigator.userAgent.toLowerCase();
if ((/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent))) {
return 5; // tablet
}
if ((/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(userAgent))) {
return 4; // mobile
}
return 2; // personal computer
}

I propose:

'Windows NT' - Desktop
Macintosh - Desktop
tablet|ipad - Tablet
Mobi|Phone & !tablet- Phone

with no fallback to type 2, just leave it blank for devicetype.

@patmmccann
Copy link
Collaborator

Closing as partially solved in #11414 ; and that @dgirardi 's feedback is quite accurate, any client side parsing will inevitably become stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants