Skip to main content

Overview

Through targeting settings, you can display customized ads to specific user groups. The Adrop SDK provides two targeting methods:
  • Audience Targeting: Display ads based on user properties.
  • Contextual Targeting: Display ads based on content context (category, topic, etc.).
To collect targeting data, UID and properties must be set before loading ads.

UID Setting

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

Usage

Parameters

UID is hashed with SHA-256 before transmission. Do not pass personal information (email, phone number, etc.) directly.

Audience Targeting

Collect user property information to display ads to specific user groups.

Setting Properties

Use the AdropMetrics.setProperty() method to collect user property information.

Parameters

  • Property key is limited to 64 characters maximum.
  • String values are limited to 256 characters maximum.
  • Numeric values are limited to 9007199254740991 maximum.
  • Up to 256 properties can be set.

Default Properties

The Adrop SDK provides default properties for targeting. Use the AdropKey and AdropValue classes to set values.

Age (Birthday)

When birthday information is provided, age is automatically calculated.
Date Format Constants

Gender

Gender Value Constants

Setting Age Directly

You can also set age directly instead of birthday.
You only need to set either BIRTH or AGE. If both are set, BIRTH takes precedence.

Custom Properties

You can set custom properties for your service. Custom properties must first be defined in the Property menu of the Adrop console.
Custom property names must exactly match the names defined in the console. Case-sensitive.

Property Usage Example

Example of updating properties when a user enters a specific screen in the app.

Contextual Targeting

Display ads based on content context (category, topic, etc.). Use the contextId property in banner ads and native ads.
Context targeting applies only to banner and native ad requests that include a Context ID (banner and native ads in the Android and iOS SDKs, the Web SDK, and the REST API). Interstitial, rewarded, popup, and splash ads, as well as the Flutter and React Native SDKs, do not send a Context ID. If an ad product that contains these placements uses context targeting, campaigns that include context options are not shown in those placements, and context exclusions are not applied there.

Setting in XML

Setting in Code

Native Ads

Native ads can set contextId in the constructor.

Context ID Usage Example

Example of displaying ads based on article category in a news app.
  • Context IDs are case-sensitive and must exactly match a value entered in a context targeting option’s condition in the console.
  • Do not use commas (,) in Context IDs, because a comma separates multiple values both in the console and in an ad request. When requesting ads, pass the value exactly as entered in the console, without leading or trailing spaces.
  • To match more than one context in a single request, pass a comma-separated value such as hiking,outdoor. The first 5 IDs are used, and exclusion takes precedence over inclusion. See Passing Multiple Context IDs.
  • If you don’t pass a Context ID, or pass a value that isn’t registered in the console, no error occurs. Only campaigns with context targeting are excluded, and other ads can still be served.

Event Tracking

Track user behavior events to build audiences based on user actions. Use AdropMetrics.sendEvent() to send events.
logEvent() is deprecated. Use sendEvent() instead.

Sending Events

Multi-Item Events

For events that involve multiple items (e.g., purchase, begin_checkout), use putItems() to attach an item list.

Supported Event Examples

  • Event name must be 1–64 characters.
  • Parameter key must be 1–64 characters.
  • String parameter values are limited to 1024 characters.
  • Duplicate events with the same name and parameters are throttled within a 500ms window.

Best Practices

1. Set UID Before Loading Ads

2. Use Meaningful Context IDs

3. Update Properties Whenever They Change


Create Audience Targeting

Create audience targeting in console

Create Context Targeting

Create context targeting in console

Sell Targeting

Set up targeting category sales

Banner Ads

Implement banner ads

Native Ads

Implement native ads

Reference

Classes, listeners, error codes

FAQ

Ads will still be displayed even without setting UID, but audience targeting won’t be applied. Only basic targeting (country, language, etc.) will be used. Setting UID is essential for sophisticated targeting.
Property data is reflected in the console within up to 24 hours after collection. If data is not displayed:
  1. Verify that properties are correctly defined in the console.
  2. Verify that property keys passed from SDK exactly match the console (case-sensitive).
  3. Verify that AdropMetrics.setProperty() is called before loading ads.
Context ID should be a meaningful string representing the content context. For example:
  • News app: "article_sports", "article_tech", "article_entertainment"
  • Shopping app: "category_fashion", "category_electronics"
  • Video app: "video_drama", "video_comedy"
Set it to exactly match, including case, a value entered in a context targeting option’s condition in the console. Do not use commas (,), because a comma separates multiple values both in the console and in an ad request, and do not add leading or trailing spaces.
No, array values are not directly supported. setProperty accepts String, Int, Double, Long, Boolean, and null values only. To store multiple values, use a JSON string:
Pass null to the property value to delete that property: