This guide explains how to provider targeting information to an ad request.
Complete the Get Started guide
SdkProperties
is an object that collects targeting information related to sdk, such as request timeout by ad format or option by ad provider to be applied globally via a GfpSdk
static method.
To update the sdk properties, obtain a builder from the existing configuration, perform any desired updates, and set it as follows:
SdkProperties sdkProperties = GfpSdk.getSdkProperties()
.buildUpon()
...
.build();
GfpSdk.setSdkProperties(sdkProperties);
Timeout from requesting to responding to Banner Ad loaded via GfpBannerAdView
.
SdkProperties sdkProperties = GfpSdk.getSdkProperties()
.buildUpon()
.bannerAdRequestTimeout(30_000L)
.build();
GfpSdk.setSdkProperties(sdkProperties);
Note: Default value is
60_000ms
.
Timeout from requesting to responding to Banner Ad loaded via GfpAdLoader
.
SdkProperties sdkProperties = GfpSdk.getSdkProperties()
.buildUpon()
.unifiedAdRequestTimeout(30_000L)
.build();
GfpSdk.setSdkProperties(sdkProperties);
Note: Default value is
60_000ms
.
Timeout from requesting to responding to Banner Ad loaded via GfpRewardedAdManager
.
SdkProperties sdkProperties = GfpSdk.getSdkProperties()
.buildUpon()
.rewardedAdRequestTimeout(30_000L)
.build();
GfpSdk.setSdkProperties(sdkProperties);
Note: Default value is
60_000ms
.
Timeout from requesting to responding to Banner Ad loaded via GfpInterstitialAdManager
.
SdkProperties sdkProperties = GfpSdk.getSdkProperties()
.buildUpon()
.interstitialAdRequestTimeout(30_000L)
.build();
GfpSdk.setSdkProperties(sdkProperties);
Note: Default value is
60_000ms
.
UserProperties
is an object that collects targeting information related to user, such as gender, year of birth, country to be applied globally via a GfpSdk
static method.
To update the sdk properties, obtain a builder from the existing configuration, perform any desired updates, and set it as follows:
UserProperties userProperties = GfpSdk.getUserProperties()
.buildUpon()
...
.build();
GfpSdk.setUserProperties(userProperties);
If you know the gender
information, apply it as below.
UserProperties userProperties = GfpSdk.getUserProperties()
.buildUpon()
.gender(GenderType.FEMALE)
.build();
GfpSdk.setUserProperties(userProperties);
If you know the year of birth
information, apply it as below.
UserProperties userProperties = GfpSdk.getUserProperties()
.buildUpon()
.yob(1990)
.build();
If you know the country
information, apply it as below.
UserProperties userProperties = GfpSdk.getUserProperties()
.buildUpon()
.country("KR")
.build();
Note: set the ISO 3166-1 alpha-2 value.
If you know the language
information, apply it as below.
UserProperties userProperties = GfpSdk.getUserProperties()
.buildUpon()
.language("ko")
.build();
Note: set the ISO 639-1 value.
If you know the user id
information, apply it as below.
This is a key which is used in error log to tracking ad (NAM internally, not used in targeting).
UserProperties userProperties = GfpSdk.getUserProperties()
.buildUpon()
.userId("ADD_USER_ID")
.build();
AdParam
object collects targeting information to be sent with an ad request
You can pass keyword to target Naver Ad Manager through AdParam.Builder.addKeyword()
The keyword will be send to DSP directly(ex. DFP, IMA, InMobi) through their SDK.
For example, please check this manual(from Google Ads)
AdParam adParam = new AdParam.Builder()
.setAdUnitId("YOUR AD UNIT ID")
...
.addKeyword("lo:Y,dh:720")
.build();
You can pass custom key-value pairs to target Naver Ad Manager through AdParam.Builder.addCustomParam()
This is a custom defined targeting.
Please contact with NAM admin first.
It could be used in NAM report, NAM targeting, DSP targeting and so on.
If you want to add multiple values in a single key, please concatenate the values with specific delimiter - '|'.
AdParam adParam = new AdParam.Builder()
.setAdUnitId("YOUR AD UNIT ID")
...
.addCustomParam("foo", "bar")
.addCustomParam("foo1", "bar1|bar2|bar3")
.build();
To provide a content URL for content-targeted ads and brand safety, you can call AdParam.Builder.setCurrentPageUrl()
AdParam adParam = new AdParam.Builder()
.setAdUnitId("YOUR AD UNIT ID")
...
.setCurrentPageUrl("https://www.naver.com")
.build();