Ad Parameters
GFPUserParam
Use GFPUserParam to improve user targeting (optional).
GFPUserParam is set globally, unlike GFPAdParam which is set per ad request.
GFPUserParam.h
- yearOfBirth
- gender
- userCountryCode
- userID
- contentId (contentId taken from Login in with Naver api)
- Objective-C
- Swift
GFPUserParam *userParam;
GFPUserParam *userParam;
if (GFPAdManager.userParam != nil) {
userParam = GFPAdManager.userParam;
} else {
userParam = [[GFPUserParam alloc] init];
}
userParam.gender = GFPUserParamGenderTypeFemale;
userParam.yearOfBirth = 1995;
userParam.userCountryCode = @"KR";
userParam.userID = @"abcd";
userParam.contentId = @"my-content-id";
[GFPAdManager setUserParam: userParam];
let userParam = GFPAdManager.userParam() ?? GFPUserParam()
userParam.gender = .female
userParam.yearOfBirth = 1995
userParam.userCountryCode = "KR"
userParam.userID = "abcd"
userParam.contentId = "my-content-id"
GFPAdManager.setUserParam(userParam)
Year of Birth
(optional) is an integer value.
- Objective-C
- Swift
GFPUserParam * userParam = [[GFPUserParam alloc] init];
...
userParam.yearOfBirth = 1995;
...
let userParam = GFPUserParam()
...
userParam.yearOfBirth = 1995
...
Country
(optional) See more information on ISO 3166-1 alpha-2.
- Objective-C
- Swift
GFPUserParam * userParam = [[GFPUserParam alloc] init];
...
userParam.userCountryCode = @"KO";
...
let userParam = GFPUserParam()
...
userParam.userCountryCode = "KO"
...
Gender
(optional) set GFPUserParamGenderType
- Objective-C
- Swift
typedef NS_ENUM(NSInteger, GFPUserParamGenderType) {
GFPUserParamGenderTypeMale = 1,
GFPUserParamGenderTypeFemale = 2,
GFPUserParamGenderTypeOther = 3,
};
GFPUserParam *userParam = [[GFPUserParam alloc] init];
...
userParam = GFPUserParamGenderTypeFemale;
...
typedef NS_ENUM(NSInteger, GFPUserParamGenderType) {
GFPUserParamGenderTypeMale = 1,
GFPUserParamGenderTypeFemale = 2,
GFPUserParamGenderTypeOther = 3,
};
let userParam = GFPUserParam()
...
userParam = .female
...
User ID
(optional) is user identifier within your app.
- Objective-C
- Swift
GFPUserParam * userParam = [[GFPUserParam alloc] init];
...
userParam.userID = @"abcd";
...
let userParam = GFPUserParam()
...
userParam.userID = "abcd"
...
GFPAdParam
Use GFPAdParam to pass some parameters on every ad request (optional).
For example, you can use GFPAdParam in monitoring reports on GFP dashboard, set serveral ad options or deliver parameters from PrebidMobile and Amazon Publisher Services(APS) header bidding.
Some Parameters in GFPAdParam.h
- currentPageUrl
- keywords : content keywords.
- referrerPageUrl
- opt-out : (0: unset, 1: set) (deprecated.)
- customUserParam
- prebidHBParam
- apsParam
- contentInfo : special parameters for Communication Ad.
- Objective-C
- Swift
GFPAdParam *adParam = [[GFPAdParam alloc] init];
adParam.keywords = @[@"KWD_1", @"KWD_2"];
adParam.currentPageUrl = @"https://naver.com";
adParam.customUserParam = @{@"key1": @"value1"};
let adParam = GFPAdParam()
adParam.keywords = ["KWD_1", "KWD_2"]
adParam.currentPageUrl = "https://naver.com"
adParam.customUserParam = ["key1":"value1"]
Current Page URL
(optional) Current page's url is sent to ad networks for user targeting.
- Objective-C
- Swift
GFPAdParam *adParam = [[GFPAdParam alloc] init];
...
adParam.currentPageUrl = @"https://naver.com";
...
let adParam = GFPAdParam()
...
adParam.currentPageUrl = "https://naver.com"
...
Keyword
(optional) Array of string keywords is sent to ad networks for user targeting.
- Objective-C
- Swift
GFPAdParam *adParam = [[GFPAdParam alloc] init];
...
adParam.keywords = @[@"KWD_1", @"KWD_2"];
...
let adParam = GFPAdParam()
...
adParam.keywords = ["KWD_1", "KWD_2"]
...
Custom User Parameter
(optional) Custom User Parameter is used only for GFP dashboard, for targeting and monitoring.
-
For dictionary values that must contain mutiple values should separate them with “|” letter (not array of strings).
-
Use Global Custom Parameter Settings for global Custom Parameter settings. Beminded that GFPAdParam's customParam is used over Global Custom Param, if set.
- Objective-C
- Swift
GFPAdParam *adParam = [[GFPAdParam alloc] init];
...
adParam.customUserParam = @{@"key1": @"value1", @"key2":@"a|b|c", @"language":@"ko"};
...
let adParam = GFPAdParam()
...
adParam.customUserParam = ["key1":"value1", "key2":"a|b|c", "language":"ko"]
...
Header Bidding Parameter
(optional) Pass Prebid Mobile and Amazon Publisher Services(APS) header bidding parameters to GFP network with these parameters.
- prebidHBParam
Dictionary<String, String>
- apsParam (see
GFPAPSAdParam.h
) crid, size, apsHBParam
See more information about setting header bidding parameters on Banner HB
Ad Call Query
Manually set ad request url with GFPAdParam adCallQueryWith:
which bypasses GFP SDK's ad request process.
See more information on Bypassing Ad Waterfall.
- Objective-C
- Swift
GFPAdParam *adParam = [[GFPAdParam alloc] init];
...
NSString *query = [adParam adCallQueryWith:@"adUnitId"];
...
let adParam = GFPAdParam()
...
let query = adParam.adCallQuery(with: "adUnitId")
...