Skip to main content
Rulesets define targeting restrictions for offers. They control which traffic is accepted based on geography, device characteristics, connection type, scheduling, and IP addresses.

Rule categories

Geotargeting: countries, regions, cities, dmas, postal_codes, mobile_carriers Device: browsers, device_types, brands, os_versions, platforms Connection: isp, connection_types Other: ips, languages, is_block_proxy, day parting settings

Common fields

Every rule entry includes:
FieldValuesDescription
targeting_typeinclude, excludeWhether to allow or block matching traffic.
match_typeexact, minimum, maximum, rangeHow the value is compared.

Match type support

Match typeSupported by
exactcountries, regions, cities, dmas, postal_codes, mobile_carriers, browsers, device_types, brands, platforms, ips
minimumos_versions
maximumos_versions
rangeips

Geotargeting precedence

When combining geotargeting rules, more specific rules override less specific ones: City > DMA > ZIP/Postal Code > Region > Country For example, if you exclude the US but include New York City, traffic from New York City is still accepted.

Examples

Empty ruleset (all traffic allowed)

{ "ruleset": {} }

Single country targeting

{
  "ruleset": {
    "countries": [
      { "country_id": 227, "match_type": "exact", "targeting_type": "include" }
    ]
  }
}

OS version range (iOS 12.0+)

{
  "ruleset": {
    "os_versions": [
      {
        "os_version_id": 34,
        "match_type": "minimum",
        "targeting_type": "include",
        "platform_id": 2
      }
    ]
  }
}

IP exclusion range

{
  "ruleset": {
    "ips": [
      {
        "match_type": "range",
        "targeting_type": "exclude",
        "ip_from": "10.11.12.13",
        "ip_to": "10.11.12.100"
      }
    ]
  }
}

Day parting

Control when an offer accepts traffic by time of day and day of week.
FieldTypeDescription
is_use_day_partingbooleanEnable day parting.
day_parting_apply_tostringuser_timezone or selected_timezone.
day_parting_timezone_idintegerTimezone ID (when using selected_timezone).
days_partingarrayTime windows per day.
Each entry in days_parting:
FieldTypeDescription
day_of_weekinteger0 = Sunday, 1 = Monday, …, 6 = Saturday.
start_hourintegerStart hour (0–23).
start_minuteintegerStart minute (0–59).
end_hourintegerEnd hour (0–23).
end_minuteintegerEnd minute (0–59).

Day parting example (Mon–Thu, 9AM–6PM user timezone)

{
  "ruleset": {
    "is_use_day_parting": true,
    "day_parting_apply_to": "user_timezone",
    "days_parting": [
      { "day_of_week": 1, "start_hour": 9, "end_hour": 18 },
      { "day_of_week": 2, "start_hour": 9, "end_hour": 18 },
      { "day_of_week": 3, "start_hour": 9, "end_hour": 18 },
      { "day_of_week": 4, "start_hour": 9, "end_hour": 18 }
    ]
  }
}