The sections below provide details about the parameters and usage notes for building OpenWrap video ad tags in GAM AdServer.
DFP is now called, Google Ad Manager (GAM)…
When you see DFP mentioned in this guide, remember that it is referring to GAM.
In-App OTT header bidding
To support header bidding for OTT mobile apps, OpenWrap supports a REST API that fetches bids for a video ad slot and returns those bids as a set of targeting keys that can be passed to the ad server. The following steps describe how to call this API and send the returned targeting keys to GAM. While the most common use case for this REST API is for In-App header bidding for OTT video, it can be used on any platform.
Step 1: Setup OpenWrap Profile
Create an OpenWrap profile with OTT/CTV selected as the Platform type. Then configure bidders, map ad units, and push the profile live. See OpenWrap Profile Management for details on how to create a profile and map ad units.
Step 2: Make a call to OpenWrap ahead of call to ad server to fetch bids.
OpenWrap will return bid(s) for the video slot in the form of targeting keys.
Sample OpenWrap request URL:
The parameters for the OpenWrap video request are all sent as URL parameters. Accurate and complete video parameters are essential for achieving good yield. Please work with your PubMatic customer success manager to make sure you have the correct set of parameters.
If there is no bid the OpenWrap server will return still return a JSON document but your code should still handle error cases such a no response at all or non-200 HTTP response codes.
When making the call to OpenWrap, always set a timeout in your code in case the call doesn’t complete. While OpenWrap will respect the timeout specified in the profile, the call from the client may not complete in the maximum time due network or other issues.
In addition to these in-app OTT parameters, you can refer to the OpenWrap Query Parameters parameters above.
In-app OTT parameter name
Format of response to return.
Pass this parameter to specify response format.
If value of this parameter is 'json' then response would be returned in JSON format containing only 'targeting' field.
For any value other than 'JSON', redirect response will be sent with redirect url, unless debug is true.
If value of this parameter is 'json' then 'owredirect' param is optional. If 'owredirect' parameter has not been passed then following additional parameters need to be passed:
These parameters are used for macro replacement and override values in owredirect if present.
Inventory unit (ad unit)
This is the ad unit value OpenWrap uses for mapping to demand partner parameters.
As GAM ad unit ids have ‘/’, it’s important to correctly URL encode this value
Video player size
|pwtbidrprm||Encoded JSON string||Bidder specific key-value for AppNexus amn PubMatic.|
Sample JSON with key-values:
Step 3: Parse the response from OpenWrap
When bidding is successful, OpenWrap will return an HTTP 200 with JSON document.
The targeting keys for OpenWrap’s video bid are located under the targeting field in the returned JSON document.
Step 4: Append targeting keys to your GAM (or other ad server) VAST URL
These instructions cover GAM. The concepts are the same for any other ad server, but the details of passing the targeting keys will differ for other ads servers.
You'll need to take the targeting keys we get from OpenWrap and add them to the VAST ad tag URL that GAM will be called with.
Here’s an example GAM URL without targeting keys:
Targeting keys are passed in the
cust_params URL parameter.
cust_params contain the URL keys encoded as a url query string. Since
cust_params is part of a url query string itself, we have a url query string within a url query string.
Here’s an example GAM URL with targeting keys:
You'll notice the value of
%26; this value separates the different targeting keys. The
%26 is a url encoded version of '
Because the value of
cust_params requires two levels of url encoding, we recommend using a url code library to construct the url.
If you are already passing custom targeting keys to GAM, you’ll need combine your existing targeting keys and OpenWrap’s targeting keys in the
Step 5: Pass augmented URL to Ads SDK
The VAST url augmented with targeting keys is now passed to the video ads SDK as normal. In many cases, the ads SDK will be IMA, but this approach will work with other ads SDKs.
For the ad server to utilize the targeting keys, line items need to be setup in the ad server. Contact your PubMatic customer success manager to arrange for line item set up.
OpenWrap Query Parameters
|oRTB Video Request parameter||OpenWrap Parameter||Parameter Type||Notes|
|W and H would be provideed in pwtvsz or sz in the format: WxH|
List of Integers; for example,
Possible Integer values for pwtmime and their corresponding meaning:
|W and H would be provided in |
User parameters supported
oRTB User request parameter
Content parameters supported
oRTB Content request parameter
GDPR parameters supported
oRTB GDPR request parameter
|Value indicating GDPR enabled or not|
CCPA parameters supported
oRTB Content request parameter
Mobile parameters support
The following parameters would be considered only when "pwtapp" query parameter is set to 1 , which indicates this is a mobile request (i.e. &pwtapp=1)
|oRTB Video request parameter||OW parameter||Parameter type||Notes|
|pwtappcat||Array of String|
|Device.Lmt||pwtlmt||Integer||Can be either 1 or 0|
|Device.Dnt||pwtdnt||Integer||Can be either 1 or 0|
You can also send macros for GAM parameters as query parameters to the video endpoint. For example, sending pwtm_description_url=www.test.com would replace the description_url value in the GAM url, then use the same in constructing the oRTB Video object, and also update the GAM redirect URL with these values.
To send a macro for a given GAM parameter, use query parameter key, pwtm_<exact GAM parameter name>. For example,
When a request is made to OpenWrap Video endpoint, it responds with a 302 redirect to the GAM URL. But sometimes, you may want to debug a particular request. You may enable debugging for an OpenWrap video request which would return a JSON response containing debug information. However, an important point to note here is: when debugging is enabled, the usual flow of redirection to GAM URL would NOT work and creative would not be rendered.
To enable debugging, you may follow these steps:
1. Use macro to set pwtm_url query parameter in the Video endpoint dynamically.
2. Add logic to always set page URL in pwtm_url macro before making a call to Video endpoint. This way any query parameters added to the page URL would be set in pwtm_url value.
3. When you want to enable debugging, add query parameter pwtvc=1 in the page URL. This would be replaced in the pwtm_url macro with the above logic and Video endpoint would respond with debug response.
Sample Video endpoint call with pwtm_url macro along with macros for a few other GAM parameters like sz, vpos, vtype:
Here is a sample code snippet that replaces pwtm_url macro dynamically with the page URL.
Use this method to add a video ad to your page when you want to sync with a user cookie on the client side. The cookie will contain a list of bidders in JSON format passed from the URL query in the video ad iFrame:
Your full page implementation might look something like this:
OpenWrap for Video Ads does not currently support Companion Ads.