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

Ortb requests and legacy native responses #9622

Closed
Hamper opened this issue Mar 3, 2023 · 2 comments
Closed

Ortb requests and legacy native responses #9622

Hamper opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels

Comments

@Hamper
Copy link
Contributor

Hamper commented Mar 3, 2023

Type of issue

I think this is a bug

Description

I trying to use native examples from documentation but get some errors when trying to use adTemplates with appnexus native placement from https://docs.prebid.org/dev-docs/adunit-reference.html#adUnit-native-example with template from https://docs.prebid.org/prebid/native-implementation.html#421-prebidjs-adunit-setup

Steps to reproduce

"mediaTypes": {
    "native": {
        sendTargetingKeys: false,
        adTemplate: `<div class="sponsored-post">
                <div class="thumbnail" style="background-image: url(##hb_native_asset_id_1##);"></div>
                <div class="content">
                    <h1>
                        <a href="%%CLICK_URL_UNESC%%##hb_native_linkurl##" target="_blank" class="pb-click" hb_native_asset_id="2">##hb_native_asset_id_2##</a>
                    </h1>
                    <p>##hb_native_asset_id_4##</p>
                    <div class="attribution">##hb_native_asset_id_3##</div>
                </div>
            </div>`,
        ortb: {
            ver: "1.2",
            assets: [{
                id: 1,
                required: 1,
                img: {
                    type: 1,
                    hmin: 50,
                    wmin: 1
                },
            }, {
                id: 2,
                //required: 1,
                title: {
                    len: 80
                },
            }, {
                id: 3,
                //required: 1,
                data: {
                    type: 1,
                    len: 30
                },
            }, {
                id: 4,
                //required: 1,
                data: {
                    type: 2,
                    len: 100
                },
            }, {
                id: 5,
                //required: 1,
                img: {
                    type: 3,
                    hmin: 200,
                    wmin: 267
                }
            }]
        }
    }
},
"bids": [{
    bidder: 'appnexus',
    params: {
        placementId: 13232354
    }
}]

Expected results

Valid ad rendering

Actual results

Error in console:
Screenshot_20230303_223859

Only legacy assets in response (don't see hb_native_asset_id_[X])
Screenshot_20230303_224017

hb_native_asset_id_[X] placeholders not replaced
Screenshot_20230303_224415

Platform details

prebid.js v7.39.0
PUC v1.16.0-pre (my build because I use custom prebid global object)

@dgirardi
Copy link
Collaborator

dgirardi commented Mar 8, 2023

I cannot reproduce - but I discovered another (related?) bug in this scenario, addressed in #9638

The error message in the OP is about validation, it complains that an adUnit is defining both ortb and "legacy" native properties such as image, title, etc. However, the adUnit in the OP is formatted properly, and does not generate that error for me. Would you be able to reproduce it in a test page?

Instead that adUnit breaks in another way - the "legacy" bid from appnexus is not rendered properly when the adUnit uses a "new" native.ortb. That should be fixed with #9638.

@patmmccann
Copy link
Collaborator

@Hamper are you able to provide a test page?

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