The rsubID parameter
The parameter name isrsubID, and it is case-sensitive — rsubid, RSUBID, and rsubId are all ignored. It is read from the query string only, never from the hash fragment.
rsubID sits alongside the referral code rather than replacing it. Attribution still runs off the referral code — see URL parameters — and the external click ID is metadata carried along for the ride.
How it is stored in the browser
Unlike the UTMs and ad platform click IDs, which are read once and written straight to the click, the external click ID is also persisted in the visitor’s browser.- The storage key is your program ID followed by
_rsubID, for exampleprog_a1b2c3_rsubID. - It goes in a cookie, falling back to localStorage when cookies are unavailable. Same mechanism as the rest of the tracking state — see cookies and storage.
- It is written for your program’s cookie window, which defaults to 60 days.
- It is scoped per program. Two Referly programs on the same domain keep separate external click IDs and never read each other’s.
rsubID. Without storage, the identifier would be gone by the time it is needed.
Resolution order
On every page load the tracking script resolves a current external click ID from two candidates:1
The URL wins
If
rsubID is on the current URL, that value is used and it overwrites whatever was stored.2
Otherwise the stored value is reused
If the URL has no
rsubID, the value already in storage for this program is carried forward and re-saved, resetting its expiry.3
Otherwise nothing
If neither exists, the external click ID is empty and the stored key is removed.
What lands on the click
When a click is recorded, the resolved value is written to the click’sextClickId field. Both cases that produce a click do this — the first arrival on a referral URL, and any repeat arrival on a referral URL for the same code.
Passing it back on conversion
The return trip runs through the affiliate’s postback URL. Each affiliate can set one on their own account; when Referly records areferral.created or sale.created event for that affiliate, it resolves the macros in the URL template and fires a GET request, following redirects, with a 10-second timeout.
Two macros matter here:
A network postback template usually looks something like this:
{extClickid} resolves to an empty string. Any macro with no value resolves to empty rather than being left in the URL.
The full macro list and setup steps live in postback URLs.
The full round trip
1
The network sends the click
Its ad or link redirects to your landing page with both the referral code and
rsubID on the URL.2
Referly records the click
The referral code resolves to an affiliate, a click is written, and
extClickId is stored on it. The value is also saved to the visitor’s browser for the cookie window.3
The visitor converts
Your integration or server call reports the sign-up or sale along with the click ID from
window.affiliateId.4
The postback fires
Referly loads that click, resolves
{extClickid} from it, and calls the affiliate’s postback URL.5
The network reconciles
It matches the identifier against its own click record and credits its publisher.
Things that clear or lose the value
- A tracking error. If the script throws while resolving a click, it clears the referral code, the click ID, and the stored external click ID together, leaving a clean slate rather than a half-written state.
- The cookie window expiring. The stored value expires with the rest of the tracking state.
- A different browser or device. Storage is per browser, so a visitor who clicks on their phone and converts on their laptop loses the identifier along with the attribution.
- The wrong casing.
rsubIDis matched exactly. This is the most common integration mistake — check the network’s actual outgoing URL rather than its documentation.
Related
Click data
Every field stored on a click, and when a click is recorded at all.
UTMs and ad click IDs
The campaign parameters read off the same URL, and how they differ from this one.
Postback URLs
Setting up the postback template and the full list of macros.
Cookies and storage
What the tracking script keeps in the browser, and for how long.