Skip to content
Browse documentation

Server-side clicks (/clk)

Record a click from your server and get the click ID back as JSON — for app installs, server-side forms and flows where the visitor never passes the tracking domain.

Last updated 3 min read

On this page

/clk records a click without redirecting anyone. Your server calls it, receives the click ID as JSON, and passes the ID on itself (to an app, a form, an advertiser API). Use it when the visitor never loads a tracking link — for example server-to-server lead posting or app flows. It is the equivalent of Everflow's async=json clicks.

URL
https://trackcrown.com/clk?oid=OFFERCODE&affid=PARTNERCODE&token=WORKSPACE_TOKEN&sub1=form-a&ip=203.0.113.7&user_agent=Mozilla%2F5.0%20(iPhone…)

Parameters#

ParameterRequiredNotes
oid (or offer_id)YesOffer code or numeric offer ID.
affid (or aid, affiliate_id, aff_id)YesPartner code or numeric partner ID.
tokenYesThe workspace postback token (Settings → Postback tokens). Advertiser tokens are not accepted.
ipRecommendedThe visitor's IP address. Used for geo, ISP, datacenter flag and uniqueness. Without it, your server's address is recorded.
user_agent (or ua)RecommendedThe visitor's user agent. Used for device, OS, browser and bot detection.
sub1…sub10, source_id, gclid, …NoMapped like any click (Sub IDs & parameters).

GET and POST are accepted; parameters are always read from the query string (a POST body is ignored).

Response#

Always JSON with Cache-Control: no-store.

JSON
{"transaction_id":"0192a6c3f1e04b7e9c2d8a1f3b5c7d9e","offer_id":12,"affiliate_id":7,"error_code":0}
JSON
{"transaction_id":"","offer_id":12,"affiliate_id":7,"error_code":4,"error":"offer not active"}
error_codeHTTPerrorLogged as
0200—Click, status redirect
1401invalid tokenNothing
2200unknown offerNothing
3200unknown affiliateNothing
4200offer not active — offer or its advertiser paused/inactive, or outside the offer scheduleClick, status fallback, reason paused
5200affiliate not approved for this offer — also when required offer terms are not acceptedClick, reason not_approved
6200visitor outside the offer's targeting (including extended targeting)Click, reason targeting
7200click cap reached (partner on offer, offer, hourly)Click, reason cap
8200workspace not activeClick, reason workspace_inactive
9200blocked by a traffic controlClick, reason traffic_control
10200duplicate click — the offer sends duplicate clicks to the fallbackClick, reason duplicate

transaction_id is the click ID. Pass it to the advertiser as you would {click_id}; conversions are then reported with /pb?transaction_id=… or click_id=… as usual (S2S postback).

What is checked#

The same checks as an affiliate link, in this order: workspace active → offer active, inside its schedule and its advertiser not Paused or Inactive → partner approved and required offer terms accepted → countries, devices and OS → extended targeting (regions, ISP, browser, language, IP ranges, day-parting, parameter filters) → traffic controls → click caps (partner on offer, offer, hourly) → the duplicate-click setting. Targeting, extended targeting, traffic controls and uniqueness are evaluated on the visitor's ip and user_agent when you pass them (otherwise on your server's address).

Not applied on /clk: forwarding rules, fail routes, landing pages and the redirect mode (there is no redirect), and the partner's forced traffic-source template.

The offer must belong to a workspace that may use the tracking domain you call; otherwise the answer is unknown offer.

Example: server-side lead form#

  1. The visitor submits your form. Your server calls:
Shell
curl -s "https://trackcrown.com/clk?oid=OFFERCODE&affid=PARTNERCODE&token=$WS_TOKEN&sub1=landing-b&ip=$VISITOR_IP&ua=$(python3 -c 'import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1]))' "$VISITOR_UA")"
  1. Store transaction_id with the lead and send it to the advertiser.
  2. When the advertiser accepts the lead, they call https://trackcrown.com/pb?transaction_id=<id>&token=<advertiser token>.

Reports#

Server-side clicks have link type server and appear in Reporting → Clicks and every report like other clicks.

Something unclear or missing in this article?Tell us