-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: fix bug with some native assets being lost from ortb native responses #8785
Conversation
@dgirardi we stumbled over those two methods as well and I also do not know why those exist. Relates to #8773 |
@dgirardi I just used the debugging module to test our native ads and realized the following: and pasting pbjs.setConfig({
debugging: {
enabled: true,
intercept: [{
when: {
adUnitCode: 'gf_content_4'
},
then: {
cpm: 10,
bidderCode: 'yieldlab',
mediaType: 'native',
native: {
clickUrl: 'https://example.com',
title: 'Click this incredible test ad for you and the world',
body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea tak',
image: 'https://native-designs.h5v.eu/assets/stars-1200x627.jpg',
privacyLink: 'https://yieldlab.com/privacy-platform/'
}
}
}, ]
}
}); into the console, everything works as expected and the ad is shown in gf_content_4: However, when adding a pbjs.setConfig({
debugging: {
enabled: true,
intercept: [{
when: {
adUnitCode: 'gf_content_4'
},
then: {
cpm: 10,
bidderCode: 'smartadserver',
mediaType: 'native',
native: {
clickUrl: 'https://example.com',
title: 'Click this incredible test ad for you and the world',
body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea tak',
image: 'https://native-designs.h5v.eu/assets/stars-1200x627.jpg',
privacyLink: 'https://yieldlab.com/privacy-platform/',
cta: 'click me',
sponsoredBy: 'Highfivve'
}
}
}, ]
}
}); Does your PR fix this issue? |
It does now @anitaschiller . However I don't know if that's a real problem - it was throwing an error because the response contained assets that were not requested, which should hopefully not happen in practice. |
37af498
to
17b213b
Compare
17b213b
to
7cf6b86
Compare
Thanks for the quick debugging @dgirardi . Indeed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! only a minor comment that isn't necessary as a blocker to merging this PR
const ortbResponse = { | ||
...legacyPropertiesToOrtbNative(legacyResponse), | ||
assets: [] | ||
}; | ||
|
||
function useRequestAsset(predicate, fn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is minor, the function name could be clearer to note it applies a request asset to a response.
…ive responses (prebid#8785) * Prebid core: fix bug with some native assets being lost from ortb native responses * Do not throw if native response contains assets that were not requested
…ive responses (prebid#8785) * Prebid core: fix bug with some native assets being lost from ortb native responses * Do not throw if native response contains assets that were not requested
Type of change
Description of change
For reasons that I don't understand, there are two ways native assets can be retrieved for rendering -
getAssetMessage
andgetAllAssetsMessage
. #8086 only updated one of them, this PR brings the other in line.It's unclear to me what the impact of this is, except that it currently can only affect bids coming from the Prebid Server adapter (because it's the only one using ortb in native bid responses). I am not sure how many creatives use one way over the other.