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.


Note that the Referral Code feature must be enabled by your account manager. Please contact us if you have a flow that involved using referral codes.

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,
    "revenue_type": "cumulative",
    "identifiers": {...},
    "referral_code": "creator_1"