« SDKBOX Home

SdkboxAds Plugin

Overview

While Sdkbox includes out-of-the-box support for many ad networks, they can be managed in a container plugin called SdkboxAds. It is like a manager of a collection of different ad plugins, while each ad plugin connects to its own backend independentely.

SdkboxAds is an alternative method compared to calling any ad networks directly. SdkboxAds includes support for playing ads and rewarded contents, as well as the definition of placements. Before digging deeper into its internals, some concepts must be clarified.

AdUnit

An AdUnit will be any plugin which can be mediated by SdkboxAds. AdColony, Vungle or Chartboost are examples of AdUnits. AdUnits will be responsible for wrapping already existing plugins and exposing all of them through a common exposed interface. Yes, you will be able to manage all AdUnits with the same codebase. Each AdUnit will expose in the configuration a set of different elements like interstitials, videos or rewards. For example, AdColony defines zones, Chartboost locations and Vungle places. All these three concepts are the same: a name to point to a given ad type.

Placement

A Placement is a collection of pairs of AdUnit and ad name. The idea is to mediate among different AdUnits in a declarative way. For example, a placement could be:

"placements": [
    {
      "id" : "placement-1",
      "strategy" : "round-robin",
      "units" : [
        {
          "unit": "AdColony",
          "name": "video"
        },
        {
          "unit": "Chartboost",
          "name": "interstitial"
        }
      ]
    },
   …
]

The strategy: - "round-robin" - "weight"

strategy -> "round-robin"

Each time this placement is invoked, it round-robin for each AdUnit it has defined. If by any circumstance, at invocation time any AdUnit has no Ads data ready to be played, the next AdUnit will be requested. If no AdUnit has ads ready, nothing will happen.

strategy -> "weight"

Steps:

  1. call placement
  2. collect all available units
  3. Normalize the weight to 100
  4. dice [0,100]
  5. pick the unit

The code look like this.

Certain AdUnits don't handle the concept of a zone, location or place (e.g Fyber). For these, Sdkbox plugin will use INTERSTITIAL, REWARDED, VIDEO or BANNER to refer to the expected ad type to be played by the AdUnit.

Default AdUnit

SdkboxAds defines a default AdUnit. It will be the first defined unit in the the plugin's units list.

Integration Guides

For games using Cocos2d-x v3.x

Support Ads List

Sample Project