타겟팅 설정
curl --request POST \
--url https://api-v2.adrop.io/property \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"uid": "<string>",
"value": "<string>",
"platform": "<string>",
"adid": "<string>"
}
'import requests
url = "https://api-v2.adrop.io/property"
payload = {
"uid": "<string>",
"value": "<string>",
"platform": "<string>",
"adid": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({uid: '<string>', value: '<string>', platform: '<string>', adid: '<string>'})
};
fetch('https://api-v2.adrop.io/property', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.adrop.io/property",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uid' => '<string>',
'value' => '<string>',
'platform' => '<string>',
'adid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.adrop.io/property"
payload := strings.NewReader("{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-v2.adrop.io/property")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.adrop.io/property")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "OK"
}
REST API
타겟팅 설정
REST API에서 사용자 속성 및 문맥 타겟팅을 설정하는 방법을 안내합니다.
POST
/
property
타겟팅 설정
curl --request POST \
--url https://api-v2.adrop.io/property \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"uid": "<string>",
"value": "<string>",
"platform": "<string>",
"adid": "<string>"
}
'import requests
url = "https://api-v2.adrop.io/property"
payload = {
"uid": "<string>",
"value": "<string>",
"platform": "<string>",
"adid": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({uid: '<string>', value: '<string>', platform: '<string>', adid: '<string>'})
};
fetch('https://api-v2.adrop.io/property', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.adrop.io/property",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'uid' => '<string>',
'value' => '<string>',
'platform' => '<string>',
'adid' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.adrop.io/property"
payload := strings.NewReader("{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-v2.adrop.io/property")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.adrop.io/property")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"uid\": \"<string>\",\n \"value\": \"<string>\",\n \"platform\": \"<string>\",\n \"adid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"msg": "OK"
}
타겟팅을 사용하면 특정 사용자 그룹이나 문맥에 맞는 광고를 노출할 수 있습니다. REST API에서는 오디언스 타겟팅과 문맥 타겟팅을 모두 지원합니다.
오디언스 타겟팅
사용자 속성을 기반으로 광고를 타겟팅합니다.요청 파라미터
App Key (adrop_service.json에서 확인)
application/json사용자 고유 식별자
속성 데이터 (JSON 문자열). 프리셋 및 커스텀 속성 포함
플랫폼. 예:
web, android, ios광고 식별자 (ADID/IDFA)
응답
응답 코드.
0은 성공응답 메시지
{
"code": 0,
"msg": "OK"
}
프리셋 속성
Adrop에서 미리 정의한 표준 속성입니다. 모든 SDK와 REST API에서 동일한 형식을 사용합니다.생년월일 (BIRTH)
| 키 | 값 예시 | 형식 |
|---|---|---|
BIRTH | 2024 | yyyy (연도만) |
BIRTH | 202401 | yyyyMM (연월) |
BIRTH | 20240101 | yyyyMMdd (전체 날짜) |
성별 (GDR)
| 키 | 값 | 의미 |
|---|---|---|
GDR | M | 남성 (Male) |
GDR | F | 여성 (Female) |
GDR | U | 알 수 없음 (Unknown) |
알 수 없음 값
| 키 | 값 | 설명 |
|---|---|---|
* | U | 모든 속성에서 “알 수 없음”을 나타낼 때 사용 |
프리셋 속성 키는 대문자를 사용합니다:
BIRTH, GDR커스텀 속성
콘솔에서 정의한 커스텀 속성을 사용할 수 있습니다.커스텀 속성 설정
- Adrop 콘솔에서 타겟팅 메뉴로 이동
- 오디언스 타겟팅 탭에서 커스텀 속성 생성
- API에서 해당 키-값으로 속성 전송
const properties = {
// 프리셋 속성
BIRTH: '19931225',
GDR: 'M',
// 커스텀 속성 (콘솔에서 정의)
membership: 'premium',
lastPurchaseDate: '2024-01-15',
favoriteCategory: 'electronics'
};
커스텀 속성의 모든 값은 문자열(STRING) 타입입니다.
문맥 타겟팅
페이지나 콘텐츠의 문맥에 따라 광고를 타겟팅합니다. 광고 요청 시contextId 파라미터를 추가합니다.
문맥 타겟팅 설정
- Adrop 콘솔에서 타겟팅 메뉴로 이동
- 문맥 타겟팅 탭에서 문맥 생성
- 광고 요청 시
contextId파라미터 사용
광고 요청 시 문맥 적용
GET https://api-v2.adrop.io/request?unit=YOUR_UNIT_ID&contextId=sport
const axios = require('axios');
const config = {
method: 'get',
baseURL: 'https://api-v2.adrop.io',
url: '/request',
params: {
unit: 'YOUR_UNIT_ID',
uid: 'USER_ID',
pf: 'web',
contextId: 'sport' // 콘솔에서 생성한 Context ID
},
headers: {
'Authorization': 'YOUR_APP_KEY'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
url = "https://api-v2.adrop.io/request"
params = {
"unit": "YOUR_UNIT_ID",
"uid": "USER_ID",
"pf": "web",
"contextId": "sport"
}
headers = {
"Authorization": "YOUR_APP_KEY"
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
curl -X GET "https://api-v2.adrop.io/request?unit=YOUR_UNIT_ID&uid=USER_ID&pf=web&contextId=sport" \
-H "Authorization: YOUR_APP_KEY"
모범 사례
사용자 ID 일관성
동일한 사용자에게는 항상 같은
uid를 사용하세요. 일관된 ID는 정확한 타겟팅의 핵심입니다.속성 업데이트
사용자 정보가 변경되면 즉시
/property 엔드포인트를 호출하여 업데이트하세요.프리셋 형식 준수
BIRTH와 GDR 속성은 정해진 형식을 정확히 사용해야 합니다.문맥 활용
뉴스, 스포츠, 쇼핑 등 페이지 성격에 맞는 문맥 타겟팅을 활용하세요.
관련 문서
오디언스 타겟팅
콘솔에서 오디언스 타겟팅 설정
문맥 타겟팅
콘솔에서 문맥 타겟팅 설정
이 페이지가 도움이 되었나요?
⌘I