- Getting Started
The easiest way to get started with Prebid.js is to use the following JSFiddle example. Go to the “Result” tab to see the keyword targeting for this header auction.
For more information on how to setup your ad server, see the Ad Ops Guide.
1. Register bidder tag IDs
In a simple JSON config, define a mapping of the bidders’ tag Ids to your ad units. Load prebid.js library async. Call
pbjs.requestBids() to send header bidding requests async to all bidders you’ve specified.
2. Set the ad server timeout
Define the timeout to let your ad server wait for a few hundred milliseconds, so the bidders can respond with bids.
3. Set bid targeting
Call the helper function
setTargetingForGPTAsync() to handle all the targeting for all bidders.
Next Step (Full Example):
View or download a full example with line by line code walkthrough!