Targeting System
All 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 role slugs. Special values:
logged_in— any authenticated userlogged_out— unauthenticated visitorssubscriber,editor,administrator— specific roles
Category targeting — _oads_target_categories
Comma-separated category IDs. Ad shows only on pages belonging to those categories (works on singular posts and category archives).
Country targeting — _oads_target_countries
Comma-separated ISO 3166-1 alpha-2 codes. OAds reads the constant or option OADS_VISITOR_COUNTRY if defined by your theme or geo-IP plugin.
Frequency cap — _oads_freq_cap
Maximum impressions per user per day. Stored in JavaScript 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
