Prebid Server

Prebid Server is server-to-server header bidding solution. In order to use this page you need to have a Prebid Server running.

graph LR; A[Publisher/Prebid.js] --> B(Prebid Server) B --> C[POST /cookie_sync] B --> D[POST /openrtb2/auction] B --> E[Sovrn User Sync]

Click on the "Request Bids" button below to initiate a request to a Prebid Server. In many cases, this will be running locally on localhost:8000.

    
        const s2sServer = 'http://localhost:8000/openrtb2/auction';
        const s2sCookieSync = 'http://localhost:8000/cookie_sync';
        const s2sConfig = {
            accountId: 'innovate',
            bidders: ['sovrn'],
            enabled: true,
            adapter: 'prebidServer',
            endpoint: s2sServer,
            syncEndpoint: s2sCookieSync,
        };
        const adUnits = [{
                code: 'bannerAd',
                mediaTypes: {
                    banner: {
                        sizes: [728, 90],
                    },
                },
                bids: [{
                        bidder: 'sovrn',
                        params: {
                            tagid: 'SovrnTagID',
                        },
                    }],
            }];
        window.pbjs = window.pbjs || {};
        window.pbjs.que = window.pbjs.que || [];
        window.pbjs.que.push(() => {
            window.pbjs.setConfig({ s2sConfig });
            window.pbjs.addAdUnits(adUnits);
            console.log('Que processed');
        });
        function startBids(e) {
            console.log('starting bids');
            window.pbjs.que.push(() => {
                console.log('queRan');
                window.pbjs.requestBids({
                    bidsBackHandler: processBids,
                });
            });
        }
        function processBids() {
            console.log(this.arguments);
        }
        document.getElementById('startBids').addEventListener('click', startBids);