Implementation Methods
Native ads allow you to display ads with custom UI that matches your app’s design.Use the test unit ID in development:
PUBLIC_TEST_UNIT_ID_NATIVEDefault Template
You can use the default template in the same way as banner ads. Images and text are automatically rendered in the SDK-provided template.The default template does not support advertiser profile sections. Use custom UI to display advertiser profiles.
Custom UI
Data Attributes Method
Add thedata-adrop-render="custom" attribute and bind fields using data-adrop-native attributes on inner elements.
Data Attributes
string
required
Unit ID created in Ad Control Console
string
required
Set to
custom for custom UIstring
Context ID for contextual targeting
string
default:"light"
Theme setting (
light or dark)boolean
default:false
Enable entire area click
false: Only text/images are clickable, clicking advertiser profile goes to profile linktrue: Entire container is clickable, all clicks go to ad destination
boolean
default:false
Enable custom click handling - When
true, SDK will not automatically navigate to the destination URL on click, only emit adClicked event. Allows developers to implement custom click behavior.string
Advertising identifier — required for the View on Device feature to preview a draft creative on a registered test device. Do not hard-code in production.
renderAd Method
Use this when you want direct control over ad loading timing.renderAd Options
string
required
Unit ID created in Ad Control Console
string
User identifier (used to override SDK-level setting for individual placements)
string
Context ID for contextual targeting
number
required
Set to
1 for custom UIboolean
default:false
Enable entire area click
string
default:"light"
Theme setting (
light or dark)boolean
default:false
Enable custom click handling - When
true, SDK will not automatically navigate to the destination URL on click, only emit adClicked event with destination URL. Allows developers to implement custom click behavior.string
Advertising identifier — required for the View on Device feature to preview a draft creative on a registered test device. Do not hard-code in production.
Field Binding
Bind ad data to UI elements using thedata-adrop-native attribute.
extra.{key} is the ID of extra text items set in Ad Control Console. It may be empty if not set as required.To display advertiser profile (
profile.displayLogo, profile.displayName), you must enable Show Advertiser Profile for that ad unit in Ad Control Console.Ad Size
Custom UI size can be set freely.Backfill ads request creatives matching the container size. Specify an appropriate size.
Fetching Data Only with requestAd
If you want complete control over the UI, you can fetch only the ad data usingrequestAd.
AdropAdResponse
Return value ofrequestAd().
AdData
Ad data object. Event handlers also receive the same structure. See Reference > AdData for the complete interface definition.Event Handling
Supported Events
Custom Click Handling
WhenuseCustomClick is enabled, the SDK will not automatically navigate to the destination URL. Instead, you can handle the click event and implement custom behavior.
With custom click handling enabled, you have full control over what happens when users click the ad. The
destinationURL is provided in the adClicked event data.