Skip to main content

Ad Slot Settings

1. Ad slot settings

When define an ad slot by using gladsdk.defineAdSlot(), the settings for the ad slot can be passed on.

2. Ad slot settings property

adUnitId (required)

Ad unit ID issued for the media when requesting advertisements.

adSlotElementId

Ad container element ID (HTML Element)

Used to identify the ad container and must be defined as a unique identification value within the page.

yob

Year of birth in 4 digits (string)

gender

Gender settings. M(male) | F(female) | O(other)

uct

User country. Use ISO 3166-1 alpha-2.

uid

User ID.

ai

ADID (Android: GAID, iOS: IDFA)

iv

identifierForVendor. Service Vendor ID registered as an identifier that can replace iOS IDFA.

e.g.) Value extracted from com.navercorp in UUID format

contentInfo

Content information for content targeting.

{
"sourceType": "0001",
"sourceSubType": "menu",
"sourceId": "30907206:7"
}

2-1. Custom parameter

  • When define an ad slot by using gladsdk.defineAdSlot(), custom parameters can be used to target ads more granularly.

    window.gladsdk.cmd.push(function () {
    var adSlot = window.gladsdk.defineAdSlot({
    adUnitId: 'adUnitId',
    customParam: {
    category: 'entertainment',
    hobby: ['music', 'sports'],
    },
    });
    });
  • Use gladsdk.setCustomParam() to set custom parameters in an existing ad slot.

    window.gladsdk.cmd.push(function () {
    adSlot.setCustomParam('category', 'entertainment');
    });

2-2. Set custom parameters for all ad slots

  • Use gladsdk.setCustomParam() to apply custom parameters to all ad slots by setting global custom parameters.

    window.gladsdk.cmd.push(function () {
    gladsdk.setCustomParam('category', 'entertainment');
    var adSlot = window.gladsdk.defineAdSlot({
    adUnitId: 'adUnitId',
    });
    // apply 'category: entertainment'
    });
  • If both the global custom parameters and slot custom parameters are applied to the same key, the slot settings take priority.

    window.gladsdk.cmd.push(function () {
    gladsdk.setCustomParam('category', 'entertainment');
    var adSlot = window.gladsdk.defineAdSlot({
    adUnitId: 'adUnitId',
    customParam: {
    category: 'news',
    },
    });
    // apply 'category: news'
    });

3. Setting example

window.gladsdk.cmd.push(function () {
var adSlotInfo = {
adUnitId: 'adUnitId',
adSlotElementId: 'division',
ai: '001bd666-dbc0-4e3c-900f-e2bbb1668c38',
iv: '58F36556-19FD-445B-AF3A-C6D86B15D56C',
yob: '1988',
gender: 'M',
uct: 'KR',
uid: 'user id',
customParam: {
category: 'entertainment',
hobby: ['music', 'sports'],
},
contentInfo: {
sourceType: '0001',
sourceSubType: 'menu',
sourceId: '30907206:7',
},
};

window.gladsdk.defineAdSlot(adSlotInfo);
});