Skip to content

Commit

Permalink
edited dev getting started for issue prebid#39
Browse files Browse the repository at this point in the history
  • Loading branch information
Heray committed Jun 10, 2016
1 parent 1096185 commit df97ce4
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions dev-docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nav_section: quick-start
* TOC
{:toc }

## Quick Start
### Quick Start

The easiest way to get started with Prebid.js is using the following JSFiddle example. Go to the "Result" tab to see the keyword targeting for this header auction.

Expand All @@ -27,21 +27,21 @@ For more information on how to setup your ad server, see the [Ad Ops Guide](/ado

<div class="bs-docs-section" markdown="1">

<a name="basic-example">
<br>

## Example: Rubicon and AppNexus bidding on a DFP ad unit
<a name="basic-example">

Here is a basic example for Rubicon and AppNexus bidding into a DFP ad unit.
### More Details

+ <a href="#register-bidder-tag-ids">Register bidder tag IDs</a>
+ <a href="#set-ad-server-timeout">Set the ad server timeout</a>
+ <a href="#set-bid-targeting">Set bid targeting</a>

<a name="register-bidder-tag-ids"></a>

### Register bidder tag IDs
#### 1. Register bidder tag IDs

In a simple JSON config, define a mapping of the bidders’ tag Ids to your ad units. Then load prebid.js library async. Call `pbjs.requestBids()` to send header bidding requests async to all bidders you've specified.
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.

{% highlight html %}
<script src="prebid.js" async></script>
Expand All @@ -53,26 +53,25 @@ In a simple JSON config, define a mapping of the bidders’ tag Ids to your ad u

<a name="set-ad-server-timeout"></a>

### Set the ad server timeout
#### 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.

{% highlight js %}

PREBID_TIMEOUT = 300;
function initAdserver() {
function sendAdserverRequest() {
(function() {
// To load GPT Library Async
// Send ad server ad request here
})();
pbjs.initAdserverSet = true;
};
setTimeout(initAdserver, PREBID_TIMEOUT);

{% endhighlight %}

<a name="set-bid-targeting"></a>

### Set bid targeting
#### 3. Set bid targeting

Call the helper function `setTargetingForGPTAsync()` to handle all the targeting for all bidders.

Expand All @@ -84,4 +83,8 @@ pbjs.que.push(function() {

{% endhighlight %}

For detailed walkthrough and API references, check out the [Code Examples](/dev-docs/examples/basic-example.html).
<br>

### Next Step (Full Example):

> View or download a [full example](/dev-docs/examples/basic-example.html) with line by line code walkthrough!

0 comments on commit df97ce4

Please sign in to comment.