Conversion tracking
Report sales, leads and installs back to CloakingURL and each one is attributed to the click that brought it, so every link shows its conversions, conversion rate and revenue. It works with your own site, your backend and affiliate networks, alongside Google Ads and Meta tracking. All plans
How it works
- A click gets an IDEvery click on a short link has an ID such as
clk_3f9a…(clk_ and 32 letters and digits). - The destination receives itThe link adds it to the destination URL as
cu_click, or wherever you put{click_id}. - You report the conversionWhen the visitor buys or signs up, your server, your thank-you page or your network calls your postback URL with that ID.
- It shows on the linkThe conversion is counted on the link that got the click (last click), with its value, and the
conversion.createdwebhook fires.
Send the click ID
Two ways, and you can use both on the same link:
- Pass click ID: on the link's Basic tab, switch on Pass click ID. Every web destination of the link (default, rules, A/B variants, money page) then gets
?cu_click=clk_…. Best for your own website. A deep link's app URL takes the placeholder below instead. - The {click_id} placeholder: put
{click_id}anywhere in a destination URL and it is replaced on each click. Affiliate networks each name their sub-ID parameter differently, so this lets you use theirs:https://network.com/offer?aff_sub={click_id}.
Bots sent to a cloaked link's safe page never get a click ID. Your UTM tags, gclid and fbclid pass through unchanged either way.
Your postback URL
Open Conversions under Developer. The page shows your project's postback URL with its token, ready-made examples and a tester.
https://api.cloakingurl.com/api/v1/postback?token=pb_…&click_id=clk_…&event=purchase&value=49.90¤cy=USD&txn_id=ORDER123
| Field | What it is | |
|---|---|---|
token | required | Your project's postback token. It can only record conversions on this project's clicks. Rotate it on the Conversions page if it leaks. |
click_id | required | The cu_click value (or what you received through {click_id}). |
event | optional | purchase, lead, signup, subscribe, install, page_view or custom. Anything else is recorded as custom. |
value | optional | Revenue or payout, e.g. 49.90 (a comma works too). |
currency | optional | Three letters, USD by default. |
txn_id | optional | Your order or transaction ID. The same txn_id is counted once, so retries never double your numbers. |
format | optional | pixel answers with a 1×1 GIF, for image requests from a web page. |
test | optional | 1 checks the click ID without recording anything. |
Answers: 201 recorded, 200 with duplicate: true for a repeated txn_id, 404 click_not_found for an ID that is not one of this project's clicks, 401 for a wrong token, and 402 when the plan's monthly conversions are used up.
From your website or backend
Keep cu_click from the landing URL with the visitor's session, cart or order, then report the conversion from your server when it happens. This is the most reliable way: ad blockers can't stop it and the token stays private.
curl "https://api.cloakingurl.com/api/v1/postback?token=$CU_POSTBACK_TOKEN&click_id=$CLICK_ID&event=purchase&value=49.90¤cy=USD&txn_id=$ORDER_ID"
No backend? Store the ID in a cookie on your landing pages and fire the postback as an image from the thank-you page:
<script>
(function(){var m=location.search.match(/[?&]cu_click=(clk_[a-f0-9]+)/);
if(m)document.cookie='cu_click='+m[1]+';path=/;max-age=2592000;samesite=lax';})();
</script><script>
(function(){var m=document.cookie.match(/(?:^|; )cu_click=(clk_[a-f0-9]+)/);if(!m)return;
new Image().src='https://api.cloakingurl.com/api/v1/postback?token=pb_…&click_id='+m[1]
+'&event=purchase&value=49.90&txn_id=ORDER123&format=pixel';})();
</script>With Google Ads and Meta
Point your ads at the short link. CloakingURL forwards gclid, fbclid, UTM tags and any other query parameter to your page, so the Google tag, the Meta Pixel and the Conversions API keep working as before. Add the click ID as above and the same sale is also counted on your link in CloakingURL:
- Turn on Pass click ID on the link used in the ad.
- On your purchase or lead event, next to the Google or Meta conversion call, call your postback with the stored
cu_clickand the same order ID astxn_id. - You now see conversions per short link, per targeting rule and per A/B variant, whatever platform sent the click.
With affiliate networks
- Send the click ID as the network's sub-IDIn the link's destination use the network's parameter with the placeholder, e.g.
?aff_sub={click_id},?subid={click_id}or?s2={click_id}. - Add your postback URL in the networkIn its postback (S2S) settings, paste your postback URL and map its macros: the sub-ID macro to
click_id, the payout macro tovalueand the transaction macro totxn_id. - Test itOpen your link, copy the click ID the network received, and check it with the tester on the Conversions page.
https://api.cloakingurl.com/api/v1/postback?token=pb_…&click_id={aff_sub}&event=purchase&value={payout}¤cy=USD&txn_id={transaction_id}Where conversions show
- Overviews: conversions, conversion rate, revenue and conversions by event across the project.
- Each link: Conversions, Conv. rate and Revenue, plus the per-rule and per-variant tables on Geo targeting and A/B testing.
- Conversions page: the latest 50, with link, event, value and transaction ID.
- Webhooks:
conversion.createdwith the conversion ID, link, event and value.
Recorded conversions count towards the plan's monthly quota: 100 on Free, 5,000 on Starter, 100,000 on Pro and 1,000,000 on Business.
With an API key
Server code that already uses an API key can post JSON instead. It records conversions the same way, txn_id included.
curl -X POST https://api.cloakingurl.com/api/v1/conversions \
-H "Authorization: Bearer $CLOAKINGURL_KEY" -H "Content-Type: application/json" \
-d '{"click_id":"clk_…","event":"purchase","value":49.9,"currency":"USD","txn_id":"ORDER123"}'