Skip to content
DocsTracking & attributionTraffic sources & cost

Traffic sources, tokens and cost

Create a traffic source from a template (Adcash, PropellerAds, RichAds, Zeropark, TrafficStars, Facebook, Google Ads, TikTok). The template sets the cost model, the outgoing postback and named tokens: each source URL parameter is stored in a sub slot and shown by name in reports.

Read multi-provider campaigns for a complete example, and Click IDs & SubIDs before mapping your source's ID.

Named tokens

The Adcash template maps:

ParamNameStored in
zoneidZonesub1
campaignidCampaignsub2
countryCountrysub3
costCostcost
clickidClick IDexternal_id

Campaigns using the source get a tracking URL with the source's macros appended (campaign view → Traffic source link):

https://capve.app/c/casino_ab12cd34?zoneid=[zone]&campaignid=[campaign]&country=[country]&cost=[redirection_cost]&clickid=[clickid]

On each click the mapped params are copied into their slot, so Group by → Zone (sub1) works in reports and {external_id} in the outgoing postback returns the source's click id. Templates marked check macros use names we could not verify: compare them with the source's tracking settings and edit the tokens in Traffic sources → URL parameters.

Adcash pixel

On the traffic source, the outgoing URL is cid={external_id}. That is Adcash's click id, from clickid=[clickid] on the campaign link. cid={click_id} sends Capve's clk_… id, and Adcash does not match the conversion. {click_id} belongs on the offer URL.

Affiliate network templates

Network templates (generic, TUNE/HasOffers, Everflow, CAKE, Affise, Cellxpert, Affilka, MyAffiliates) give the offer URL parameter and the incoming postbacks with the network's macros, one per event:

Offer URL (in Capve)

https://casino.example/?aff_sub={click_id}

Default postback (in the network)

https://capve.app/click?cnv_id={aff_sub}&payout={payout}

Registration postback

https://capve.app/click?cnv_id={aff_sub}&payout={payout}&event=registration

FTD postback

https://capve.app/click?cnv_id={aff_sub}&payout={payout}&event=ftd

Cost updates

Set the real spend for a campaign over a date range, optionally for one token value (e.g. one zone). The total is spread evenly over the matching clicks and replaces their cost, so cost, profit, ROI and CPC in every report follow. Clicks outside the range or filter keep their cost.

curl -X POST https://capve.app/api/campaigns/prg_…/costs \
  -H "Authorization: Bearer capve_…" -H "Content-Type: application/json" \
  -d '{"date":"2026-10-14","total_cents":4250,"filter_dim":"zoneid","filter_value":"9001"}'

filter_dim is a token param of the campaign's source (zoneid) or a click field (sub1…sub10, country, external_id). Use from/to (ISO or Unix ms) for a range. GET /api/campaigns/:id/costs lists past updates.

From a report row

In Reports → Breakdown, group by a token, country or external ID and use Set cost on a row. It sends the same update for that value over the report's date range. Rows grouped by a token also have Blacklist, which adds the zone to the campaign's blacklist export. Group by Path to pause or resume a path; a paused path gets no new traffic and keeps its stats.

Cost on the campaign URL

The traffic-source link carries the price of each visit. That does not need an API key. Adcash fills cost=[redirection_cost] with the price of that redirect, in the wallet currency. In URL parameters, the Cost row's source macro is [redirection_cost]. Save, then paste each campaign's Traffic source link into the Adcash campaign. Adcash keeps calling the previous URL until you paste the new one.

Capve stores that price on the click, including a fraction of a cent. A pop at €0.001 is kept and the report total is the sum of the visits. Clicks already saved with no price stay at 0. The Reporting API below copies Adcash's spending total instead.

Cost from the traffic source API

The API key is optional. It copies Adcash's reported spending onto the clicks, which is the campaign total rather than the per-visit price.

In Adcash, open Settings → API Tokens. Turn on Reporting API, the row labeled “Get your campaign data through the Reporting API,” and copy that token. Client API, “Create and manage campaigns with our Client API,” creates and edits campaigns inside Adcash. Capve does not call it.

In Traffic sources → Spending API, set Cost API to Adcash and paste the Reporting API token. The key is encrypted with AUTH_SECRET and never returned; after rotating AUTH_SECRET, enter it again. An hourly cron pulls yesterday's and today's spend and writes it onto the clicks of every campaign using that source, matched by the tokens marked Source campaign id and Zone id. Use Sync cost now (or POST /api/sources/:id/sync-cost) to run it on demand.

API and MCP

  • GET /api/sources/templates — list_source_templates
  • POST /api/sources/from-template — create_traffic_source_from_template
  • POST /api/sources/networks/from-template — create_network_from_template
  • GET|PUT /api/sources/:id/settings — get_traffic_source_settings, update_traffic_source_settings
  • POST /api/sources/:id/sync-cost — sync_traffic_source_cost
  • GET /api/campaigns/:id/source-link — get_campaign_source_link
  • GET|POST /api/campaigns/:id/costs — list_cost_updates, update_campaign_cost

See MCP server to connect an assistant.