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

Pre-defined native types: Image not replaced before adapters are called #6389

Closed
guiann opened this issue Mar 5, 2021 · 5 comments
Closed
Assignees

Comments

@guiann
Copy link
Contributor

guiann commented Mar 5, 2021

Hello everyone,

Our bidder supports native ads for a few weeks now and we can see some native bid format with

native: {
    type: "image"
}

I would expect this native configuration to be replaced by the full format config specified in:
pre-defined-native-types

{
    image: { required: true },
    title: { required: true },
    sponsoredBy: { required: true },
    clickUrl: { required: true },
    body: { required: false },
    icon: { required: false },
    cta: { required: false }
}

Is it expected that bidder adapters receive the short hand format?
That would mean every bidder has to expand every pre-defined types. Duplicating the same code for every bidder and breaking futur integrations when new pre-formated types will be added.

@gglas
Copy link

gglas commented Apr 12, 2021

@aleksatr @robertrmartinez We discussed this on issue review today, and this seems like a good place to introduce the concept of prebid Native templates with predefined requirements that are then accessed via Shorthand. Aleksa I tagged you until we can add Chris N to prebid, I think he'd find this interesting.

@patmmccann
Copy link
Collaborator

patmmccann commented May 24, 2021

@guiann this expansion of the shorthand inside of core seems like a great utils function for all adapters accepting native; is there any chance you could take a stab at the function?

@guiann
Copy link
Contributor Author

guiann commented May 25, 2021

No I've no time to handle it sorry.

@dgirardi
Copy link
Collaborator

Core now makes the "expanded" type available under bidRequest.nativeParams:

Prebid.js/src/native.js

Lines 39 to 47 in 0d3f875

export function decorateAdUnitsWithNativeParams(adUnits) {
adUnits.forEach(adUnit => {
const nativeParams =
adUnit.nativeParams || deepAccess(adUnit, 'mediaTypes.native');
if (nativeParams) {
adUnit.nativeParams = processNativeAdUnitParams(nativeParams);
}
});
}

Does that solve this issue?

@dgirardi dgirardi moved this from Ready for Dev to In progress in Prebid.js Tactical Issues table Mar 11, 2022
@dgirardi dgirardi self-assigned this Mar 11, 2022
@dgirardi dgirardi moved this from In progress to Waiting for author in Prebid.js Tactical Issues table Mar 24, 2022
@patmmccann
Copy link
Collaborator

Seems to

Repository owner moved this from Needs OP to Done in Prebid.js Tactical Issues table May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

7 participants