Ad types and targeting
Ad types
| Type | Required meta |
|---|---|
image | _oads_image_url, _oads_image_id, _oads_destination_url |
text | _oads_text_headline, _oads_text_body, _oads_text_cta, _oads_destination_url |
html | _oads_html_embed (filtered through wp_kses_post) |
video | _oads_video_url, _oads_video_type (self or youtube) |
sponsored | _oads_sponsored_headline, _oads_sponsored_desc, _oads_sponsored_img_url |
sticky | _oads_sticky_position (top or bottom) |
Video ads use IntersectionObserver to start/stop playback on scroll. Sticky bars include a close button that hides the bar via localStorage.
Targeting
All targeting is evaluated server-side in OAds_CPT::passes_targeting() before the ad is served.
Device (_oads_target_device): both (default), mobile, desktop. Mobile uses wp_is_mobile().
User role (_oads_target_roles): comma-separated. Specials: logged_in, logged_out. Or specific roles: subscriber, editor, administrator.
Category (_oads_target_categories): comma-separated category IDs. Matches on singular posts and category archives.
Country (_oads_target_countries): comma-separated ISO 3166-1 alpha-2 codes. Reads OADS_VISITOR_COUNTRY constant or option (set by your geo-IP plugin).
Frequency cap (_oads_freq_cap): max impressions per user per day. Stored in localStorage under oads_fc_{ad_id}. Set to 0 to disable.
Date scheduling:
_oads_start_date(YYYY-MM-DD): ad hidden before this date._oads_end_date(YYYY-MM-DD): ad hidden after this date.
Ads inside <header> or <footer> elements are automatically hidden via injected CSS so they don't compete with site chrome.

