Lucida

Send referral and commission events to Lucida product analytics with your own project key, and pay bounties on Lucida activation events.

Embed
Preview of the card
<a href="https://referalli.com/docs/lucida"><img src="https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/pages/07a421a2-78a8-41d4-a117-d8ae327f4860/social-card.svg?v=3e7ae33eec8b" alt="Lucida" width="600" height="315"></a>

Connect a Lucida project and Referalli sends each new referral and each earned commission to it as a product event, on the referred customer, so funnels and cohorts in Lucida can split by partner and program.

Connect

curl -X PUT https://referalli.com/v1/integrations/lucida \
  -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
  -d '{"apiKey": "lc_sk_...", "host": "https://capture.example.com"}'
  • apiKey: a Lucida project key (a secret lc_sk_… key, or the public lc_pk_… one). Write-only, stored encrypted.

  • host: your Lucida capture gateway (your own host when self-hosted). Events go to {host}/v1/batch.

  • status: "paused" stops sending; DELETE /v1/integrations/lucida disconnects.

POST /v1/integrations/lucida/test sends one referalli_connection_test event and answers { "ok": true } or the error. Owners and admins only.

Events

Referalli event

Lucida event

distinct_id

referral.created

referalli_referral_created

The customer's customerRef

commission.earned

referalli_commission_earned

The customer's customerRef (the partner's externalRef for a line with no customer)

Properties are the event's fields (referralId, partnerId, programId, amountMinor, currency, …) plus:

  • anonId: the visitor id the customer's sign-up was matched from (the anonId of associate, or the tracking script's), or null.

  • referalliEventId: the Referalli event id.

Use your app's user id as customerRef (the id you pass to Lucida's identify), and Lucida joins the referral to the visitor's anonymous history from before sign-up. Each event carries a stable uuid, so a retried delivery is counted once. Deliveries retry with backoff for 3 days; GET /v1/integrations/deliveries?kind=lucida lists them.

Pay a bounty on a Lucida activation

When your app sees the moment Lucida calls activation (for example the activated event you capture), report it to Referalli too and the program's activation bounty pays the partner once per referral:

lucida.capture({ distinctId: user.id, event: 'activated' });
await fetch('https://referalli.com/v1/track/events', {
  method: 'POST',
  headers: { authorization: `Bearer ${process.env.REFERALLI_API_KEY}`, 'content-type': 'application/json' },
  body: JSON.stringify({ type: 'event', programId: process.env.REFERALLI_PROGRAM_ID, customerRef: user.id, event: 'activation', idempotencyKey: `activation:${user.id}` }),
});

Add an activation entry to the program's commission rule first. See Report a product event.

Updated