### Setup and Run Jekyll Build
Source: https://github.com/prebid/prebid.github.io/blob/master/guide.md
Instructions for setting up a development environment using Github Codespaces and running the Jekyll build process to serve the Prebid website locally. This includes commands for starting the Jekyll server with watch and incremental options.
```bash
JEKYLL_ENV=production bundle exec jekyll serve --watch --incremental
```
--------------------------------
### Post-Bid Configuration Example
Source: https://github.com/prebid/prebid.github.io/blob/master/overview/what-is-post-bid.md
Illustrates how to configure Prebid.js for a post-bid scenario, including setting the 'app' configuration option for mobile app details.
```javascript
// Example for mobile apps using server-to-server architecture
// Refer to the example for detailed implementation
// For mobile apps, the 'app' config option can be used to forward mobile app details.
// Example: pbjs.setConfig({ app: { ... } });
```
--------------------------------
### Serve AirGrid RTD Provider Example
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/modules/airgridRtdProvider.md
Starts a local server to serve the AirGrid RTD provider example, allowing for on-page setup testing.
```bash
gulp serve-fast --modules=rtdModule,airgridRtdProvider,appnexusBidAdapter
```
--------------------------------
### Prebid Setup Links
Source: https://github.com/prebid/prebid.github.io/blob/master/adops/adops-general-sbs.md
Provides links to detailed setup guides for Prebid within different ad servers. These links are essential for users who need specific instructions for their chosen ad server.
```markdown
* [Google Ad Manager](/adops/step-by-step.html)
* [Xandr Monetize Ad Server](/adops/setting-up-prebid-with-the-appnexus-ad-server.html)
* [Freewheel](/adops/setting-up-prebid-video-in-freewheel.html)
* [Smart Ad Server](/adops/setting-up-prebidjs-with-Smart-Ad-Server.html)
```
--------------------------------
### Getting Started with Prebid.js
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid/prebidjs-video.md
Provides guidance on how to start using Prebid.js, stating that it is free to use and directing users to docs.prebid.org for the latest version. It also mentions the availability of companies offering managed services for Prebid.js.
```javascript
Prebid.js is free to use. You can get started with your own installation of the latest version of Prebid by visiting docs.prebid.org.
There are also several companies that offer Prebid.js managed services, which may include technical support, ad operations and yield optimization services, hosting services, and extra product features like user interfaces or analytics. To learn more about these, visit prebid.org.
```
--------------------------------
### Codex Environment Setup
Source: https://github.com/prebid/prebid.github.io/blob/master/README.md
Sets up the Ruby version, installs Jekyll, Bootstrap, github-pages, and markdownlint-cli, then installs project dependencies.
```bash
echo "3.4.4" > .ruby-version
export NOKOGIRI_USE_SYSTEM_LIBRARIES=1
gem install jekyll bundler
npm install boostrap
gem install github-pages --no-document --force
npm install -g markdownlint-cli
bundle install
```
--------------------------------
### Serve Integration Example
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/modules/optimeraRtdProvider.md
Starts a local server to view the Optimera RTD provider integration example. Navigates to a specific URL in the browser to see the targeting.
```bash
gulp serve --modules=appnexusBidAdapter,optimeraRtdProvider
```
--------------------------------
### Kotlin Integration Example
Source: https://github.com/prebid/prebid.github.io/blob/master/_includes/code/mobile-sdk.html
Example of integrating Prebid.js using Kotlin. This snippet demonstrates basic setup and usage within a Kotlin environment.
```kotlin
```kotlin
// Placeholder for Kotlin code snippet
// Actual code would be inserted here based on the include.kotlin variable
println("Kotlin integration example")
```
```
--------------------------------
### Ad Ops Planning Guide Recommendation
Source: https://github.com/prebid/prebid.github.io/blob/master/adops/adops-general-sbs.md
Recommends reviewing the Ad Ops Planning Guide before proceeding with ad server setup. This is a crucial preparatory step for effective ad operations.
```markdown
{: .alert.alert-info :}
We recommend reviewing the [Ad Ops Planning Guide](/adops/adops-planning-guide.html) before adding items to your ad server.
```
--------------------------------
### Accessing Integration Example
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/modules/optimeraRtdProvider.md
The URL to access the integration example for the Optimera RTD Provider in a browser after starting the local server.
```text
http://localhost:9999/integrationExamples/gpt/optimeraRtdProvider_example.html
```
--------------------------------
### Prebid.js Dynamic Creative Setup Example
Source: https://github.com/prebid/prebid.github.io/blob/master/adops/js-dynamic-creative.md
This snippet demonstrates the basic setup for a Prebid.js dynamic creative. It includes the necessary HTML structure and inline JavaScript to initialize Prebid.js and render an ad. For non-GAM environments, placeholders need to be replaced with appropriate equivalents.
```html
```
--------------------------------
### Basic Prebid.js Example
Source: https://github.com/prebid/prebid.github.io/blob/master/docs-examples/web-example.md
A fundamental example of integrating Prebid.js with Google Publisher Tag (GPT). It showcases the setup for an ad unit, including bidder configuration and size definitions, and the necessary GPT calls to display the ad. This is a common starting point for Prebid.js implementations.
```html
Basic Prebid.js Example
Div-1
```
```javascript
var sizes = [
[300, 250]
];
var PREBID_TIMEOUT = 700;
var adUnits = [{
code: '/19968336/header-bid-tag-1',
mediaTypes: {
banner: {
sizes: sizes
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 13144370
}
}]
}];
// ======== DO NOT EDIT BELOW THIS LINE =========== //
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver
});
});
function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
if (pbjs.libLoaded) {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
} else {
googletag.pubads().refresh();
}
});
}
setTimeout(function() {
initAdserver();
}, PREBID_TIMEOUT);
googletag.cmd.push(function() {
googletag.defineSlot('/19968336/header-bid-tag-1', sizes, 'div-1')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
```
--------------------------------
### Prebid.js Download and Adapter Selection
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-video/video-getting-started.md
Guidance on downloading Prebid.js, emphasizing the selection of appropriate adapters. It highlights the need for at least one video-supporting bid adapter, the Google Ad Manager Video module if applicable, and the Prebid Server adapter for server-side auctions.
```javascript
// Include at least one bid adapter that supports video.
// If using Google Ad Manager, include the Google Ad Manager Video module.
// If integrating with Prebid Server, include the "Prebid Server" adapter.
```
--------------------------------
### Example: Running the Optable RTD Module
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/modules/optableRtdProvider.md
Provides instructions on how to run the Optable RTD module with other necessary Prebid.js modules and access a live integration example. This includes the command to build and serve the example, and the URL to open in a browser.
```bash
gulp serve --modules=optableRtdProvider,consentManagementGpp,consentManagementTcf,appnexusBidAdapter
```
--------------------------------
### Example of Setting Config ID in Mobile App
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-mobile/prebid-mobile-getting-started.md
Illustrates how to set the CONFIG_ID in a mobile application to reference a specific stored request ID for testing purposes.
```javascript
// Assuming 'prebid-demo-banner-320-50' is a valid stored request ID
const configId = 'prebid-demo-banner-320-50';
```
--------------------------------
### Clone and Build Prebid Server Go
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-server/developers/installing-go.md
Clones the Prebid Server repository and builds the Go executable for local execution.
```bash
cd YOUR_DIRECTORY
git clone https://github.com/prebid/prebid-server src/github.com/prebid/prebid-server
cd src/github.com/prebid/prebid-server
./validate.sh
go build .
./prebid-server
```
--------------------------------
### Prebid.js Native AdUnit Setup
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid/native-implementation.md
Example configuration for a Native AdUnit in Prebid.js. This includes defining the rendererUrl and ortb assets for the native ad format. For versions before 9.0, sendTargetingKeys should be set to false.
```javascript
var adUnits = [{
code: 'native-div',
mediaTypes: {
native: {
rendererUrl: "https://files.prebid.org/creatives/nativeRenderFunction.js",
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
}
}
]
}
}
}
}];
```
--------------------------------
### Prebid Server Auction Configuration
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-mobile/prebid-mobile-getting-started.md
Example JSON structure for configuring Prebid Server's top-level stored requests, which define global auction parameters like currency, caching, and targeting settings.
```json
{
"cur": [
"EUR"
],
"ext": {
"prebid": {
"cache": {
"bids": {}
},
"targeting": {
"pricegranularity": "dense",
"includewinners": true,
"includebidderkeys": true,
"includeformat": true
}
}
}
}
```
--------------------------------
### JSON Schema for Bidder Parameters (String Placement ID)
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-server/developers/add-new-bidder-java.md
Defines a single required string parameter 'placementId' for a bidder adapter. This is a basic example to get started with JSON Schema for Prebid Server.
```json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "BidderA Adapter Params",
"description": "A schema which validates params accepted by the BidderA adapter",
"type": "object",
"properties": {
"placementId": {
"type": "string",
"description": "Placement ID"
}
},
"required": ["placementId"]
}
```
--------------------------------
### Installing Prebid Server - Go
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-server/versions/pbs-versions-go.md
Instructions for installing the Go version of Prebid Server, referencing architectural considerations.
```url
/prebid-server/developers/installing-go.html
```
--------------------------------
### Get Consent Metadata Example
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/publisher-api-reference/getConsentMetadata.md
Example usage of the `pbjs.getConsentMetadata()` function to retrieve consent information.
```javascript
pbjs.getConsentMetadata() // returns e.g.
{
"coppa": false,
"gdpr": {
"apiVersion": 2,
"consentStringSize": 100,
"gdprApplies": true,
"generatedAt": 1644358143306
},
"usp": {
"generatedAt": 1644358143306,
"usp": "1YYY"
}
}
```
--------------------------------
### Jekyll Serve Output Example
Source: https://github.com/prebid/prebid.github.io/blob/master/README.md
Example output from running the Jekyll serve command, showing configuration details, build status, and the server address for accessing the local site.
```bash
Configuration file: /Users/me/git/prebid.github.io/_config.yml
Source: /Users/me/git/prebid.github.io
Destination: /Users/me/git/prebid.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 13.596 seconds.
Auto-regeneration: enabled for '/Users/me/git/prebid.github.io'
Configuration file: /Users/me/git/prebid.github.io/_config.yml
Server address: http://127.0.0.1:8080/
Server running... press ctrl-c to stop.
...
```
--------------------------------
### Prebid.js Video Module Integration
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-video/video-getting-started.md
Instructions for integrating the Prebid.js Video Module, which automates rendering bids in video players, marking won bids, triggering events, and populating impression parameters. Refer to the provided link for detailed configuration.
```javascript
// Refer to /prebid-video/video-module.html for detailed configuration instructions.
```
--------------------------------
### Start Prebid Server Go
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-server/pbs-modules/51degrees-device-detection.md
Command to start the Prebid Server Go application.
```bash
go run main.go
```
--------------------------------
### Swift Integration Example
Source: https://github.com/prebid/prebid.github.io/blob/master/_includes/code/mobile-sdk.html
Example of integrating Prebid.js using Swift. This snippet demonstrates basic setup and usage within a Swift environment.
```swift
```swift
// Placeholder for Swift code snippet
// Actual code would be inserted here based on the include.swift variable
print("Swift integration example")
```
```
--------------------------------
### Build and Run Prebid Server
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-server/developers/add-new-bidder-go.md
Instructions for building the Prebid server project and running it locally. This is the first step in performing manual end-to-end testing.
```bash
go build .
./prebid-server
```
--------------------------------
### Tip Alert Example
Source: https://github.com/prebid/prebid.github.io/blob/master/guide/pb-guide-alerts.md
An example demonstrating the creation and display of a 'Tip' alert using Liquid `capture` and `include` tags.
```liquid
{% capture tipAlert %}
A tip helps the user do something.
{% endcapture %}
{% include alerts/alert_tip.html content=tipAlert %}
```
--------------------------------
### Basic Prebid.js Setup
Source: https://github.com/prebid/prebid.github.io/blob/master/_includes/alerts/alert_important.html
This snippet demonstrates the fundamental steps to integrate Prebid.js into a publisher's website. It includes initializing Prebid, setting up ad units, and rendering ads.
```JavaScript
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.defineSlot('/12345678/leader-board', [728, 90], 'div-gpt-ad-1459109199999-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
pbjs.que.push(function() {
pbjs.addAdUnits({
code: 'div-gpt-ad-1459109199999-0',
mediaTypes: {
banner: {
sizes: [[728, 90]]
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 123456789
}
}]
});
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
timeout: 2000
});
});
function sendAdserverRequest() {
if (pbjs.getAdserverTargeting && pbjs.getAdserverTargeting().length) {
googletag.cmd.push(function() {
googletag.defineSlot('/12345678/leader-board', [728, 90], 'div-gpt-ad-1459109199999-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
googletag.display('div-gpt-ad-1459109199999-0');
});
}
}
```
--------------------------------
### Note Alert Example
Source: https://github.com/prebid/prebid.github.io/blob/master/guide/pb-guide-alerts.md
An example demonstrating the creation and display of a 'Note' alert using Liquid `capture` and `include` tags.
```liquid
{% capture noteAlert %}
This is some very important information.
{% endcapture %}
{% include alerts/alert_note.html content=noteAlert %}
```
--------------------------------
### Intro to Prebid.org Video
Source: https://github.com/prebid/prebid.github.io/blob/master/overview/all-videos.md
A high-level introduction to the Prebid community and its products.
```html
Intro to Prebid.org - A high-level introduction to the Prebid community and its products.
```
--------------------------------
### Important Alert Example
Source: https://github.com/prebid/prebid.github.io/blob/master/guide/pb-guide-alerts.md
An example demonstrating the creation and display of an 'Important' alert using Liquid `capture` and `include` tags.
```liquid
{% capture importantAlert %}
An important alert provides crititcal information to the user.
{% endcapture %}
{% include alerts/alert_important.html content=importantAlert %}
```
--------------------------------
### Warning Alert Example
Source: https://github.com/prebid/prebid.github.io/blob/master/guide/pb-guide-alerts.md
An example demonstrating the creation and display of a 'Warning' alert using Liquid `capture` and `include` tags.
```liquid
{% capture warningAlert %}
A caution alert provides crititcal information to the user.
{% endcapture %}
{% include alerts/alert_warning.html content=warningAlert %}
```
--------------------------------
### Open Source Contribution Prompt
Source: https://github.com/prebid/prebid.github.io/blob/master/adops/adops-general-sbs.md
Encourages users to contribute to the Prebid.org documentation by submitting pull requests to their GitHub repository if they wish to add instructions for their specific ad server.
```markdown
{: .alert.alert-info :}
Prebid.org documentation is open source, so if you would like to add instructions for your ad server, create a PR in our [Github repository](https://github.com/prebid/prebid.github.io).
```
--------------------------------
### Prebid.js Basic Example
Source: https://github.com/prebid/prebid.github.io/blob/master/examples/index.md
Demonstrates a basic implementation of Prebid.js for ad serving. Links to a hosted example page.
```html
Basic Example
```
--------------------------------
### Example Ad Unit Setup
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/bidders/welect.md
An example of how to set up an ad unit for the Welect bidder in Prebid.js, specifying the bidder, parameters, and media types.
```javascript
var adUnits = [
{
bidder: 'welect',
params: {
placementId: 'exampleId'
},
mediaTypes: {
video: {
context: 'instream',
playerSize: [640, 360]
}
},
}
];
```
--------------------------------
### Development Setup and Build Commands
Source: https://github.com/prebid/prebid.github.io/blob/master/dev-docs/bidders/aidem.md
Provides shell commands for setting up the development environment, building adapters, serving the project, and running tests for Prebid.js.
```shell
nvm use
npm install
gulp build --modules=aidemBidAdapter
gulp serve --modules=aidemBidAdapter
# Open a chrome browser with no ad blockers enabled, and paste in this URL. The `pbjs_debug=true` is needed if you want to enable `loggerInfo` output on the `console` tab of Chrome Developer Tools.
http://localhost:9999/integrationExamples/gpt/hello_world.html?pbjs_debug=true
```
```shell
If you need to run the tests suite but do *not* want to have to build the full adapter and serve it, simply run:
gulp test --file "test/spec/modules/aidemBidAdapter_spec.js"
For video: gulp serve --modules=aidemBidAdapter,dfpAdServerVideo
```
--------------------------------
### Build and Run Prebid Server Docker Container
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-server/developers/installing-go.md
Builds a Docker image for Prebid Server and runs it locally, exposing the default port.
```bash
docker build -t prebid-server .
docker run -p 8000:8000 -t prebid-server
```
--------------------------------
### Configure Prioritize Deals and Deal Tier
Source: https://github.com/prebid/prebid.github.io/blob/master/prebid-video/video-long-form.md
Sets `prioritizeDeals` to true and configures bidder-specific `dealTier` settings, including prefix and minimum deal tier, to manage deal prioritization. This example demonstrates how Prebid.js can be configured to replace CPM values with deal IDs in cache keys and targeting key-value pairs when `prioritizeDeals` is enabled.
```javascript
pbjs.setConfig({
adpod: {
prioritizeDeals: true,
dealTier: {
'appnexus': {
prefix: 'tier',
minDealTier: 5
},
'some-other-bidder': {
prefix: 'deals',
minDealTier: 20
}
}
}
})
```
--------------------------------
### YAML Data File Example
Source: https://github.com/prebid/prebid.github.io/blob/master/guide.md
Shows an example of how data files in YAML format are used within the `_data` directory for dynamic content generation in Jekyll.
```YAML
# Example _data/partners.yml
partners:
- name: Partner A
domain: partner-a.com
- name: Partner B
domain: partner-b.com
```
--------------------------------
### Basic Prebid.js Setup
Source: https://github.com/prebid/prebid.github.io/blob/master/_includes/alerts/alert_note.html
This snippet demonstrates the fundamental HTML and JavaScript required to initialize Prebid.js on a webpage. It includes setting up the ad units and requesting ads.
```html
Prebid.js Example
```