Native Content-Driven Advertising Example 2

In the previous blog, I mentioned there are two approaches to do Native Content-Driven Advertising and showed you how to manually target keywords and IAB Categories. In this blog, I describe how to do it automatically using AdRelevantis Content-Analysis service.

In your page head, add the following code.

//www.adrelevantis.com/js/dev/prebid.js
//www.adrelevantis.com/js/contentdriventag.js
<script>
  var adUnits = [
    {
      code: 'div1',
      sizes: [
        [300, 300]
      ],
      mediaTypes: {
        native: {
          title: {
            required: true
          },
          image: {
            required: true
          },
          sponsoredBy: {
            required: true
          }
        }
      },
      bids: [{
        bidder: 'adrelevantis',
        params: {
          placementId: 13232354,
          allowSmallerSizes: true
        }
      }]
    },
    {
      code: 'div2',
      sizes: [
        [300, 300]
      ],
      mediaTypes: {
        native: {
          title: {
            required: true
          },
          image: {
            required: true
          },
          sponsoredBy: {
            required: true
          }
        }
      },
      bids: [{
        bidder: 'adrelevantis',
        params: {
          placementId: 13232354,
          allowSmallerSizes: true
        }
      }]
    },
    {
      code: 'div3',
      sizes: [
        [300, 300]
      ],
      mediaTypes: {
        native: {
          title: {
            required: true
          },
          image: {
            required: true
          },
          sponsoredBy: {
            required: true
          }
        }
      },
      bids: [{
        bidder: 'adrelevantis',
        params: {
          placementId: 13232354,
          allowSmallerSizes: true
        }
      }]
    }
  ];
  
  var pbjs = pbjs || {};
  pbjs.que = pbjs.que || [];
  
  var adDivIds = ['div-1','div-2','div-3'];
  document.addEventListener("DOMContentLoaded", function(event){ adrtags("D435C107A8844E15BAA5D4A9B7D94FC5", adUnits, adDivIds); });
</script>

The code creates three ad units, each corresponds one <div> tag in the page.

<div id='div-1'>
</div>
<div id='div-2'>
</div>
<div id='div-3'>
</div>

You can put these tags anywhere you want in the page.

When the page opens, the DOMContentLoaded event handler analyzes the page content to get its IAB Categories and top keywords; the Categories and keywords are sent as request parameters; the SSP and DSP bids based on the request parameters; the matched native ads are displayed.

You can find a working example at https://github.com/ghguo/adrhbexamples/blob/master/ContentExamples/essential-french-onion-soup.html. Need more info? Drop us a line at <info@adrelevantis.com>.

Native Content-Driven Advertising Example

There are two approaches to do Native Content-Driven Advertising using AdRelevantis Bidder Adapter: Manually target keywords and IAB Categories, or use AdRelevantis Content-Analysis service. In this blog, we focus on manually targeting keywords and IAB Categories.

We assume that you know basic programming in Prebid.js. Please go here if you are new to Prebid.js.

Assuming that in a page you want to display ads that are related to golf US Open, you can provide the keywords and IAB Categories as First Party Data (fpd) as follows.

pbjs.setBidderConfig({
  bidders: ['adrelevantis'],
  config: {
    fpd: {
      context: {
        keywords: ['US Open'],
        data: {
          category: '/sports/golf'
        }
      }
    }
  }
});

You can find the complete code of this example at https://github.com/ghguo/adrhbexamples/blob/master/native-example.html.

Content-Driven Native Header Bidding

Native ads blend seamlessly into pages. Content-Driven Native advertising takes a step further by matching ads with page content. As a result, your pages display relevant ads blending into content.

AdRelevantis SSP provides Content-Driven Native ads for publishers. With AdRelevantis Bidder Adapter, you get native ads that match with content of your pages.

To use AdRelevantis Bidder Adapter, add in your page head the following code.

<script async src="//www.adrelevantis.com/js/dev/prebid.js"></script>
<script src="//www.adrelevantis.com/js/contentdriventag.js"></script>
<script>
  var PREBID_TIMEOUT = 5000;
  var FAILSAFE_TIMEOUT = 6000;

  var adUnits = [{
    code: 'div_1',
    sizes: [
      [360, 360]
    ],
    mediaTypes: {
      native: {
        title: {
          required: true
        },
        image: {
          required: true
        },
        sponsoredBy: {
          required: true
        }
      }
    },
    bids: [{
      bidder: 'adrelevantis',
      params: {
        placementId: 13232354,
        allowSmallerSizes: true
      }
    }]
  },
  {
    code: 'div_2',
    sizes: [
      [250, 250]
    ],
    mediaTypes: {
      native: {
        title: {
          required: true
        },
        image: {
          required: true
        },
        sponsoredBy: {
          required: true
        }
      }
    },
    bids: [{
      bidder: 'adrelevantis',
      params: {
        placementId: 13232354,
        allowSmallerSizes: true,
        cpm: 0.50
      }
    }]
  },
  {
    code: 'div_3',
    sizes: [
      [1, 1]
    ],
    mediaTypes: {
      native: {
        title: {
          required: true
        },
        body: {
          required: true
        },
        image: {
          required: true
        },
        sponsoredBy: {
        required: true
        },
        icon: {
          required: false
        },
      }
    },
    bids: [{
      bidder: 'adrelevantis',
      params: {
        placementId: 13232354,
        allowSmallerSizes: true
      }
    }]
  }];
  var pbjs = pbjs || {};
  pbjs.que = pbjs.que || [];

</script>

<script>
  var adDivIds = ['div1','div2','div3'];
  document.addEventListener("DOMContentLoaded", function(event){ adrtags("D435C107A8844E15BAA5D4A9B7D94FC5", adUnits, adDivIds); });
</script>

Add the following <div> tags in your page body.

<div id='div1'>
</div><br>
<div id='div2'>
</div><br>
<div id='div3'>
</div>

The above code and tags display 3 Native ads in the page. You can add more or less <div> tags to your page to have more or less Native ads in the page.

When the page is open, the code will analyze the content and bid based on the content. In the end, you will see Native ads that match the page content.

Here are a few examples that show Native ads that match page content:

Just One Grand Slam Win Away From Federer, US Open Champ Nadal Knows His Time Is Limited
Essential French Onion Soup
Ex-Disney Star Laura Marano Is Determined To Prove Herself In The Music Industry
The Impracticality of Hardwood Flooring | Centsational Style

Content-Driven Header Bidding with Prebid.js

Publishers love Header Bidding. Content-Driven Advertising displays ads relevant to published content. Content-Driven Header Bidding combines both to display header bidding ads relevant to page content. Here, we describe how to do Content-Driven Header Bidding using Prebid.js.

Publisher

The Adrelevantis bidder adapter has been brought into Google Ad Manager. You can find an example at native-example.html. In this example, the keywords and IAB categories are provided by page designer.

You can also use an AI service to identify the keywords and categories automatically in real time. See examples at https://github.com/ghguo/adrhbexamples.

Supply-Side Platform (SSP)

The bid request is sent to SSPs. The SSPs relay the IAB Categories and keywords along with other request data to DSP Adservers. The DSPs can bid based on the IAB Categories and keywords. The SSPs receive the bids and send them back to the page.

Here is a Content-Driven Supply-Side Platform: https://github.com/ghguo/adrssp.

Demand-Side Platform (DSP)

A DSP adserver needs to enable advertisers to target ads to IAB Categories and keywords. When bid request with IAB Categories and keywords of the published content comes, it matches ads based on the IAB Categories and keywords.

Here is an adserver that provides content target capability: https://github.com/ghguo/revive411.