타겟팅 설정을 통해 특정 사용자 그룹에게 맞춤 광고를 노출할 수 있습니다. Adrop SDK는 오디언스 타겟팅 방식을 제공합니다.
오디언스 타겟팅 : 사용자의 속성(프로퍼티)을 기반으로 광고를 노출합니다.
타겟팅 데이터를 수집하려면 광고 로드 전에 UID와 프로퍼티를 설정해야 합니다.
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/src/metrics/AdropMetrics'
// 문자열 프로퍼티
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/src/metrics/AdropMetrics'
import { AdropProperties } from 'adrop-ads-react-native/src/metrics/Property'
// 연도만 (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/src/metrics/AdropMetrics'
import { AdropProperties , AdropGender } from 'adrop-ads-react-native/src/metrics/Property'
// 남성
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/src/metrics/AdropMetrics'
import { AdropProperties } from 'adrop-ads-react-native/src/metrics/Property'
AdropMetrics . setProperty ( AdropProperties . AGE , 30 )
BIRTH와 AGE 중 하나만 설정하면 됩니다. 둘 다 설정된 경우 BIRTH가 우선됩니다.
커스텀 프로퍼티
서비스에 맞는 커스텀 프로퍼티를 설정할 수 있습니다. 커스텀 프로퍼티는 애드컨트롤 콘솔 의 타겟팅 메뉴에서 먼저 정의해야 합니다.
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'
// 로컬 액티비티 앱 예시
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 Adrop from 'adrop-ads-react-native'
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'
import { AdropProperties , AdropGender } from 'adrop-ads-react-native/src/metrics/Property'
const ProfileScreen = () => {
useEffect (() => {
// 사용자 정보 가져오기
const user = getUserInfo ()
// UID 설정
Adrop . setUID ( user . id )
// 기본 프로퍼티 설정
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
베스트 프랙티스
1. UID는 광고 로드 전에 설정
// ✅ 올바른 예시
Adrop . setUID ( "user_123" )
// 광고 로드...
// ❌ 잘못된 예시
// 광고 로드...
Adrop . setUID ( "user_123" ) // 광고 로드 후 설정하면 타겟팅이 적용되지 않음
2. 프로퍼티는 변경될 때마다 업데이트
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'
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. 로그아웃 시 UID 초기화
import Adrop from 'adrop-ads-react-native'
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'
const onUserLogout = () => {
// UID 초기화
Adrop . setUID ( "" )
// 필요시 프로퍼티도 초기화
AdropMetrics . setProperty ( "membership_level" , null )
AdropMetrics . setProperty ( "total_booking_count" , null )
}
관련 문서
FAQ
UID를 설정하지 않으면 타겟팅 광고가 노출되지 않나요?
UID를 설정하지 않아도 광고는 노출되지만, 오디언스 타겟팅이 적용되지 않습니다. 기본 타겟팅(국가, 언어 등)만 사용됩니다. 정교한 타겟팅을 위해서는 UID 설정이 필수입니다.
프로퍼티를 설정했는데 콘솔에서 데이터가 보이지 않아요.
프로퍼티 데이터는 수집 후 최대 24시간 내에 콘솔에 반영됩니다. 데이터가 표시되지 않는 경우:
콘솔에서 프로퍼티가 올바르게 정의되었는지 확인하세요.
SDK에서 전달하는 프로퍼티 키가 콘솔과 정확히 일치하는지 확인하세요 (대소문자 구분).
AdropMetrics.setProperty()가 광고 로드 전에 호출되는지 확인하세요.
프로퍼티 값에 null을 전달하면 해당 프로퍼티가 삭제됩니다: AdropMetrics . setProperty ( "membership_level" , null )
React Native SDK에서는 배열 타입은 현재 직접 지원하지 않습니다. 필요한 경우 문자열로 변환하여 전달하거나, 여러 개의 개별 프로퍼티로 나누어 설정하세요.