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 Native: switch to openRTB for native #7830

Closed
FilipStamenkovic opened this issue Dec 8, 2021 · 2 comments · Fixed by #8086
Closed

Prebid Native: switch to openRTB for native #7830

FilipStamenkovic opened this issue Dec 8, 2021 · 2 comments · Fixed by #8086
Assignees

Comments

@FilipStamenkovic
Copy link
Contributor

FilipStamenkovic commented Dec 8, 2021

Type of issue

Feature request.

This issue is based on the following comment by @bretg.

Description

The goal is to replace PBJS's "proprietary" native configuration with the openRTB standard.
Native configuration should support openRTB native specification, version 1.2. The full specs can be found here.

Currently, in PBJS, the user would configure native ad units like:

{
    code: 'adUnitCode',
    mediaTypes: {
        native: {
            rendererUrl: "https://domain.com/renderer.js",
            sendTargetingKeys: false,
            adTemplate: "<html><head>...</head></html>",  // not needed in case where rendererUrl exists
            title: {
                required: true,
                len: 800
            },
            image: {
                required: true,
                sizes: [3000, 2250]
            },
            ...
        }
    },
}

Problems with provided example are:

  • there isn't a clear distinction between asset configuration, and PBJS native configuration (sponsoredBy is an asset, but sendTargetingKeys property is configuration so that PBJS knows whether to set GPT targeting or not)
  • it's not possible to request the same type of asset twice; assets are configured as key-value pairs, it's impossible to configure PBJS to request two images, for example.
  • many current bidders are already sending openRTB requests to their back end; there is a lot of duplicated code in prebid that translates prebid "proprietary" native implementation to openRTB.
  • no support for users to configure event trackers

Proposed update

The proposed solution is to go with plain openRTB instead of the current "proprietary" configuration. So, the example from above would look like this:

{
    code: 'adUnitCode',
    mediaTypes: {
        native: {
            rendererUrl: "https://domain.com/renderer.js",
            sendTargetingKeys: false,
            adTemplate: "<html><head>...</head></html>",  // not needed in case where rendererUrl exists
            ortb2: {
                ver: "1.2",
                assets: [
                    {
                        id: 1,
                        required: 1,
                        title: {
                            len: 140,
                        },
                    },{
                        id: 2,
                        required: 1,
                        img: {
                            h: 2500,
                            w: 3000,
                            type: 3,
                        },
                    },
                    ...
                ],
                eventtrackers: [...],
            },
        },
    }
}

Note that all assets and eventtrakcers (everything related to openRTB) are under mediaTypes.native.ortb2 property. While, PBJS specific configuration, such as rendererUrl, adTemplate, sendTargetingKeys are not under ortb2 property.

Potential problems

All currently supported macros for string substitution (during render time or targeting set) must be replaced.
Current macros:

"NATIVE_KEYS": {
  "title": "hb_native_title",
  "body": "hb_native_body",
  "body2": "hb_native_body2",
  "privacyLink": "hb_native_privacy",
  "privacyIcon": "hb_native_privicon",
  "sponsoredBy": "hb_native_brand",
  "image": "hb_native_image",
  "icon": "hb_native_icon",
  "clickUrl": "hb_native_linkurl",
  "displayUrl": "hb_native_displayurl",
  "cta": "hb_native_cta",
  "rating": "hb_native_rating",
  "address": "hb_native_address",
  "downloads": "hb_native_downloads",
  "likes": "hb_native_likes",
  "phone": "hb_native_phone",
  "price": "hb_native_price",
  "salePrice": "hb_native_saleprice",
  "rendererUrl": "hb_renderer_url",
  "adTemplate": "hb_adTemplate"
}

This needs to be replaced if we want PBJS to use openRTB for native. I suggest using asset.id as a macro instead of the name. So, macro would look: hb_native_asset_1 ... hb_native_asset_N. Then, during ad render time, renderer (or PUC) would take assets from native bid response, and based on its id, it would do string replacements.

Additional changes

Adding this change to prebid native would require changes in:

  • prebid universal creative (macros for string substitution)
  • each bidder that supports native would need to update their code
@bx2
Copy link

bx2 commented Dec 8, 2021

@FilipStamenkovic is it safe to assume that this change would not be backward compatible, i.e. from the moment we merge this, the proprietary way of defining assets will no longer apply?

@FilipStamenkovic
Copy link
Contributor Author

It's up for debate. It can be implemented to be backward compatible, so that bidders don't have to adjust their code right away. Or, it can be included in the next major release and in that release this feature gets released together with updated bidders.

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