Set segment costs
set_segment_costsBook a known spend onto a traffic SEGMENT — period + any analytics filters, across campaigns ("I spent $500 on offer 3 / zone 1234 last week, lay it out"). 'set' makes the segment's total cost exactly amount (other clicks in the segment zeroed), 'add' puts it on top. 'even' spreads per click; 'proportional' scales each click's current cost so an ad-network sync's shape survives and only the total moves. Bots never carry cost unless include_bots; unique_only restricts carriers to unique clicks; landing-exit clicks never carry cost. Applied asynchronously (result 'queued'), 90-day editable window. Works like per-campaign cost booking, for arbitrary segments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| os | No | ||
| isp | No | ||
| city | No | ||
| mode | No | 'set' (default) makes the segment total exactly `amount`; 'add' increments it | |
| site | No | Placement / zone id as passed by the ad network | |
| sub1 | No | Filter by sub1 | |
| sub2 | No | Filter by sub2 | |
| sub3 | No | Filter by sub3 | |
| sub4 | No | Filter by sub4 | |
| sub5 | No | Filter by sub5 | |
| sub6 | No | Filter by sub6 | |
| sub7 | No | Filter by sub7 | |
| sub8 | No | Filter by sub8 | |
| sub9 | No | Filter by sub9 | |
| user | No | Workspace member id(s), comma-separated — the campaign owner at click time (needs the "See statistics per team member" permission; ignored otherwise) | |
| offer | No | Offer id | |
| sub10 | No | Filter by sub10 | |
| sub11 | No | Filter by sub11 | |
| sub12 | No | Filter by sub12 | |
| sub13 | No | Filter by sub13 | |
| sub14 | No | Filter by sub14 | |
| sub15 | No | Filter by sub15 | |
| amount | Yes | USD | |
| device | No | mobile / tablet / desktop | |
| period | No | Reporting period (default 7days). Use 'custom' with date_from/date_to. | |
| source | No | Traffic source id | |
| browser | No | ||
| country | No | Country ISO alpha-2 code, e.g. ES | |
| date_to | No | YYYY-MM-DD (with period=custom) | |
| landing | No | Landing id | |
| campaign | No | Campaign ALIAS(es), comma-separated for several | |
| creative | No | Creative id from the click URL | |
| language | No | ||
| pwa_tags | No | Comma-separated tag ids — pwas carrying any of them | |
| referrer | No | ||
| utm_term | No | Exact utm_term value from the click URL | |
| date_from | No | YYYY-MM-DD (with period=custom) | |
| pwa_group | No | Pwa group id | |
| smartlink | No | Smartlink id | |
| source_id | No | Source id as passed by the ad network | |
| offer_tags | No | Comma-separated tag ids — offers carrying any of them | |
| utm_medium | No | Exact utm_medium value from the click URL | |
| utm_source | No | Exact utm_source value from the click URL | |
| ad_campaign | No | The ad network's own campaign id (external_campaign_id) | |
| aff_network | No | Affiliate network id | |
| offer_group | No | Offer group id | |
| source_tags | No | Comma-separated tag ids — sources carrying any of them | |
| unique_only | No | Only unique clicks carry cost; repeat visits in the segment are zeroed by a set | |
| utm_content | No | Exact utm_content value from the click URL | |
| distribution | No | 'even' (default) per click; 'proportional' to each click's current cost | |
| include_bots | No | Let bot clicks carry cost too (default false — networks never bill crawlers) | |
| landing_tags | No | Comma-separated tag ids — landings carrying any of them | |
| source_group | No | Source group id | |
| utm_campaign | No | Exact utm_campaign value from the click URL | |
| campaign_tags | No | Comma-separated tag ids — campaigns carrying any of them | |
| landing_group | No | Landing group id | |
| campaign_group | No | Campaign group id | |
| smartlink_tags | No | Comma-separated tag ids — smartlinks carrying any of them | |
| connection_type | No | ||
| smartlink_group | No | Smartlink group id |