Skip to main content

Ad Request Information

Creating AdParam

When making ad requests for each ad type, you need to create an AdParam object containing the necessary information for the ad request. Detailed targeting and reporting can be applied through the items set in customParam.

val adParam = AdParam.Builder()
// . . .
.setAdUnitId("AOS_TEST_BANNER") // Ad Unit ID
.setCurrentPageUrl("https://www.naver.com") // Description link for the current page
.setRefererPageUrl("https://www.naver.com") // Referer information
.addCustomParam("channelId", "41312") // Targeting settings and report support via GFP Admin
.build()

Parameter

Descriptions of each parameter in AdParam used for ad requests.

The term S2S below refers to Server to Server, which is the advertising provider integration method provided by NAM through the NDA module.

Ad Unit ID (required)

A required parameter corresponding to the Ad Unit ID.

Current Page URL (optional)

The URL of the page representing the current screen. This value is used as a targeting parameter for S2S ad requests.

RefererPageUrl (optional)

A targeting parameter used for S2S ad requests.

Custom Parameter (optional)

A parameter used in DFP and S2S for detailed targeting and reporting. The key and value should be confirmed and coordinated with the NAM representative. You can assign it to setCustomParam() using a Map<String, String> collection or use addCustomParam(String, String) to assign multiple keywords. If you need to pass multiple values for a single key, separate them with |. For detailed examples, refer to the DFP manual.

Video Parameters

Separate parameters are required for video ad (InStream Video Ad) requests. For more details, refer to Video Ads.


Global Settings of the SDK

In addition to the AdParam set for each ad request, common settings can be configured through SdkProperties for SDK-related settings and UserProperties for user-related targeting settings.

SDK Settings

GfpSdk.setSdkProperties(GfpSdk.getSdkProperties().buildUpon()
.addProviderOptions(DfpProviderOptions.Builder().setTestMode(false).build())
.addProviderOptions(FanProviderOptions.Builder().setTestMode(false).build())
.addProviderOptions(NdaProviderOptions.Builder().setTheme(ResolvedTheme.SYSTEM).build())
.addProviderOptions(UnityProviderOptions.Builder().setTestMode(false).build())
.bannerAdRequestTimeout(60_000L)
.unifiedAdRequestTimeout(60_000L)
.videoAdRequestTimeout(60_000L)
.interstitialAdRequestTimeout(60_000L)
.rewardedAdRequestTimeout(60_000L)
.muteAudio(true)
.build())
)

Test Options

Some DSPs may require TestMode settings to receive test ads (e.g., DFP, FAN, NDA, Unity). If not set, the TestMode for each ad provider defaults to Off.

Ad Request Timeout

The following is a list of APIs related to ad request timeouts. The long value passed during configuration must be a positive millis value. By default, 60 seconds is set.

NameDescription
bannerAdRequestTimeout(long)Sets the timeout value for banner ads (GfpBannerAdView).
videoAdRequestTimeout(long)Sets the timeout value for video ads.
unifiedAdRequestTimeout(long)Sets the timeout value for ads called through the ad loader (GfpAdLoader).
rewardedAdRequestTimeout(long)Sets the timeout value for rewarded ads (GfpRewardedAdManager).
interstitialAdRequestTimeout(long)Sets the timeout value for interstitial ads (GfpInterstitialAdManager).

Mute

Provides a mute option for video materials in rewarded ads. However, this option is not used for In-Stream ads.

User Targeting

GfpSdk.getUserProperties().clearCustomParameter()

GfpSdk.setUserProperties(GfpSdk.getUserProperties().buildUpon()
// .id() A media-side user identifier value that can be used for ad log tracking
.yob(1987)
.country("KR")
.language("KO")
.gender(GenderType.MALE)
.addCustomParam("aaa", "bbb")
.setCustomParam(mapOf("k1" to "v1", "k2" to "v2"))
.setContentId("test content")
.build())
PropertyDescription
gender()Sets the user's gender value. If not set, the default value is null. If the gender is indeterminable, set it to GenderType.UNKNOWN.
yob()Sets the user's year of birth. If not set, the default value is null.
country()Sets the user's country value. If not set, the default value is null. This value is rarely used and is typically for DSP purposes.
language()Sets the user's language value. Use this if there is a language value set by the service that differs from the device's language setting. If not set, the default value is null. Use ISO 639-1 codes. This value is rarely used.
id()Sets a media-side user identifier value that can be used for SDK log tracking.
customParameter()A globally used custom parameter (from 6.0.0).
childDirectedTreatment(Boolean)Indicates whether the page or app should be treated as child-directed under the Children's Online Privacy Protection Act (COPPA) (from 6.1.0). If unknown or unnecessary, do not set.
underAgeOfConsent(Boolean)Indicates whether ad requests are for users under the age of consent (from 6.1.0). If unknown or unnecessary, do not set.
contentId(String)Sets the Content ID provided by the Naver Login API (from 7.6.2). If the Naver Login API is not used, do not set this. Please consult with the NAM representative if needed.
info

Starting from NAM SDK 6.0.0, UserProperties.customParameter is a globally used custom parameter that can be merged with AdParam.customParameter used for individual ad requests.