타겟팅 설정을 통해 특정 사용자 그룹에게 맞춤 광고를 노출할 수 있습니다. Adrop SDK는 오디언스 타겟팅 방식을 제공합니다.
오디언스 타겟팅 : 사용자의 속성(프로퍼티)을 기반으로 광고를 노출합니다.
타겟팅 데이터를 수집하려면 광고 로드 전에 프로퍼티를 설정해야 합니다.
UID 설정 (선택 사항)
사용자 식별자(UID)를 설정하여 크로스 플랫폼 간 타겟팅 데이터를 공유할 수 있습니다. UID 설정은 선택 사항입니다.
사용법
import { Adrop } from 'adrop-ads-react-native'
// 사용자 로그인 후 (선택 사항)
Adrop . setUID ( "user_123" )
// 사용자 로그아웃 시
Adrop . setUID ( "" )
파라미터
파라미터 타입 설명 uidstring사용자 고유 식별자 (예: 서비스 회원 ID)
UID는 SHA-256으로 해시되어 전송됩니다. 개인정보(이메일, 전화번호 등)를 직접 전달하지 마세요.
로그아웃 시 빈 문자열("")을 전달하여 UID를 초기화하세요.
오디언스 타겟팅
사용자의 속성 정보(프로퍼티)를 수집하여 특정 사용자 그룹에게 광고를 노출합니다.
프로퍼티 설정
AdropMetrics.setProperty() 메서드를 사용하여 사용자의 속성 정보를 수집합니다.
import { AdropMetrics } from 'adrop-ads-react-native'
// 문자열 프로퍼티
AdropMetrics . setProperty ( "membership_level" , "premium" )
// 숫자 프로퍼티
AdropMetrics . setProperty ( "booking_count" , 15 )
// 불린 프로퍼티
AdropMetrics . setProperty ( "is_subscriber" , true )
// null 전달 (프로퍼티 제거)
AdropMetrics . setProperty ( "membership_level" , null )
파라미터
파라미터 타입 설명 keystring프로퍼티 키 (최대 64자) valueany프로퍼티 값 (string, number, boolean, null)
프로퍼티 키는 최대 64자까지 가능합니다.
문자열 값은 최대 256자까지 가능합니다.
숫자 값은 최대 9007199254740991까지 가능합니다.
최대 256개의 프로퍼티를 설정할 수 있습니다.
기본 프로퍼티
Adrop SDK는 타겟팅을 위한 기본 프로퍼티를 제공합니다. AdropProperties와 AdropGender enum을 사용하여 값을 설정합니다.
나이 (생일)
생일 정보를 전달하면 자동으로 나이가 계산됩니다.
import { AdropMetrics } from 'adrop-ads-react-native'
import { AdropProperties } from 'adrop-ads-react-native'
// 연도만 (yyyy)
AdropMetrics . setProperty ( AdropProperties . BIRTH , "1990" )
// 연월 (yyyyMM)
AdropMetrics . setProperty ( AdropProperties . BIRTH , "199003" )
// 연월일 (yyyyMMdd)
AdropMetrics . setProperty ( AdropProperties . BIRTH , "19900315" )
날짜 포맷
포맷 예시 설명 yyyy”1990” 연도만 yyyyMM”199003” 연월 yyyyMMdd”19900315” 연월일
import { AdropMetrics } from 'adrop-ads-react-native'
import { AdropProperties , AdropGender } from 'adrop-ads-react-native'
// 남성
AdropMetrics . setProperty ( AdropProperties . GENDER , AdropGender . MALE )
// 여성
AdropMetrics . setProperty ( AdropProperties . GENDER , AdropGender . FEMALE )
// 그 외
AdropMetrics . setProperty ( AdropProperties . GENDER , AdropGender . OTHER )
// 미확인
AdropMetrics . setProperty ( AdropProperties . GENDER , AdropGender . UNKNOWN )
성별 값 상수
상수 값 설명 AdropGender.MALE"M"남성 AdropGender.FEMALE"F"여성 AdropGender.OTHER"O"그 외 AdropGender.UNKNOWN"U"미확인
나이 직접 설정
생일 대신 나이를 직접 설정할 수도 있습니다.
import { AdropMetrics } from 'adrop-ads-react-native'
import { AdropProperties } from 'adrop-ads-react-native'
AdropMetrics . setProperty ( AdropProperties . AGE , 30 )
BIRTH와 AGE 중 하나만 설정하면 됩니다. 둘 다 설정된 경우 BIRTH가 우선됩니다.
커스텀 프로퍼티
서비스에 맞는 커스텀 프로퍼티를 설정할 수 있습니다. 커스텀 프로퍼티는 애드컨트롤 콘솔 의 타겟팅 메뉴에서 먼저 정의해야 합니다.
import { AdropMetrics } from 'adrop-ads-react-native'
// 로컬 액티비티 앱 예시
AdropMetrics . setProperty ( "region" , "Seoul" )
AdropMetrics . setProperty ( "booking_count" , 5 )
// 쇼핑몰 앱 예시
AdropMetrics . setProperty ( "membership_tier" , "gold" )
AdropMetrics . setProperty ( "total_purchase_amount" , 1500000 )
// 미디어 앱 예시
AdropMetrics . setProperty ( "favorite_genre" , "drama" )
AdropMetrics . setProperty ( "is_premium_subscriber" , true )
커스텀 프로퍼티 이름은 콘솔에서 정의한 이름과 정확히 일치해야 합니다. 대소문자를 구분합니다.
프로퍼티 사용 예시
사용자가 앱에 로그인할 때 프로퍼티를 설정하는 예시입니다.
import React , { useEffect } from 'react'
import { AdropMetrics } from 'adrop-ads-react-native'
import { AdropProperties , AdropGender } from 'adrop-ads-react-native'
const ProfileScreen = () => {
useEffect (() => {
// 사용자 정보 가져오기
const user = getUserInfo ()
// 기본 프로퍼티 설정
AdropMetrics . setProperty ( AdropProperties . BIRTH , user . birthDate )
AdropMetrics . setProperty ( AdropProperties . GENDER , user . gender )
// 커스텀 프로퍼티 설정
AdropMetrics . setProperty ( "membership_level" , user . membershipLevel )
AdropMetrics . setProperty ( "total_booking_count" , user . bookingCount )
}, [])
return (
// 화면 컴포넌트
)
}
export default ProfileScreen
이벤트 트래킹
사용자 행동 이벤트를 추적하여 사용자 활동 기반의 오디언스를 구축할 수 있습니다. AdropMetrics.sendEvent()를 사용하여 이벤트를 전송합니다.
logEvent()는 deprecated되었습니다. sendEvent()를 사용하세요.
이벤트 전송
import { AdropMetrics } from 'adrop-ads-react-native'
// 단순 이벤트 (파라미터 없음)
AdropMetrics . sendEvent ( 'app_open' )
// 파라미터가 있는 이벤트
AdropMetrics . sendEvent ( 'view_item' , {
item_id: 'SKU-123' ,
item_name: 'Widget' ,
item_category: 'Electronics' ,
brand: 'BrandX' ,
price: 29900 ,
})
다중 아이템 이벤트
여러 아이템이 포함된 이벤트(예: purchase, begin_checkout)의 경우, 파라미터에 items 배열을 전달합니다.
import { AdropMetrics } from 'adrop-ads-react-native'
AdropMetrics . sendEvent ( 'purchase' , {
tx_id: 'TXN-20240101-001' ,
currency: 'KRW' ,
items: [
{
item_id: 'SKU-001' ,
item_name: '상품A' ,
item_category: 'Electronics' ,
brand: 'BrandX' ,
price: 29900 ,
quantity: 1 ,
},
{
item_id: 'SKU-002' ,
item_name: '상품B' ,
price: 15000 ,
quantity: 2 ,
},
],
})
지원되는 이벤트 예시
이벤트 이름 설명 주요 파라미터 app_open앱 열기 — sign_up회원가입 methodpush_clicks푸시 알림 클릭 campaign_idpage_view페이지 조회 page_id, page_category, page_urlclick요소 클릭 element_id, element_type, target_urlview_item아이템 조회 item_id, item_name, item_category, brand, priceview_content콘텐츠 조회 content_id, content_name, content_typeadd_to_wishlist위시리스트 추가 item_id, item_name, item_category, brand, priceadd_to_cart장바구니 추가 item_id, item_name, item_category, brand, price, quantity, value, currencybegin_lead_form리드 폼 시작 form_id, form_name, form_type, form_destinationgenerate_lead리드 생성 form_id, form_name, form_type, form_destination, value, currencybegin_checkout결제 시작 currency, itemspurchase구매 완료 tx_id, currency, items
이벤트 이름은 1~64자여야 합니다.
파라미터 키는 1~64자여야 합니다.
문자열 파라미터 값은 최대 1024자까지 가능합니다.
모범 사례
1. 프로퍼티 설정
// ✅ 올바른 예시
AdropMetrics . setProperty ( "membership_level" , "premium" )
// 광고 로드...
// ❌ 잘못된 예시
// 광고 로드...
AdropMetrics . setProperty ( "membership_level" , "premium" ) // 광고 로드 후 설정하면 타겟팅이 적용되지 않음
2. 프로퍼티는 변경될 때마다 업데이트
import { AdropMetrics } from 'adrop-ads-react-native'
const App = () => {
useEffect (() => {
// 앱 시작 시 초기 프로퍼티 설정
updateUserProperties ()
}, [])
const onUserPurchaseComplete = ( purchaseAmount : number ) => {
// 구매 완료 시 프로퍼티 업데이트
const currentTotal = getCurrentTotalPurchase ()
AdropMetrics . setProperty ( "total_purchase_amount" , currentTotal + purchaseAmount )
}
const onMembershipUpgrade = ( newTier : string ) => {
// 멤버십 업그레이드 시 프로퍼티 업데이트
AdropMetrics . setProperty ( "membership_tier" , newTier )
}
// ...
}
3. 프로퍼티 초기화
import { AdropMetrics } from 'adrop-ads-react-native'
const onUserLogout = () => {
// 프로퍼티 초기화
AdropMetrics . setProperty ( "membership_level" , null )
AdropMetrics . setProperty ( "total_booking_count" , null )
}
관련 문서
FAQ
UID를 설정하지 않으면 타겟팅 광고가 노출되지 않나요?
UID 설정은 선택 사항입니다. UID를 설정하지 않아도 프로퍼티 기반 타겟팅은 정상적으로 동작합니다. UID는 크로스 플랫폼 간 타겟팅 데이터를 공유할 때 유용합니다.
프로퍼티를 설정했는데 콘솔에서 데이터가 보이지 않아요.
프로퍼티 데이터는 수집 후 최대 24시간 내에 콘솔에 반영됩니다. 데이터가 표시되지 않는 경우:
콘솔에서 프로퍼티가 올바르게 정의되었는지 확인하세요.
SDK에서 전달하는 프로퍼티 키가 콘솔과 정확히 일치하는지 확인하세요 (대소문자 구분).
AdropMetrics.setProperty()가 광고 로드 전에 호출되는지 확인하세요.
프로퍼티 값에 null을 전달하면 해당 프로퍼티가 삭제됩니다: AdropMetrics . setProperty ( "membership_level" , null )
React Native SDK에서는 배열 타입은 현재 직접 지원하지 않습니다. 필요한 경우 문자열로 변환하여 전달하거나, 여러 개의 개별 프로퍼티로 나누어 설정하세요.