Targeting Settings
REST API
Targeting Settings
Learn how to configure user properties and context targeting using the REST API.
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.
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 (
Audience Targeting
Target ads based on user properties.Request Parameters
string
required
App Key (found in adrop_service.json)
string
required
application/jsonstring
required
User unique identifier
string
required
Property data (JSON string). Includes preset and custom properties.
string
Platform. e.g.,
web, android, iosstring
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, GDRCustom Properties
You can use custom properties defined in the console.Setting Custom Properties
- In the Adrop Console, click Property in the left menu
- Click Property Detail, add custom properties with + Add Property, and click Save (see Property Naming Rules)
- Send the property key-value pairs via API
Context Targeting
Target ads based on page or content context. Add thecontextId parameter to ad requests.
Setting Up Context Targeting
- In the Adrop Console, go to Targeting → Context and create a context targeting (see Context Targeting)
- In the targeting option’s condition, enter the Context IDs you will send in ad requests
- Pass the same value in the
contextIdparameter 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
?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.
Related Documentation
Audience Targeting
Configure audience targeting in the console
Context Targeting
Configure context targeting in the console