RTB - Pubmatic (Native)


Refer to Getting Started with RTB for general instructions on how to set up RTB. This article contains information specific to integrating with PubMatic (Native).

Creating a PubMatic Advertiser

  1. Click to Add an Advertiser.

  2. Choose "PubMatic (Native)" as the choice of Partner in the dropdown. If you don't see this as an option, contact your account manager.

  3. Enter the RTB settings. These will be given to you either by your account manager or by PubMatic directly:

    • Bidder Endpoint - The PubMatic URL that Kevel sends the bid request to.
    • Publisher ID - Your PubMatic publisher ID.
    • Publisher Name - The name of your account as represented in PubMatic's system.
    • Site ID - Your PubMatic site ID. Note that this may not correlate to a Kevel Site ID - a PubMatic Site can represent any grouping of inventory in Kevel. Check with your account manager if you want more info about how your PubMatic sites are set up.

Creating a PubMatic Campaign, Flight, and Ad

Follow the instructions in the Getting Started with RTB article for creating campaigns, flights, and creatives. Make sure to use your PubMatic advertiser.


If you are serving PubMatic ads via JavaScript tags, you will need to set an Ad Template on the creative object. See "Requesting PubMatic Ads" for details.

Requesting PubMatic Ads

You can request PubMatic ads either via the JavaScript ad tags or the Decision API. However, how the content is rendered is different:

  • Via JavaScript Ad Tags

To serve PubMatic ads via the JavaScript tags, you will need to include an Ad Template on the creative object. This specifies how the JSON elements of the ad should be rendered in the browser using macros and HTML. This is a sample template:

{{rtb.text}}<br><a href="{{rtb.link}}"><img src="{{rtb.img}}"></a>

This renders the text of the ad {{rtb.text}}, followed by a newline and an image {{rtb.img}} that is linked {{rtb.link}} to the click URL of the ad.

You can customize the template to meet the needs of your site.


You cannot use other Kevel macros in the Ad Template

  • Via the Decision API

The Decision API will return PubMatic ads as a JSON object based off the OpenRTB native ad standard. For more details, refer to our RTB Endpoints article.


Making a Decision API request requires a valid userAgent from the user's browser. You will need to set this on your request, or otherwise PubMatic will not return a bid.