Monetization Framework

Callback Event

You can use BSANativeCallback function to retrieve the attributes from the request. Here is the list of attributes you can access through this callback.

typeThe ad format rendering type
keyThe zone key for the request
segmentThe segment or placement of this request
optionsThe value of options you pass into _bsa.init
adsThe response from the request

Handling empty ads

You can check the length of of the ads to see whether the API has returned any ads. Here is an example:

function BSANativeCallback({ ads, key }) {
  console.log(JSON.stringify(ads, null, 2))
  console.log(`${ads.length} ad(s) was served in zone ${key}`)
  if (ads.length === 0) {
    // Do something here to display fallback banner