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

Injecting native asset.id #2235

Closed
bretg opened this issue Apr 26, 2022 · 3 comments
Closed

Injecting native asset.id #2235

bretg opened this issue Apr 26, 2022 · 3 comments

Comments

@bretg
Copy link
Contributor

bretg commented Apr 26, 2022

Prebid.js issue prebid/Prebid.js#8317 updated the PBS adapter to inject asset.ids for native. The imp.native.asset[].id field is required by the ORTB 1.2 Native spec, but not sent by PBJS.

Currently PBS has one native-specific feature documented at https://docs.prebid.org/prebid-server/features/pbs-native.html, but is mostly a pass-through.

I propose that we add a host-level option to turn off the injection of sequential asset ids:

  1. Check the host-level config (e.g. settings.native.insert-asset-ids). If it exists and is 'false', stop. Otherwise continue. (i.e. the feature is on by default)
  2. For each imp in the request, check to see if imp[].native exists. If not, go to the next imp.
  3. If imp[].native exists, scan the imp[].native.assets[] array to find out if any of the assets already have an ID. If any do, then no action is taken. PBS will not attempt to insert IDs for input that has a mix of blank and specified IDs.
  4. If there's no entry in the imp[].native.assets[] array that contains an id, then create an id element for all of them, starting at 1 and incrementing by 1. i.e. imp[N].native.assets[0].id=1, imp[N].native.assets[1].id=2, etc.
@SyntaxNode
Copy link
Contributor

This feature already exists in PBS-Go with the following slight differences:

  • This feature is always enabled there is no config flag to disable it.
  • The computed native ids start at 0 and auto-increment, instead of starting at 1.

@bretg
Copy link
Contributor Author

bretg commented Apr 29, 2022

I confirmed it's already done in PBS-Java too. Makes me wonder why @jsnellbaker needed to do this the pbsBidAdapter? Anyhow, closing this issue.

@bretg bretg closed this as completed Apr 29, 2022
@bretg
Copy link
Contributor Author

bretg commented Apr 29, 2022

Updated the docs in prebid/prebid.github.io#3746

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

No branches or pull requests

2 participants