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

Prebid core: add utility to retrieve user agent client hints #8826

Merged
merged 5 commits into from
Oct 6, 2022

Conversation

dgirardi
Copy link
Collaborator

Type of change

  • Feature

Description of change

This adds a library utility to retrieve UA client hints formatted as an ORTB 2.6 device.sua object.

Note that:

  • the browser API seems to be in the early stages, with only Chromium supporting it, and likely subject to change. There are promises involved now and maybe more in the future. For this reason I think it's too early to have Core query it by default, since it's possible for that to become too expensive / invasive at any point in the future.
  • the only potential consumer (sspBC) is not sending out an ORTB payload, so it's not easily refactored to use this.

Other information

Closes #8381

Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dgirardi,

The change looks good to me. I know there's a FPD Enrichment module and validation module.

Do we wanna pre-populate device.sua and call this library from that module?

In future, if Core needs to access these client hints values instead of parsing the string, do we have to write another function (possibly in utils.js)?

We would also need to document this.

Thanks.

@dgirardi
Copy link
Collaborator Author

It makes sense to use this from FPD enrichment, I'll update this PR shortly.

I don't understand this:

In future, if Core needs to access these client hints values instead of parsing the string,

which string? I think this could be used directly by core, although it wouldn't make sense to have it as a library then.

@Fawke
Copy link
Contributor

Fawke commented Aug 17, 2022

which string? I think this could be used directly by core, although it wouldn't make sense to have it as a library then.

I meant the user agent string. For example, here we are checking for a safari browser.

I don't know if there'll ever be a use case for Core that makes use of userAgent information. So, I think, it's fine to have it as a library.

Copy link
Collaborator

@osazos osazos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Fawke
Copy link
Contributor

Fawke commented Sep 21, 2022

Hi @dgirardi,

The change looks good. But do we wanna put a note in the Prebid.org docs somewhere to let adapter contributors know about this module, and how to use it?

@ChrisHuie ChrisHuie merged commit 0229b54 into prebid:master Oct 6, 2022
JacobKlein26 pushed a commit to nextmillenniummedia/Prebid.js that referenced this pull request Feb 9, 2023
…8826)

* Prebid core: add utility to retrieve user agent client hints

* Cache enrichments FPD between auctions

* Set device.sua from fpdEnrichment
jorgeluisrocha pushed a commit to jwplayer/Prebid.js that referenced this pull request May 23, 2023
…8826)

* Prebid core: add utility to retrieve user agent client hints

* Cache enrichments FPD between auctions

* Set device.sua from fpdEnrichment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intent to implement: User Agent Client Hints
5 participants