We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesAds KitAndroid-JavaScriptKey Methodsppsads.createNativeAd(object)

ppsads.createNativeAd(object)

Overview

Creates a NativeAd object.

Parameters

Expand

Parameter

Mandatory

Type

Description

slotId

Yes

String

Ad unit ID. If this parameter is left empty or its value is null, the ad object created using ppsads.createNativeAd is a null object.

type

No

number

Ad type.

  • NATIVE: common in-feed ad.
  • ICON: app icon ad.

The default value is NATIVE. For details, please refer to AdType.

deviceType

No

number

Device type.

  • PHONE: phone.
  • TABLET: tablet.

The default value is PHONE. For details, please refer to DeviceType.

creativeTypes

No

array

Detailed creative types. This parameter is valid only when the value of type is NATIVE.

For details about parameter values, please refer to Mapping Between DetailedCreativeType and CreativeType.

mediaAspect

No

number

Aspect ratio of the image asset to be returned. For details about parameter values, please refer to MediaAspect.

mediaDirection

No

number

Orientation of the image asset to be returned. For details about parameter values, please refer to MediaDirection.

width

No

number

Ad width, in pixels. This parameter is used together with mediaAspect.

This parameter is valid only when the value of mediaAspect is ASPECT_CUSTOM_SIZE. The value can be an ad width or -1.

height

No

number

Ad height, in pixels. This parameter is used together with mediaAspect.

This parameter is valid only when the value of mediaAspect is ASPECT_CUSTOM_SIZE. The value can be an ad height or -2.

Values of width and height

Expand

width

height

Description

-1

-2

Smart ad dimensions.

The page width and an adaptive height will be used.

  • Page height > 720 px: The ad height is 90 px.
  • 400 px < Page height ≤ 720 px: The ad height is 50 px.
  • In other cases, the ad height is 32 px.

number

number

Customized ad dimensions.

Search in References
Enter a keyword.