Routing rules & anti-fraud
A campaign has a default pool of paths. Rules sit above it: they run top to bottom, every condition in a rule must match, and the first matching rule sends the click to its own paths (with the campaign's rotation mode). Clicks that match no rule, or match a rule without enabled paths, use the default pool.
Conditions
Each condition is a field, an operator (in or not_in) and a list of values (any match). Matching is case-insensitive. A missing value never matches in and always matches not_in.
| Field | Values |
|---|---|
| country | ISO code from Cloudflare: DE, AT |
| continent | AF, AN, AS, EU, NA, OC, SA |
| region, city | Cloudflare region / city |
| device_type | mobile, tablet, desktop, bot |
| os, browser | Android, iOS, Windows · Chrome, Safari |
| isp | ISP / AS organization, substring match |
| asn | AS number: 3320 or AS3320 |
| language | Primary Accept-Language: de matches de-AT; en-us matches only en-US |
| connection | datacenter or residential (built-in cloud ASN list) |
| bot | yes or no (after blocklist / datacenter checks) |
| referrer_domain | adcash.com also matches subdomains |
| ip | IP or CIDR, IPv4 and IPv6: 203.0.113.0/24 |
| weekday | mon … sun, in the rule timezone |
| hour | 9, 9-17, 22-3 (wraps midnight), in the rule timezone |
| sub1 … sub10 | Exact values passed on the tracking link |
Example: German mobile pops to a geo-locked casino offer
curl -X POST https://capve.app/api/campaigns/CAMPAIGN_ID/rules \
-H "Authorization: Bearer capve_…" -H "Content-Type: application/json" \
-d '{"name":"DE mobile evenings","timezone":"Europe/Berlin","conditions":[
{"field":"country","op":"in","values":["DE","AT"]},
{"field":"device_type","op":"in","values":["mobile"]},
{"field":"hour","op":"in","values":["18-23"]}]}'
curl -X POST https://capve.app/api/campaigns/CAMPAIGN_ID/paths \
-H "Authorization: Bearer capve_…" -H "Content-Type: application/json" \
-d '{"name":"DE casino","flow_type":"lander_offer","rule_id":"rul_…",
"landers":[{"lander_id":"lnd_a","weight":70},{"lander_id":"lnd_b","weight":30}],
"offers":[{"offer_id":"ofr_x","weight":50},{"offer_id":"ofr_y","weight":50}]}'Endpoints: GET/POST /api/campaigns/:id/rules, PATCH/DELETE /api/campaigns/:id/rules/:ruleId (deleting a rule deletes its paths). GET /api/campaigns/:id/rotation returns the default paths and the ordered rules with their paths.
Weighted landers and offers
A path can hold several landers and offers, each with a weight. Every click picks one lander and one offer by weight; both are stored on the click, so lander and offer reports and the LP click (/lp/:clickId) use the ones the visitor actually saw. The single lander_id / offer_id fields still work and mean a list of one.
Bots, blocklist and safe page
A click is flagged as a bot when any of these is true:
- the user agent looks like a bot, or Cloudflare scores it as one;
- its IP / CIDR, ASN or user-agent substring is on the account blocklist (
/api/antifraud/blocklist); - the campaign has
block_datacenteron and the ASN belongs to a cloud or hosting provider (AWS, Google Cloud, Azure, DigitalOcean, OVH, Hetzner, Linode, Vultr, Oracle, …).
Flagged clicks are recorded with is_bot = 1. Per campaign (PUT /api/campaigns/:id/traffic-filter), bot_action is either route (count as bot, route normally) or safe_page (redirect to safe_page_url). The safe page is a URL you configure (http/https only); the request can never choose it, and the same-host ?url= check still applies.
curl -X PUT https://capve.app/api/campaigns/CAMPAIGN_ID/traffic-filter \
-H "Authorization: Bearer capve_…" -H "Content-Type: application/json" \
-d '{"bot_action":"safe_page","safe_page_url":"https://example.com/blog","block_datacenter":true}'
curl -X POST https://capve.app/api/antifraud/blocklist \
-H "Authorization: Bearer capve_…" -H "Content-Type: application/json" \
-d '{"kind":"ip","values":["203.0.113.0/24"]}'