ネイティブ向けPrebid.jsの設定

Media Owners
Last Updated: 4月 23, 2026

Publishers selling native ad inventory can integrate with Prebid.js and include Index Exchange (Index) as a bidder to access Index's native demand. Indexは、 Prebid.jsヘッダービディングアダプターを介したウェブのネイティブ広告フォーマットに対応しています。

始める前に:

  1. Complete the Index-specific configuration steps on the Index ExchangePrebid documentation page on the Prebid site.

  2. Prebidサイトの Prebid.js Native Implementation Guideに記載された手順を実践してください。

    注意:Prebid.js接続ガイドで提供される以下の3つのネイティブ広告のレンダリングオプションに対応しています。AdServer-Defined TemplateAdUnit-Defined TemplateCustom Renderer。Indexでは、すばやく設定するために、広告主が定義したテンプレートか広告ユニットが定義したテンプレートの利用をおすすめします。

Examples of native ad unit code setup

例1:以下のコードの例は、Google Ad Managerでadserver-definedテンプレートオプションを使ったPrebidネイティブ設定ですが、コンセプトと実装は、他の広告サーバーと類似します。

pbjs.addAdUnits({
    code: slot.code,
    mediaTypes: {
        native: {
            ortb: {
                assets: [{
                    id: 1,
                    required: 1,
                    img: {
                        type: 3,
                        w: 150,
                        h: 50,
                    }
                },
                {
                    id: 2,
                    required: 1,
                    title: {
                        len: 80
                    }
                },
                {
                    id: 3,
                    required: 1,
                    data: {
                        type: 1
                    }
                },
                {
                    id: 4,
                    required: 1,
                    data: {
                        type: 2
                    }
                },
                {
                    id: 6,
                    required: 1,
                    img: {
                        type: 1,
                        w: 50,
                        h: 50,
                    }
                }]
            }
        }
    },
    bids: [{
       bidder: 'ix',
        params: {
            siteId: '9999990'
        }
    }]
});

例2:以下のコードは、広告ユニット規定テンプレートを使ったPrebidネイティブ設定の例です。

pbjs.addAdUnits({
    code: slot.code,
    mediaTypes: {
        native: {
            adTemplate: "<div class=\"sponsored-post\">\r\n  <div class=\"thumbnail\" style=\"background-image: url (##hb_native_image##);\"><\/div> \r\n  <div class=\"content2\" style=\"background-color: #24D624;>\r\n  <h1>\r\n<a href=\"%%CLICK_URL_UNESC%%##hb_native_linkurl##\" target=\"_blank\" class=\"pb-click\">\r\n  ##hb_native_title##\r\n <\/a>\r\n <\/h1>\r\n <p>##hb_native_body##<\/p>\r\n \t<div class=\"attribution\">\r\n \t##hb_native_brand##\r\n \t<\/div>\r\n\t<\/div>\r\n<\/div>",
            ortb: {
                assets: [
                    {
                        id: 1,
                        required: 1,
                        img: {
                            type: 3,
                            w: 989,
                            h: 742,
                        }
                    },
                    {
                        id: 2,
                        required: 1,
                        title: {
                            len: 800,
                        }
                    },
                    {
                        id: 3,
                        required: true,
                        data: {
                            type: 1
                        }
                    },
                    {
                        id: 4,
                        required: true,
                        data: {
                            type: 2
                        }
                    }
                ]
            }
        }
    },
    bids: [{
        bidder: 'ix',
        params: {
            siteId: '9999990'
        }
    }]
});