The Events API allows you to pass Referral Codes alongside events. This information is used to directly attribute events to specific trackers, overriding our usual attribution process. This feature can be used to manage "Support a Creator" programs or similar coupon/referral code based campaigns.

Getting Started

Once you have your account whitelisted for access to the Referral Codes feature, you are ready to get started. Attributing events by referral code is easy. All you need to do is provide the additional referral_code key with your normal event payload. You can see an example event with included referral code below.

curl \
	-X POST \
	-H 'Authorization: SOMEAPIKEYHERE' \
	-H 'X-Api-Version: 1.1.0' \
	-H 'Content-Type: application/json' \
	-d "$(cat <<-EOF
    "user_id": "b91f8k5r",
    "type": "purchase",
    "revenue_currency": "usd",
    "revenue_amount": 10.00,
    "identifiers": {...},
    "attribution": [
	    {"referral_code": "creator_1"}

To generate valid referral codes you will need to use the /trackers endpoint to create a new Tracker with a referral code attached.