reddit/Prebid.js

Name: Prebid.js

Owner: Reddit

Description: Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.

Forked from: prebid/Prebid.js

Created: 2016-03-05 04:20:42.0

Updated: 2016-07-01 17:38:08.0

Pushed: 2016-03-04 21:57:31.0

Homepage: http://prebid.org

Size: 1063

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

HEY DEVELOPERS!

rm -rf ./node_modules && npm cache clean && npm install

With this commit we have changed the build system to use Webpack, Karma and Istanbul. This change was made to support improved unit test coverage and reporting. Reinstalling Prebid.js is necessary as many node modules changed, and you are likely to experience errors otherwise. After pulling down latest master please rm -rf ./node_modules && npm cache clean && npm install.

Build path change

The ./dist and ./dev directories have been moved to a ./build directory – please update your own dev and example paths to prebid.js accordingly. You will also find code coverage reports in the ./build/coverage directory.

Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.

Many SSPs, bidders, and publishers have all contributed to this project.

Check out the overview and documentation at http://prebid.org.

No more week-long development. Header bidding is made easy by prebid.js :)

Table of Contents

Usage

Download the integration example here.

Download the latest released code

See the releases page here and download a copy.

Example code

Include the prebid.js libraray Note that you need to host prebid.js locally or on a CDN and update the reference in the code snippet below for `cdn.host.com/prebid.min.js

ction() {
    var d = document, pbs = d.createElement('script'), pro = d.location.protocol;
    pbs.type = 'text/javascript';
    pbs.src = ((pro === 'https:') ? 'https' : 'http') + '://cdn.host.com/prebid.min.js';
    var target = document.getElementsByTagName('head')[0];
    target.insertBefore(pbs, target.firstChild);
;

Setup ad units

.que.push(function(){
var adUnits = [{
    code: '{id}',
    sizes: [[300, 250], [300, 600]],
    bids: [
        {
            bidder: 'appnexus',
            params: {
                placementId: '{id}'
            }
        }
    ]
}];
//add the adUnits
pbjs.addAdUnits(adUnits);

Request Bids

.que.push(function(){
pbjs.requestBids({
    bidsBackHandler: function(bidResponses) {
        //do stuff when the bids are back
    }
})

See Console Debug Errors during testing By default console errors are supressed. To enabled add ?pbjs_debug=true to the end of the URL for testing.

API

Full Developer API reference:

Click here to access the API

Contribute
Add an Bidder Adapter

Follow the guide outlined here to add an adapter.

install
$ sudo npm install
Build
$ gulp build
Configure

Edit ./integrationExamples/gpt/pbjs_example_gpt.html

Change {id} values appropriately

Run
$ gulp serve

Navigate to http://localhost:9999/integrationExamples/gpt/pbjs_example_gpt.html to run the example file

Unit Test In the Browser

Navigate to http://localhost:9999/build/coverage/karma_html/report to view test results.

Supported Browsers

Prebid.js is supported on IE9+ and modern browsers.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.