Targeting is evaluated server-side in OAds_CPT::passes_targeting() before an ad is served.
Device Targeting (_oads_target_device)
| Value | Behavior |
|---|---|
both | All devices (default) |
mobile | Mobile only (uses wp_is_mobile()) |
desktop | Desktop only |
User Role Targeting (_oads_target_roles)
Comma-separated list of role slugs. Special values:
logged_in— any authenticated userlogged_out— unauthenticated visitorssubscriber,editor,administrator— specific roles
Example: logged_in, subscriber
Category Targeting (_oads_target_categories)
Comma-separated category IDs. Ad shows only when the current page belongs to one of those categories. Works on singular posts and category archive pages.
Example: 3, 7, 12
Country Targeting (_oads_target_countries)
Comma-separated ISO 3166-1 alpha-2 country codes. Requires a geo-IP lookup at the theme level — OAds reads a constant or option OADS_VISITOR_COUNTRY if defined. Leave blank to show to all countries.
Frequency Cap (_oads_freq_cap)
Maximum impressions per user per day. Implemented in JavaScript using localStorage (key: oads_fc_{ad_id}). Set to 0 to disable.
Date Scheduling
_oads_start_date— YYYY-MM-DD, ad won't show before this date_oads_end_date— YYYY-MM-DD, ad won't show after this date
