Unity Ad Formats

Banners Interstitials Rewarded Ads

Banner Ads

After creating placements in the DT Console, add the following code snippets in the chosen context of your app. Access the Placement ID by using the copy button next to the placement name. For more information about creating placements in the DT Console, read here.

Screen

Banners are rectangle ads appearing either at the top or bottom of the screen when the user interacts with your app. The user can view them but cannot dismiss them. Banners are automatically refreshed by the DT FairBid SDK after a specified period of time.

The DT FairBid SDK refreshes banners automatically. To avoid discrepancies with DT's and 3rd-party network's reporting, any automatic or manual banner refresh settings on 3rd-party network SDKs must be disabled.

Showing a Banner

Implement the code below to show a Banner

string placementId = "1234";
Banner.Show(placementId);

Providing Banner Position

You can show your banner at the top or bottom of your screen. By default, the banner will be placed at the bottom of the screen.
If you want to change this behavior, use the following code:

string placementId = "1234";
BannerOptions bannerOptions = new BannerOptions();
bannerOptions.DisplayAtTheTop();
Banner.Show(placementId, bannerOptions);

Hiding the Banner

If you want to hide the banner temporarily, implement the code below:

string placementId = "1234";
Banner.Hide(placementId);

Destroying the Banner

Once you have decided that you no longer want to use the banner you can remove it entirely:

string placementId = "1234";
Banner.Destroy(placementId);

Adding Callbacks

The callback code below is required for the SDK to properly track the activity of your ad:

public class MyBannerListener : BannerListener
{
    public void OnError(string placementId, string error)
    {
        // Called when an error from placement 'placementId' arises when loading an ad
    }

    public void OnLoad(string placementId)
    {
        // Called when an ad from placement 'placementId' is loaded
    }

    public void OnShow(string placementId, ImpressionData impressionData)
    {
        // Called when banner from placement 'placementId' shows up
    }
    public void OnClick(string placementId)
    {
        // Called when banner from placement 'placementId' is clicked
    }
  
    public void OnRequestStart(string placementId)
    {
        // Called when a banner from placement 'placementId' is going to be requested
    }
}


Banner.SetBannerListener(new MyBannerListener());

Back to Top ⇧