Skip to main content
POST
Targeting Settings
Targeting allows you to display ads to specific user groups or contexts. The REST API supports both audience targeting and context targeting.

Audience Targeting

Target ads based on user properties.

Request Parameters

string
required
App Key (found in adrop_service.json)
string
required
application/json
string
required
User unique identifier
string
required
Property data (JSON string). Includes preset and custom properties.
string
Platform. e.g., web, android, ios
string
Advertising identifier (ADID/IDFA)

Response

integer
Response code. 0 indicates success.
string
Response message

Preset Properties

Standard properties predefined by Adrop. The same format is used across all SDKs and REST API.

Birth Date (BIRTH)

Gender (GDR)

Unknown Values

Preset property keys use uppercase: BIRTH, GDR

Custom Properties

You can use custom properties defined in the console.

Setting Custom Properties

  1. In the Adrop Console, click Property in the left menu
  2. Click Property Detail, add custom properties with + Add Property, and click Save (see Property Naming Rules)
  3. Send the property key-value pairs via API
All custom property values must be STRING type.

Context Targeting

Target ads based on page or content context. Add the contextId parameter to ad requests.

Setting Up Context Targeting

  1. In the Adrop Console, go to Targeting → Context and create a context targeting (see Context Targeting)
  2. In the targeting option’s condition, enter the Context IDs you will send in ad requests
  3. Pass the same value in the contextId parameter when requesting ads
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.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.

Applying Context to Ad Requests

To match more than one context in a single request, separate the IDs with commas. The first 5 IDs are used, and exclusion takes precedence over inclusion.
Repeating the parameter (?contextId=hiking&contextId=outdoor) works the same way. For the full rules, see Passing Multiple Context IDs.
If a Context ID contains non-ASCII characters (such as Korean) or &, #, %, +, or spaces, URL-encode it. The params option in axios and Python requests encodes values automatically.

Best Practices

Consistent User ID

Always use the same uid for the same user. Consistent IDs are key to accurate targeting.

Update Properties

Call the /property endpoint immediately when user information changes.

Follow Preset Formats

Use the exact specified formats for BIRTH and GDR properties.

Leverage Context

Use context targeting for page types like news, sports, shopping, etc.

Audience Targeting

Configure audience targeting in the console

Context Targeting

Configure context targeting in the console