Skip to main content

Overview

Targeting settings allow you to show personalized ads to specific user groups. The Adrop SDK provides audience targeting.
  • Audience Targeting: Display ads based on user attributes (properties).
To collect targeting data, you must set UID and properties before loading ads.

UID Setup

Set a user identifier (UID) to distinguish users. UID is the foundation for targeted advertising.

Usage

import Adrop from 'adrop-ads-react-native'

// After user login
Adrop.setUID("user_123")

// On user logout
Adrop.setUID("")

Parameters

ParameterTypeDescription
uidstringUnique user identifier (e.g., service member ID)
UID is transmitted hashed with SHA-256. Do not pass personal information (email, phone number, etc.) directly.
Pass an empty string ("") on logout to reset the UID.

Audience Targeting

Collect user attribute information (properties) to show ads to specific user groups.

Setting Properties

Use the AdropMetrics.setProperty() method to collect user attribute information.
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'

// String property
AdropMetrics.setProperty("membership_level", "premium")

// Number property
AdropMetrics.setProperty("booking_count", 15)

// Boolean property
AdropMetrics.setProperty("is_subscriber", true)

// Pass null (remove property)
AdropMetrics.setProperty("membership_level", null)

Parameters

ParameterTypeDescription
keystringProperty key (max 64 characters)
valueanyProperty value (string, number, boolean, null)
  • Property keys can be up to 64 characters.
  • String values can be up to 256 characters.
  • Number values can be up to 9007199254740991.
  • A maximum of 256 properties can be set.

Built-in Properties

The Adrop SDK provides built-in properties for targeting. Use AdropProperties and AdropGender enums to set values.

Age (Birthday)

When you pass birthday information, age is automatically calculated.
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'
import { AdropProperties } from 'adrop-ads-react-native/src/metrics/Property'

// Year only (yyyy)
AdropMetrics.setProperty(AdropProperties.BIRTH, "1990")

// Year and month (yyyyMM)
AdropMetrics.setProperty(AdropProperties.BIRTH, "199003")

// Full date (yyyyMMdd)
AdropMetrics.setProperty(AdropProperties.BIRTH, "19900315")
Date Formats
FormatExampleDescription
yyyy”1990”Year only
yyyyMM”199003”Year and month
yyyyMMdd”19900315”Full date

Gender

import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'
import { AdropProperties, AdropGender } from 'adrop-ads-react-native/src/metrics/Property'

// Male
AdropMetrics.setProperty(AdropProperties.GENDER, AdropGender.MALE)

// Female
AdropMetrics.setProperty(AdropProperties.GENDER, AdropGender.FEMALE)

// Other
AdropMetrics.setProperty(AdropProperties.GENDER, AdropGender.OTHER)

// Unknown
AdropMetrics.setProperty(AdropProperties.GENDER, AdropGender.UNKNOWN)
Gender Constants
ConstantValueDescription
AdropGender.MALE"M"Male
AdropGender.FEMALE"F"Female
AdropGender.OTHER"O"Other
AdropGender.UNKNOWN"U"Unknown

Setting Age Directly

You can also set age directly instead of birthday.
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)
You only need to set one of BIRTH or AGE. If both are set, BIRTH takes priority.

Custom Properties

You can set custom properties for your service. Custom properties must be defined first in the Ad Control Console under the Targeting menu.
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'

// Local activity app example
AdropMetrics.setProperty("region", "Seoul")
AdropMetrics.setProperty("booking_count", 5)

// Shopping mall app example
AdropMetrics.setProperty("membership_tier", "gold")
AdropMetrics.setProperty("total_purchase_amount", 1500000)

// Media app example
AdropMetrics.setProperty("favorite_genre", "drama")
AdropMetrics.setProperty("is_premium_subscriber", true)
Custom property names must exactly match the names defined in the console. Case-sensitive.

Property Usage Example

Example of setting properties when a user logs into the app.
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(() => {
    // Get user info
    const user = getUserInfo()

    // Set UID
    Adrop.setUID(user.id)

    // Set built-in properties
    AdropMetrics.setProperty(AdropProperties.BIRTH, user.birthDate)
    AdropMetrics.setProperty(AdropProperties.GENDER, user.gender)

    // Set custom properties
    AdropMetrics.setProperty("membership_level", user.membershipLevel)
    AdropMetrics.setProperty("total_booking_count", user.bookingCount)
  }, [])

  return (
    // Screen component
  )
}

export default ProfileScreen

Best Practices

1. Set UID Before Loading Ads

// Correct
Adrop.setUID("user_123")
// Load ads...

// Wrong
// Load ads...
Adrop.setUID("user_123") // Setting after ad load means targeting won't apply

2. Update Properties When They Change

import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'

const App = () => {
  useEffect(() => {
    // Set initial properties at app start
    updateUserProperties()
  }, [])

  const onUserPurchaseComplete = (purchaseAmount: number) => {
    // Update property on purchase completion
    const currentTotal = getCurrentTotalPurchase()
    AdropMetrics.setProperty("total_purchase_amount", currentTotal + purchaseAmount)
  }

  const onMembershipUpgrade = (newTier: string) => {
    // Update property on membership upgrade
    AdropMetrics.setProperty("membership_tier", newTier)
  }

  // ...
}

3. Reset UID on Logout

import Adrop from 'adrop-ads-react-native'
import AdropMetrics from 'adrop-ads-react-native/src/metrics/AdropMetrics'

const onUserLogout = () => {
  // Reset UID
  Adrop.setUID("")

  // Reset properties if needed
  AdropMetrics.setProperty("membership_level", null)
  AdropMetrics.setProperty("total_booking_count", null)
}


FAQ

Ads will still be shown without setting a UID, but audience targeting won’t be applied. Only default targeting (country, language, etc.) will be used. UID setup is essential for precise targeting.
Property data is reflected in the console within 24 hours of collection. If data is not showing:
  1. Verify the property is correctly defined in the console.
  2. Check that the property key passed from the SDK exactly matches the console (case-sensitive).
  3. Verify AdropMetrics.setProperty() is called before loading ads.
Pass null as the property value to delete it:
AdropMetrics.setProperty("membership_level", null)
The React Native SDK does not currently support array types directly. If needed, convert to a string or split into multiple individual properties.