Conversion tracking
Docs/Growth

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

  1. A click gets an ID
    Every click on a short link has an ID such as clk_3f9a… (clk_ and 32 letters and digits).
  2. The destination receives it
    The link adds it to the destination URL as cu_click, or wherever you put {click_id}.
  3. You report the conversion
    When the visitor buys or signs up, your server, your thank-you page or your network calls your postback URL with that ID.
  4. It shows on the link
    The conversion is counted on the link that got the click (last click), with its value, and the conversion.created webhook 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.

Postback URL (GET or POST)
https://api.cloakingurl.com/api/v1/postback?token=pb_…&click_id=clk_…&event=purchase&value=49.90&currency=USD&txn_id=ORDER123

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.

When an order is paid
curl "https://api.cloakingurl.com/api/v1/postback?token=$CU_POSTBACK_TOKEN&click_id=$CLICK_ID&event=purchase&value=49.90&currency=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:

Every landing 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>
Thank-you page
<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>
Watch outThe token is visible in a page's source. It can only record conversions on clicks your project really received, but if you see conversions you don't recognise, rotate it.

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_click and the same order ID as txn_id.
  • You now see conversions per short link, per targeting rule and per A/B variant, whatever platform sent the click.
Good to knowGoogle and Meta report conversions with their own attribution windows and models; CloakingURL counts the last click on your link. Expect the numbers to be close, not identical.

With affiliate networks

  1. Send the click ID as the network's sub-ID
    In 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}.
  2. Add your postback URL in the network
    In its postback (S2S) settings, paste your postback URL and map its macros: the sub-ID macro to click_id, the payout macro to value and the transaction macro to txn_id.
  3. Test it
    Open your link, copy the click ID the network received, and check it with the tester on the Conversions page.
Postback for a network (macro names vary per network)
https://api.cloakingurl.com/api/v1/postback?token=pb_…&click_id={aff_sub}&event=purchase&value={payout}&currency=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.created with 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.

POST /v1/conversions
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"}'