NAV

RTB House

Introduction

Hello!
This document will lead you through the integration process with RTB House's Outstanding Prebid Ways so you can begin your RTB House prebid campaign.

RTB House provides a piece of code to be added in the header of the page before the ad server callout.
It generates an asynchronous call so RTB House can identify the user and return a bid. Such information including the bid price is then sent to the adserver.

RTB House campaigns are targeted in the adserver based on Custom keyword criteria.

Requirements

What will you receive from RTB House:

We will need you to

Scripts Implementation

Prebid.js - adapter and modules

The code initializes the RTB House tags, which are a part of prebid A.B.C.js (A,B,C being current version numbers). The code will load the prebidA.B.C.js library and will also build the events queue that will be used later.
Prebid.js package contatins all the chosen bidder adapters and all the modules in one JS file, it can be customized and downloaded from

URL: https://docs.prebid.org/download.html

For this particular setup purpose we have enabled:

Bidder Adapters:

Analytics Adapters:

Modules:

The loader request is asynchronous and is cached on the user browser.
Apart from prebid.js package version - No code changes are required on this section.

The next step is to map all the adunits available on the page and assign their code.

In this section you will see how the typical minimalistic display adunit is set up.

Parameter Description
code Unique identifier that you create and assign to the ad unit. Used to set query string targeting on the ad. If using GPT, we recommend setting simillar "code" as a slot element ID.
mediaTypes banner, native or video
banner.sizes Here you can set acceptable adunit sizes, in example in variable.
bidder Required, name of the bidder - "rtbhouse"
params.region Required, type: string, region of specific publisher is being assigned by RTB House Inventory team (-eu, -asia, -us).
params.publisherId Required, type: string, unique ID assigned by RTB House Inventory team.
params.bidfloor Optional, type: float, Minimal CPM value in XYZ currency [by default it is USD]
URL: http://prebid.org/dev-docs/bidders/rtbhouse.html

Bid response details

The mapping is used to generate a bid request to RTBhouse's endpoint.
In case RT House has a bid for the user, the request will return a HTTP STATUS 200 with an bids object described below :

Field Type Description Example
id String The adunit id provided in the request ad-unit-0
impid String Impression individual Id 1958db31f122811
price Float The raw bid CPM 1.58
adid String Creative Id l2HjtZ8tLkRPAaeVkRk0
adm String The creative iframe <iframe src=\"https://sin.creativecdn.com/imp-delivery?tkn=EdN...>
adomain List of Strings The domain name ["rtbhouse.com"]
cid String The deal Id ...z3XR2NmqbMmZl...
w Integer The creative width 300
h Integer The creative height 250

Please find an example of such object below:

In case the user is not eligible to any RTBhouse campaign, the bid response will be an empty 204 response.

Header implementation

Disabling the adserver auto load

The original DFP tags are similar to below.

Since we will wait for the RTBhouse Bidder Call before calling the adserver, the function: googletag.pubads().disableInitialLoad() and googletag.pubads().enableSingleRequest(), can be placed anywhere before googletag.enableServices(). Another thing worth remembering is adding apropriate "/DFPCode/AdUnitCode/Custom_label" as the first parameter value in .defineSlot method.

The callback function is executed as soon as the bid response is received. The bids must now be processed and sent within the adserver request. The examples from now on will use DFP/GAM as reference, but it can be adapted to any adserver that supports keyword targeting.

The adserver request must wait for the RTB House bidder to respond first. It can be achieved by using a combination of two functions:

More details on DFP's documentations here.

Sending the keywords

First we are adding adUnits, then implementing a function for initializing the Adserver. Then we add:
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync(); - part which will append RTBhouse keywords to the adserver call.
googletag.pubads().refresh(); - part which will trigger the adserver call.

Sending keywords back to adserver can be implemented in the callback function that will be triggered once the RTB House bid response is received (or after the timeout). On our previous example, we are using the function named initAdserver.

Keyword Type Description Example
hb_pb String The general bid price band CPM hb_pb=0.40
hb_pb_rtbhouse String (optional) The bid price band CPM for RTBHouse hb_pb_rtbhouse=0.40
hb_bidder String (optional) Selecting RTBHouse bidder hb_bidder=rtbhouse

Above table presents two ways of setting up keywords:

Prebid Modules

In this section additional modules will be described. All the modules are defined in pbjs.setConfig({})

Currency module

This module supports the conversion of multiple bidder currencies into a single currency used by the publisher's ad server. This module allows, gaining automatic updates as currency exchange rates fluctuate. Here's how it works at a high level:


Currency module is used to translate currency of the adserver to match currency of a bidder, if there is no other script doing such translations, it is higly recommended to implement Currency module.

Parameter Type Description
priceGranularity String dictionary Tells the ad server how much money the “bidder” demand is worth. Allowed values are "low, "med", "high"m "auto", "dense". Detailed description.
currency.adServerCurrency String ISO 4217 3-letter currency code. If this value is present, the currency conversion feature is activated.
currency.granularityMultiplier Decimal How much to scale the price granularity calculations. Defaults to 1. Is used for currencies that are not changing at the same rate - their value is far from USD [close to 1:1], it can be changed for example for markets like YEN to USD [110:1]
currency.defaultRates Object An optional parameter that defines a default rate that can be used if the currency file cannot be loaded. This option isn’t used when the rates parameter is supplied. Example: { USD: { PLN: 4 } }
currency.rates Object This optional argument allows you to specify the rates with a JSON object, subverting the need for the conversionRateFile parameter. If this argument is specified, the conversion rate file will not be loaded. Example: { ‘USD’: { ‘CNY’: 6.8842, ‘GBP’: 0.7798, ‘JPY’: 110.49 } }
currency.conversionRateFile URL Optional path to a file containing currency conversion data. See below for the format. Prebid.org hosts a file as described in the next section.

Please find an example for PLN based GAM below:

URL: http://prebid.org/dev-docs/modules/currency.html

Consent management module is designed to support the EU General Data Protection Regulation (GDPR) and to support the California Consumer Privacy Act (CCPA). The IAB has generalized these guidelines to cover future regulations, referring to the feature as “US Privacy.”
Consent management module works with supported Consent Management Platforms (CMPs) to fetch an encoded string representing the user's consent choices and make it available for adapters to consume and process.
To utilize Consent management module, a CMP (Consent Management Platform) compatible with the IAB 1.1 TCF spec needs to be implemented on the site to interact with the user and obtain their consent choices. We do recommend to that you place the CMP code before the Prebid.js code in the head of the page in order to ensure the CMP’s framework is loaded before the Prebid code executes.

Parameter Type Description
cmpApi String Set to default, as 'iab'or 'static' for a non-standard IAB integrations
timeout Integer CMP response timeout, defaults to 5000ms
allowAuctionWithoutConsent Boolean Defines what happens when obtaining consent info from CMP fails (suppresses auction). In example scenario, which is not linked with any CMP, it is set to "true"
usp.timeout Integer This is a US Privacy timeout set to 100ms

Publishers not using an IAB-Compliant CMP - head directly to the URL provided below.

URL: http://prebid.org/dev-docs/modules/consentManagement.html

User ID: PubCommon ID module

User ID module stores an unique user id in the first party domain and makes it accessible to all adapters. Similar to IDFA and AAID, this is a simple UUID that can be utilized to improve user matching, especially for iOS and MacOS browsers, and is compatible with ITP (Intelligent Tracking Prevention). It's lightweight and self contained. Adapters that support Publisher Common ID will be able to pick up the user ID and return it for additional server-side cross device tracking. There is no special registration or configuration for PubCommon ID. Each publisher's privacy policy can take PubCommon ID into account.

Parameter Type Description
storage Object The publisher can specify some kind of local storage in which to store the results of the call to get the user ID. It can be either cookie or HTML5 storage. This is not needed when value is specified or the ID system is managing its own storage
storage.type String Required "cookie" or "html5"
storage.name String Create a cookie with this name - The name of the cookie or html5 local storage where the user ID will be stored
storage.expires Integer How long the user ID info will be stored
storage.refreshInSeconds Integer The amount of time (in seconds) the user ID is be cached in storage before calling the provider again to retrieve a potentially updated value for their user ID. If set, this value can equate to a time period less than the number of days defined in storage.expires. By default the ID will not be refreshed until it expires
value Object Used only if the page has a separate mechanism for storing a User ID. The value is an object containing the values to be sent to the adapters
URL: http://prebid.org/dev-docs/modules/userId.html#pubcommon-id

Adserver setup

Setting up an ad server, requires 5 basic steps, which are:

Keywords

Go to Inventory > Key-values and click on New Key and create the key-value

DFP keywords 1

Order

Go to Delivery > Orders and click on New Order and create one new Order for the campaign.

DFP keywords 2

First Line Item

You can create the first line on the same page or simply by entering any created order. The goal is to create one dedicated line item per different CPM price band. For the best performance one every each 0.01.

We will create the unitary CPM for the first line item:

Line items 1 Line items 2 Line items 3

Line items 4

Finally, please select the inventory for the campaign and add the following targeting:

Line items 5

Finally, hit save and follow with the creative steps below.

Creatives

Please find example prebid creative code below:



To prepare a new creative, go to Delivery > Creatives > and click on Add creative then type and select the same advertiser name to add creative (for us Prebid (Advertiser)). Hit Select and:

Click Save.

Go back to the first line item created, click on the Creatives tab and on Add creative - Existing creative.

Pick the one that was just created.

The last step is to duplicate the creative so its quantity equals the number of unique ad units you have on the same page. I.e.: Should you have up to 5 different ad units on your homepage, it means you will need to setup at least 5 creatives for the line item.

The easiest way to achieve this is by selecting one (or multiple) creatives and click on Copy creative that appears on the blue bar, repeat until you have the minimum amounts required for line item to work.

Remaining line items

Now that you have the first line item fully configured, you can simply duplicate it and reuse the existing creatives. To do so, go to the line item pages, select its respective checkbox and click on Copy and share creatives that will appear on the blue bar. Repeat the action for all the different price bands you have.

Please don't forget to update:

You can edit those values directly from the list page by clicking on the icon on the corner of each field:

Line items 7

Once you are set, select all the new line items and click on the Resume button.

For official prebid guide: URL: http://prebid.org/adops/step-by-step.html

Automatic line items creation

RTB House can offer to automatically set up all the orders, line items along with creatives for you - using Line Item Creator App.
Please contact RTB House Inventory Support directly at inventory_support@rtbhouse.com to discuss requirements and the progression path.

Native ads

Native Placement

In order to activate Native demand, first you need to declare an appropriate adunit. Please find a short example below on how the basic adunit can be defined to build the native ad.

All the other parameters that could be passed and integrated into the native you can find under this link:
URL: http://prebid.org/dev-docs/show-native-ads.html

Native Response

Below you can find an example of a native response:



When a native demand is available, RTBhouse will return the following native object:

Native Object

Field Type Description
product Product object Array List of product assets.
advertiser Advertiser object Includes the adv name and logo
impression_pixels Impression pixels object Array List of impression pixels

Product Object

Field Type Description
title String Product title
description String Product description
click_url String Product landing page
call_to_action String Product CTA
image Image object Product image (WidthxHeight px)

Image Object

Field Type Description
url String Image URL.
height Integer Image height
width Integer Image width

Advertiser Object

Field Type Description
description String Advertiser name
domain String Advertiser domain
logo Image object Advertiser logo (WidthxHeight px)

Privacy Object

Field Type Description
optout_click_url String Opt-out landing page URL
optout_image_url String Adchoices icon URL

Impression Pixel Object

Field Type Description
url String Impression pixel beacon

Adserver integration

The campaigns can be set up the same as in case of the standard ads, but with 1x1 and "fluid" adunit sizes added.
In topic of creatives structure, you can find an example of native creative code below:



RTB House Native guidelines:

Protected Audience API Integration manual

Protected Audience API (aka PA API, formerly FLEDGE) support can be added to the prebid.js bundle file in the form of up to 3 modules: PAAPI and optionally 2 additional modules: Fledge for GPT which has been renamed in version 9.0.0 of Prebid.js to "PAAPI for GPT" and finally Top-level PAAPI module for most sophisticated control over PA auctions. It all began with Prebid 8.18.0 when simple fledgeForGpt module appeared that allowed for running PA auctions. Starting with the version 8.37.0 the previously existing module fledgeForGpt which had been the only way to run PA API ads with Prebid has been split to two modules, one of them being PAAPI module (the main, general control module) and the fledgeForGpt module handling PAAPI with GAM. By leveraging the PAAPI module, the publishers are now able to run PAAPI ads by using any adserver of their choice. Version 9.0.0 (alongside with still continued branch 8.x, in 8.52.0) introduced additional control over PA auctions: the Top-level PAAPI.

RTB House prebid.js bid adapter is able to take advantage of the modules and to send requests to RTB House's bidder marked as PA API.

Reach out to your RTB House representative for setup coordination.

Google Ad Manager (GAM) users, read this before you proceed

In order to leverage Protected Audience support with GAM you need to be sure that your GAM instance supports PA API:

Google AdManager PA API global settings

If you don't see those options, contact your Google representative.

It's worth turning "Chrome topics data" on to increase reach when 3rd party cookies are gone.

As the PA API is a work-in-progress and the respective GAM functionality is still evolving, for this feature to work you should contact your RTB House representative as this requires some special configuration to your browser (see also some configuration details below). Only a certain portion of traffic is sent through PA API in GAM (up to 10% of Chrome traffic according to the official GAM documentation: https://support.google.com/admanager/answer/13627134 ). For smooth testing without traffic throttling you should also turn on Allow testing on up to 100% of my inventory with non-Google sellers, regardless of performance impact under your GAM's Admin / Global settings / Network settings tab in order to send all ad requests from every impression to your AdExchange and header bidding partners.

Build the prebid.js package

By using download feature at prebid.org

Follow the general integration manual to choose the RTB House bid adapter and the required modules. Next find and add the module named "PAAPI" and optionally "Fledge (PAAPI) for GPT" (if you run ads with Google Ad Manager adserver). You may also add "Run top level PAAPI auctions" module.

'PAAPI', 'Fledge for GPT' and 'Run top level PAAPI auctions' modules selected

Please note that only versions 8.52 and up contain the latter of the modules (Top level PAAPI)

By using build tools

If you're integrating by using build tools, please check the Prebid version first before proceeding.

PAAPI modules configuration

Top-level PAAPI module configuration

Protected Audience auctions may be run as two-step auctions. The first step named as a component auction is executed at the single participant level which means a single exchange. After all component auctions have finished and the outcome of each of them has been determined, they all go to a top-level auction run by the top-level seller. The topLevelPaapi module appeared with 8.52 version and 9.0.

It is important to know who is the top-level seller (who runs top-level PAAPI auctions). It may be the publisher himself or the adserver used by them if it supports top-level PAAPI auctions. Prebid supports running component and top-level auctions by leveraging topLevelPaapi module along with the general PAAPI module. All you need to do is to include the topLevelPaapi module’s code and add a configuration option. For GAM ad server you only need to make Prebid take control over the moment results of the top-level PAAPI auction are passed to GAM (GAM is the last stage of the process and as such doesn't run PAAPI auctions; see above for pbjs.setPAAPIConfigForGPT() usage).

If a non-GAM ad server is considered you’ll also need to provide a decision logic file maintained on your servers (GAM handles it by itself) and probably need to slightly modify the rendering part of the Prebid code located on your web page.

Writing a decision logic file is out of scope of this document but there are many examples on the web of how to write it, an example at Prebid.js repository: https://github.com/prebid/Prebid.js/blob/master/integrationExamples/top-level-paapi/shared/decisionLogic.js The decisionLogicURL specification can be found here.

The decision logic file must be in the same domain as seller and has to respond with Ad-Auction-Allowed: true http header. Please note the header differs from the one which was used during an early stage of PAAPI specs (X-Allow-FLEDGE: true).

Add topLevelPaapi module to the bundle

Configure topLevelPaapi module

With the above, navigator.runAdAuction is invoked once per ad unit, and the result is made available through getPAAPIBids:

If your adserver is GAM you may benefit from the paapi.topLevelSeller.overrrideWinner option. When overrideWinner is enabled (set to true), rendering a "normal" Prebid bid will instead render a PAAPI bid, if the PAAPI auction for the slot yielded a winner. This is an easy way to include the result of PAAPI auctions without having to change the rendering logic. For example:

Other PAAPI config options

There are also RTB House bidder specific options.

PA API debugging

It's worth to say that the current state of PA API is that it is still evolving. As mentioned above, the GAM API functionality and Prebid modules are subject to changes. There are no live examples yet, but this chapter will shed some light onto how to debug and identify PA API requests.
Please bear in mind that currently the above steps would work only with some special browser configuration. This paragraph will be regularly updated.

User visits an advertiser web page

To get a PA API ad you need to be tagged by PA API-supporting tag somewhere on an advertiser web page. A good example for tests would be rtbfashion.net When you pick a product you will join an Interest Group which can be found in Chrome Dev Tools here: Application >> Storage >> Interest Groups The item will have "join" in the Access Type column. When and item in the right-hand side list is clicked, there will appear some technical details of the Interest Group.

Join Interest Group Event

User visits a publisher web page

Bid Request

When the RTB House bid adapter is configured to send PA API requests then the adapter code prepares the bid request to contain $.imp[].ext.ae = 1 This can be noticed in the Network tab for *.creativecdn.com/bidder/prebidfledge/bids request:

Request ext.ae

There's also $.ext.fledge_config object visible which contains the settings defined in Prebid's bidder-related config pbjs.setBidderConfig({config: {paapiConfig: {...}}) If there are no bidder specific settings, default values are applied by the adapter.

Bid Response

The bid response from the bidder, visible in Network tab of the Chrome Dev Tools, should contain a $.ext.igbid array filled with some non-trivial content and there should also be visible PA API-related prebid config keys with values (possibly slightly different from the sent ones). If that's not the case, please contact us for assistance to further investigate the issue.

PA API Response ext.igbid

Testing with flags

For ensuring 100% traffic when testing we suggest running Chrome with some special options (flags):

chrome.exe --enable-features=CookieDeprecationFacilitatedTesting:label/treatment_1.2/force_eligible/true --privacy-sandbox-enrollment-overrides=https://publisherdomain.com (change the last domain part to your own).

Already enabled native traffic (which is currently ~10% and may rise continuously) doesn’t require any flags.

The label used in the flag may also be treatment_1.1 or treatment_1.3. This simulates browsers with 3rd party cookies turned off and Protected Audience APIs are enabled (so called Mode B)

In your Google Ad Manager you also need to turn on “Allow testing on up to 100% of my inventory with non-Google sellers, regardless of performance impact” under Admin→Global settings→Ad preference settings (see above)

After joining some interest groups (see details of the example page) you should be able to catch an interesting behavior when testing topLevelPaapi module. The component auctions winning bids (from bids among same buyer) now go to the top-level auction and you may observe topLevelBid events in dev tool’s Application/Interest groups table.

Multiseller IG log

Here is how PAAPI Prebid bid looks like, which may be caught in eg. onBidWon event:

Prebid PAAPI bid structure

Complete examples

You can find a fully working example of standard banners and native placements on this page.
Please check the source-code around the area of:
<!-- RTB House bidder -->

Native ads examples are available under these two links:



For an entry in ads.txt file please use:
RTBHOUSE.COM, {PUBLISHER ID}, DIRECT