### Serve example for Relevad RTD module Source: https://docs.prebid.org/dev-docs/modules/relevadRtdProvider.html Start a local server to view an example of the on-page setup for the Relevad RTD module. ```bash gulp serve-fast --modules=rtdModule,relevadRtdProvider ``` -------------------------------- ### Native setup example (s2s only) Source: https://docs.prebid.org/dev-docs/bidders/grid Example of setting up native media type for TheMediaGrid bidder in server-side integration. ```APIDOC ## Native setup example (s2s only) ### Description Setup native in adUnit mediaTypes. ### Example ``` ... mediaTypes: { native: { ortb: { ver: '1.2', "assets": [ { "id": 1, "img": { "hmin": 180, "wmin": 216, "type": 3 }, "required": 1 }, { "title": { "len": 140 }, "id": 2, "required": 1 }, { "id": 3, "data": { "len": 25, "type": 1 }, "required": 1 } ], } } }, ... ``` ``` -------------------------------- ### Serve local example with Rayn RTD module Source: https://docs.prebid.org/dev-docs/modules/raynRtdProvider.html Run the development server with the required modules to view the on-page setup example. Access the example at http://localhost:9999/integrationExamples/gpt/raynRtdProvider_example.html. ```bash gulp serve-fast --modules=rtdModule,raynRtdProvider,msftBidAdapter ``` -------------------------------- ### Navigate to WURFL RTD example page Source: https://docs.prebid.org/dev-docs/modules/wurflRtdProvider.html Open the integration example page in the browser after starting the local server. ```text http://localhost:9999/integrationExamples/gpt/wurflRtdProvider_example.html ``` -------------------------------- ### Setup / Dev Guide commands Source: https://docs.prebid.org/dev-docs/bidders/aidem.html Commands to set up the development environment, build the adapter, serve it, and open a test page with debugging enabled. ```bash 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 ``` -------------------------------- ### Navigate to example page Source: https://docs.prebid.org/dev-docs/modules/optimeraRtdProvider.html Open the integration example in the browser after running the serve command. ```text http://localhost:9999/integrationExamples/gpt/optimeraRtdProvider_example.html ``` -------------------------------- ### Serve example with optimeraRtdProvider Source: https://docs.prebid.org/dev-docs/modules/optimeraRtdProvider.html Run the local development server with the required modules to view the integration example. ```bash gulp serve --modules=msftBidAdapter,optimeraRtdProvider` ``` -------------------------------- ### GET /storage query example Source: https://docs.prebid.org/prebid-server/endpoints/pbs-endpoints-pbc.html Example GET request to retrieve stored data using query parameters key and application. ```http GET /storage?application=id-data&key=hashedaddress ``` -------------------------------- ### Tagoras Bidder Example Configuration Source: https://docs.prebid.org/dev-docs/bidders/tagoras Example Prebid.js configuration for the Tagoras bidder, including ad units, bid params, and user syncing setup. The cId and pId are required and provided during setup; bidFloor is optional. ```javascript var adUnits = [{ code: 'banner-div', mediaTypes: { banner: { sizes: [ [300, 250], [728, 90] ] } }, bids: [{ bidder: 'tagoras', params: { cId: '562524b21b1c1f08117fc7f9', // Required - PROVIDED DURING SETUP... pId: '59ac17c192832d0011283fe3', // Required - PROVIDED DURING SETUP... bidFloor: 1.23 // Optional } }] } }]; // configure pbjs to enable user syncing pbjs.setConfig({ userSync: { filterSettings: { iframe: { bidders: 'tagoras', filter: 'include' } } } }); ``` -------------------------------- ### Serve command for integration example Source: https://docs.prebid.org/dev-docs/modules/contxtfulRtdProvider Command to serve the integration example with required modules. ```bash gulp serve --modules=rtdModule,bidderABidAdapter,bidderBBidAdapter,bidderCBidAdapter,contxtfulRtdProvider ``` -------------------------------- ### Start Prebid Server with sample config Source: https://docs.prebid.org/prebid-server/versions/pbs-versions-java.html Command to launch the Prebid Server Java jar with a sample configuration file. Run from the project root after building the server. ```bash java -jar target/prebid-server.jar --spring.config.additional-location=sample/prebid-config.yaml ``` -------------------------------- ### Execution plan setup for Greenbids RTD Source: https://docs.prebid.org/prebid-server/pbs-modules/greenbids-real-time-data.html Example of the execution plan setup that enables the module at the processed-auction-request stage for the /openrtb2/auction endpoint. ```yaml hooks: greenbids-real-time-data: enabled: true host-execution-plan: > { "endpoints": { "/openrtb2/auction": { "stages": { "processed-auction-request": { "groups": [ { "timeout": 100, "hook-sequence": [ { "module-code": "greenbids-real-time-data", "hook-impl-code": "greenbids-real-time-data-processed-auction-request-hook" } ] } ] } } } } } ``` -------------------------------- ### Criteo ID configuration example Source: https://docs.prebid.org/dev-docs/modules/userid-submodules/criteo.html Example of setting the Criteo ID user ID module in Prebid.js. The module requires no configuration parameters; this is the minimal setup. ```javascript pbjs.setConfig({ userSync: { userIds: [{ name: "criteo", }] } }); ``` -------------------------------- ### Quick Start: Clone and Start with Docker Source: https://docs.prebid.org/agents/salesagent.html Commands to clone the salesagent repository, start it with Docker Compose, and test the MCP interface using the adcp tool. ```bash # Clone and start git clone https://github.com/prebid/salesagent.git cd salesagent docker compose up -d # Test the MCP interface uvx adcp http://localhost:8000/mcp/ --auth test-token list_tools ``` -------------------------------- ### Native setup example (s2s only) in adUnit mediaTypes Source: https://docs.prebid.org/dev-docs/bidders/grid Example of setting up native media type in an adUnit for server-side (s2s) only. The snippet shows the mediaTypes.native.ortb configuration with assets array. ```javascript ... mediaTypes: { native: { ortb: { ver: '1.2', "assets": [ { "id": 1, "img": { "hmin": 180, "wmin": 216, "type": 3 }, "required": 1 }, { "title": { "len": 140 }, "id": 2, "required": 1 }, { "id": 3, "data": { "len": 25, "type": 1 }, "required": 1 } ], } } }, ... ``` -------------------------------- ### Example setup with multiple providers Source: https://docs.prebid.org/dev-docs/bidders/relevantdigital.html Shows how to set up multiple providers using aliases. Uses pbjs.aliasBidder to create providerA and providerB aliases for relevantdigital, then sets separate pbsHost and accountId for each provider via pbjs.setConfig. The ad units include bids for both providers with distinct placement IDs. Note: placements shown are not live test placements. ```javascript pbjs.aliasBidder('relevantdigital', 'providerA'); pbjs.aliasBidder('relevantdigital', 'providerB'); pbjs.setConfig({ providerA: { pbsHost: 'pbs-example-a.relevant-digital.com', accountId: '620533ae7f5bbe1691bbb815', }, providerB: { pbsHost: 'pbs-example-b.relevant-digital.com', accountId: '990533ae7f5bbe1691bbb815', }, }); var adUnits = [ { code: 'test-div', mediaTypes: { banner: { sizes: [[300, 250], [320, 320]] }}, bids: [ { bidder: 'providerA', params: { placementId: '610525862d7517bfd4bbb81e_620523b7d1dbed6b0fbbb817', } }, { bidder: 'providerB', params: { placementId: '990525862d7517bfd4bbb81e_770523b7d1dbed6b0fbbb817', } }, ], } ]; ``` -------------------------------- ### Import and use getIabSubCategory Source: https://docs.prebid.org/dev-docs/bidder-adaptor.html Example of importing getIabSubCategory from bidderFactory and using it to get primaryCatId. ```javascript import { getIabSubCategory } from '../src/adapters/bidderFactory'; let primaryCatId = getIabSubCategory(bidderCode, pCategory) ``` -------------------------------- ### Start the server bundle JAR with 51Degrees config Source: https://docs.prebid.org/prebid-server/pbs-modules/51degrees-device-detection.html Starts the prebid-server-bundle.jar with the sample configuration file that enables the 51Degrees device detection module. ```bash java -jar target/prebid-server-bundle.jar --spring.config.additional-location=sample/prebid-config-with-51d-dd.yaml ``` -------------------------------- ### Minimal RTB Banner Example for EXADS Adapter Source: https://docs.prebid.org/dev-docs/bidders/exads.html A minimal RTB banner example showing how to use the EXADS adapter. The most important attributes are endpoint, fid, and zoneId, which you can get after configuring the zones. ```javascript adUnits = [ { code: 'postbid_iframe', // the frame where to render the creative mediaTypes: { banner: { sizes: [300, 250], }, }, bids: [ { bidder: 'exads', params: { zoneId: 12345, fid: '829a896f011475d50da0d82cfdd1af8d9cdb07ff', partner: 'ortb_2_4', siteId: '123', siteName: 'test.com', country: 'IRL, userIp: '0.0.0.0', userId: '1234', impressionId: impression_id.toString(), mimes: ['image/jpg'], endpoint: 'https://your-ad-network.com/rtb.php', }, }, ], }, ]; ``` -------------------------------- ### Example setup using pbjs.setConfig() Source: https://docs.prebid.org/dev-docs/bidders/relevantdigital.html Recommended method to set global configuration parameters for the Relevant Digital bidder. Sets pbsHost and accountId globally via pbjs.setConfig, then defines an ad unit with a banner media type and a bid using the relevantdigital bidder with a placementId. ```javascript pbjs.setConfig({ relevantdigital: { pbsHost: 'pbs-example.relevant-digital.com', accountId: '6204e5fa70e3ad10821b84ff', }, }); var adUnits = [ { code: 'test-div', mediaTypes: { banner: { sizes: [[300, 250], [320, 320]] }}, bids: [ { bidder: 'relevantdigital', params: { placementId: '6204e83a077c5825441b8508_620f9e8e4fe67c1f87cd30ed', } } ], } ]; ``` -------------------------------- ### Welect Ad Unit Setup with placementId Source: https://docs.prebid.org/dev-docs/bidders/welect Example ad unit setup for the Welect bidder adapter. Requires a placementId provided by Welect and targets instream video with a player size of 640x360. ```javascript var adUnits = [ { bidder: 'welect', params: { placementId: 'exampleId' }, mediaTypes: { video: { context: 'instream', playerSize: [640, 360] } }, }; ]; ``` -------------------------------- ### GET /version response JSON Source: https://docs.prebid.org/prebid-server/endpoints/pbs-endpoint-version.html Example JSON response returned by the GET /version endpoint. The revision field is the Git commit id from the head of the branch used to build the instance, and version is the product version number. ```json { "revision": "61062d5d9e2b26ba704056c9cf7ffdd1f24f41c2", "version": "0.239.1" } ``` -------------------------------- ### Start the Prebid Server Source: https://docs.prebid.org/prebid-server/pbs-modules/51degrees-device-detection.html Starts the Prebid Server (Go) using the main entry point. ```bash go run main.go ``` -------------------------------- ### pbjs.setConfig(cache) Source: https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig Configures client-side caching of VAST XML creatives. The example shows basic setup with a Prebid Cache URL. ```APIDOC ## pbjs.setConfig(cache) ### Description Sets the cache configuration for Prebid.js, controlling how VAST XML creatives are cached and retrieved. ### Method setConfig ### Parameters #### Request Body - **cache** (object) - Required - Configuration object for caching. - **url** (string) - Required - The URL of the Prebid Cache server endpoint where VAST creatives will be sent. - **useLocal** (boolean) - Optional - Flag determining whether to locally save VAST XML as a blob. Defaults to `false`. - **timeout** (number) - Optional - Timeout (in milliseconds) for network requests to the cache. - **vasttrack** (boolean) - Optional - Passes additional data to the url, used for additional event tracking data. Defaults to `false`. - **ignoreBidderCacheKey** (boolean) - Optional - If the bidder supplied their own cache key, setting this value to `true` adds a VAST wrapper around that URL, stores it in the cache defined by the `url` parameter, and replaces the original video cache key with the new one. Defaults to `false`. - **allowVastXmlOnly** (boolean) - Optional - When `true`, allows rendering VAST XML without requiring use of a cache. Defaults to `false`. - **batchSize** (number) - Optional - Enables video cache requests to be batched by a specified amount (defaults to 1) instead of making a single request per each video. - **batchTimeout** (number) - Optional - Used in conjunction with `batchSize`, specifies how long to wait in milliseconds before sending a batch video cache request based on the value for `batchSize` (if present). Defaults to 0. ### Request Example ``` pbjs.setConfig({ cache: { url: 'https://my-pbs.example.com/cache' } }); ``` ### Response No response body is returned. The configuration is applied asynchronously. ``` -------------------------------- ### Ad Unit Setup for Banner through Websites Source: https://docs.prebid.org/dev-docs/bidders/ventes.html Example ad unit configuration for Ventes bidder on websites, with required placementId and publisherId. ```javascript var adUnits = [ { code: 'test-hb-ad-11111-1', mediaTypes: { banner: { sizes: [ [300, 250] ] } }, bids: [{ bidder: 'ventes', params: { placementId: 'VA-002-0007-0799', publisherId: '5cebea3c9eea646c7b623d5e', } }] } ] ``` -------------------------------- ### Run gulp serve for integration example Source: https://docs.prebid.org/dev-docs/modules/geoedgeRtdProvider.html To view an integration example: in your cli run: ```bash gulp serve --modules=msftBidAdapter,geoedgeRtdProvider ``` -------------------------------- ### Navigate to integration example URL Source: https://docs.prebid.org/dev-docs/modules/geoedgeRtdProvider.html in your browser, navigate to: ```text http://localhost:9999/integrationExamples/gpt/geoedgeRtdProvider_example.html ``` -------------------------------- ### Banner - Ad Unit Setup Source: https://docs.prebid.org/dev-docs/bidders/smartico.html Example configuration for setting up a smartico banner ad unit in Prebid.js, including required and optional bid parameters. ```APIDOC ## Banner - Ad Unit Setup ### Description Example configuration for a banner ad unit using the smartico bidder adapter. ### Method Prebid.js Ad Unit Configuration ### Endpoint N/A - Client-side Prebid.js configuration ### Parameters #### Bid Params - **placementId** (string) - Required - Unique identificator per widget integration provided by customer. Example: `'1234567'` - **token** (string) - Required - Unique 40-symbols identificator per customer provided by smartico. Example: `'FNVzUGZn9ebpIOoheh3kEJ2GQ6H6IyMH39sHXaya'` - **region** (string) - Optional - Creative region alias. Example: `'berlin'` - **regions** (Array) - Optional - Creative region aliases list. Example: `['berlin', 'hamburg']` - **bannerFormat** (string) - Optional - Specific banner format alias. Example: `'medium_rectangle'` - **language** (string) - Optional - Two letter language code. Example: `'de'` ### Request Example ```javascript var adUnits = [ { code: 'slot123', mediaTypes: { banner: { sizes: [[300, 250]], // a display size } }, bids: [ { bidder: ``` ```APIDOC smartico ``` -------------------------------- ### Rewarded Ad Integration Example (Swift) Source: https://docs.prebid.org/prebid-mobile/modules/rendering/ios-sdk-integration-gam Complete example showing how to create an event handler, create a RewardedAdUnit, load the ad, and display it when ready. ```swift // 1. Create an Event Handler let eventHandler = GAMRewardedEventHandler(adUnitID: GAM_AD_UNIT_ID) // 2. Create an Ad Unit rewardedAd = RewardedAdUnit(configID: CONFIG_ID, eventHandler: eventHandler) rewardedAd.delegate = self // 3. Load an Ad rewardedAd.loadAd() /// ....... // 4. Display Ad if rewardedAd.isReady { rewardedAd.show(from: self) } ``` -------------------------------- ### Native Ad Unit Setup for billow_rtb25 Source: https://docs.prebid.org/dev-docs/bidders/billow_rtb25 Example ad unit configuration for native placements using the billow_rtb25 bidder, with OpenRTB native assets. ```javascript var adUnits = [{ code: 'native-ad-unit', mediaTypes: { native: { ortb: { ver: '1.2', assets: [ { id: 1, required: 1, title: { len: 80 } }, { id: 2, required: 1, img: { type: 3, wmin: 100, hmin: 100 } } ] } } }, bids: [{ bidder: 'billow_rtb25', params: { placementId: 'native-placement-123' } }] }]; ``` -------------------------------- ### Build command with ampliffyBidAdapter, dfpAdServerVideo, gptPreAuction Source: https://docs.prebid.org/dev-docs/bidders/ampliffy.html Example gulp build command to include the required modules for Ampliffy. Use this when building the Prebid.js binary from source. ```shell gulp build --modules=ampliffyBidAdapter,dfpAdServerVideo,gptPreAuction ``` -------------------------------- ### Sample banner setup with Sharethrough bidder Source: https://docs.prebid.org/dev-docs/bidders/sharethrough Configures a banner ad unit with the Sharethrough bidder, including the required pkey parameter. The example shows how to set up the ad unit and add it via pbjs.addAdUnits. Note that bcat and badv can be set here but are deprecated; prefer the ORTB blocking method. ```html ``` -------------------------------- ### JSON Schema: Required placementId string parameter Source: https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html Defines a JSON Schema with a required `placementId` string property. This is the starting example for defining bidder parameters. ```json { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Foo Adapter Params", "description": "A schema which validates params accepted by the Foo adapter", "type": "object", "properties": { "placementId": { "type": "string", "description": "Placement ID" } }, "required": ["placementId"] } ``` -------------------------------- ### Banner Ad Unit Setup for smartadline Source: https://docs.prebid.org/dev-docs/bidders/smartadline.html Example of a Prebid.js ad unit configuration for a banner media type using the smartadline bidder. The required parameter is publisherId, which is a unique identifier provided by the Smartadline team. This setup requires approval from Smartadline; contact smartadline@gmail.com for more information. ```javascript var adUnits = [ { code: 'slot123', mediaTypes: { banner: { sizes: [[300, 250]], // a display size } }, bids: [ { bidder: "smartadline", params: { publisherId: '1234567', //required } } ] } ] ``` -------------------------------- ### Example setup using only bid params Source: https://docs.prebid.org/dev-docs/bidders/relevantdigital.html Alternative method to set global configuration parameters like pbsHost and accountId directly in the bid params. Note that setting different global config parameters on different bids is not supported in general; the first settings found will be used and subsequent ones ignored, except for useSourceBidderCode which can be overridden per ad unit. ```javascript var adUnits = [ { code: 'test-div', mediaTypes: { banner: { sizes: [[300, 250], [320, 320]] }}, bids: [ { bidder: 'relevantdigital', params: { placementId: '6204e83a077c5825441b8508_620f9e8e4fe67c1f87cd30ed', pbsHost: 'pbs-example.relevant-digital.com', accountId: '6204e5fa70e3ad10821b84ff', } } ], } ]; ``` -------------------------------- ### Serve example for testing DAP segments Source: https://docs.prebid.org/dev-docs/modules/symitriDapRtdProvider.html Use this gulp serve command to run a local example that shows available segments returned by DAP. Then point your browser to the provided URL. ```shell gulp serve --modules=rtdModule,symitriDapRtdProvider,msftBidAdapter,sovrnBidAdapter ``` -------------------------------- ### Ad Unit Setup for Banner through Websites Source: https://docs.prebid.org/dev-docs/bidders/ventes.html Example configuration for a banner ad unit using the ventes bidder on websites, including required placementId and publisherId parameters. ```APIDOC ## Ad Unit Setup for Banner through Websites ### Description Example configuration for a banner ad unit using the ventes bidder on websites. ### Parameters #### Bid Params - **placementId** (string) - Required - Placement ID from Ventes Avenues - **publisherId** (string) - Required - Publisher ID from Ventes Avenues ### Request Example ```javascript var adUnits = [ { code: 'test-hb-ad-11111-1', mediaTypes: { banner: { sizes: [ [300, 250] ] } }, bids: [{ bidder: 'ventes', params: { placementId: 'VA-002-0007-0799', publisherId: '5cebea3c9eea646c7b623d5e', } }] } ] ``` ```