Native Ads

Native ads are video or interactive ads that appear within the context of the user experience, such as in-feed sponsored content.

Building the Ad Placement (Ad Spot)

Add the required controllers to set up the ad placement:

Java
// Spot integration for native ad
InneractiveAdSpot mSpot = InneractiveAdSpotManager.get().createSpot();

// Adding the native controller
NativeAdUnitController adUnitController = new NativeAdUnitController();

// Adding the native video controller
NativeAdVideoContentController nativeAdVideoContentController = new NativeAdVideoContentController();

// Adding the native video controller to the ad unit controller
adUnitController.addContentController(nativeAdVideoContentController);
mSpot.addUnitController(adUnitController);

Adding Listeners

Add listeners for the controller and the spot.

Adding Event Listener for the Controller

The examples below demonstrate how you would add an EventListener to receive native ad callbacks.

Events:

Video Events:

Adding Request Listener for the Spot

The example below demonstrates how you would add a RequestListener for the Spot:

Fetching the Ad

Native ads are only available through SDK Bidding mediation. In SDK Bidding, DT Exchange must first generate a token for the Mediation SDK to use when identifying the request to the server.

Use getBidderToken to generate a Bidder Token in a background thread:

Return type: java.lang.String. If an error occurs, the returned value is null.

If DT Exchange wins the auction, load the ad with the signaldata (adm) that was received from the server:

Displaying the Ad

Define the ad layout in your XML file:

Use populateNativeAdLayout to create the Native layout:

For a list of supported Native Ads asset types, see the oRTB Specification for Native Ads.

Use registerViewsForInteraction to enable user interaction with the Native ad and register tracking events:

Releasing an Ad Placement

DT recommends releasing the allocated resources for ad display. For more information, see Releasing Ad Instance Resources.

Last updated