> ## Documentation Index
> Fetch the complete documentation index at: https://doc.trackrev.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Embeddable Refer & Earn dashboard

> Give every user a full referral dashboard inside your product — link, clicks, signups, purchases, conversion rate and rewards.

The dashboard embed puts a complete **Refer & Earn** page inside your own app. Your users see
their personal referral link, how it's performing — clicks, signups, purchases, conversion rate —
and the credits or cash they've earned, all without leaving your product. You paste one snippet;
TrackRev renders and maintains the dashboard.

## Set it up

<Steps>
  <Step title="Create a programme with rewards">
    [Create a programme](/affiliate/create-program) that rewards referrers with
    [credits](/affiliate/credits-and-fulfilment) (e.g. AI credits, free months) or cash
    [commissions](/affiliate/commissions). The `free` / `paid` tier you pass in the snippet decides
    which credit amount each user earns.
  </Step>

  <Step title="Get a publishable key">
    In **Settings → Developers**, create a **publishable** key (`pk_…`). It's browser-safe, and the
    Developers page shows a ready-made embed snippet.
  </Step>

  <Step title="Paste the snippet in your app">
    Drop the script into your authenticated app, filling in the signed-in user's id, email and
    tier:

    ```html theme={null}
    <script async src="https://app.trackrev.io/embed.js"
      data-key="pk_live_xxxxxxxx"
      data-user-id="user_123"
      data-user-email="jane@acme.com"
      data-user-tier="paid"
      data-mount="#refer-earn"></script>
    ```
  </Step>

  <Step title="Users see their dashboard">
    Each user is enrolled automatically on first view and gets their own dashboard — nothing else
    to build. Theme and accent-color options let it match your brand; see the
    [developer reference](/developers/dashboard-embed) for every attribute.
  </Step>
</Steps>

## What your users see

* **Their referral link**, ready to copy and share.
* **Performance over a selectable window** (7–90 days, default 30): clicks, signups, purchases and
  conversion rate, with a day-by-day trend.
* **Their rewards**: credits earned, delivered and pending, or cash pending and paid out —
  lifetime totals.

<Info>
  The embed composes with the [referral widget](/affiliate/referral-widget): the widget is a
  lightweight share card for enrolling users and spreading their link, while the dashboard embed
  is the full analytics view. Use either on its own, or the widget on high-traffic pages and the
  dashboard on a dedicated "Refer & Earn" page.
</Info>

## Referrers vs affiliates

TrackRev distinguishes two kinds of partner:

* **Affiliates** join through your public partner join page and earn cash commissions — that's
  the only mode a join-page partner has.
* **Referrers** are your own users, enrolled through the widget or dashboard embed, earning
  [credits](/affiliate/credits-and-fulfilment).

The dashboard embed can bridge the two: let your credit-earning users **upgrade to affiliate
in-product**, without ever visiting the join page or leaving your app.

To enable it, open your campaign in **Affiliates → Program** and turn on **Allow customers to
become affiliates** (in the credit-rewards section — the option only applies to credit
campaigns; cash campaigns already pay cash, so no toggle is shown). Turning it on reveals the
**affiliate commission** fields: set the percent of sale (or flat amount per sale) that switched
affiliates earn. Once saved, users see a choice inside the embed: keep earning credits, or
switch to cash.

What changes for a user who switches:

* Their **future** conversions earn cash at the affiliate commission you set instead of credits —
  everything they've already earned in credits is kept.
* They get an embedded portal view: cash balance, recent commissions, payout-method setup and
  payout history.
* Payouts run through your normal [payout flow](/affiliate/payouts), and your program's minimum
  payout threshold applies.
* The switch is reversible — they can go back to earning credits at any time.

<Note>
  Only render the snippet to the signed-in user it belongs to — TrackRev trusts the user identity
  your page provides, under your API key, and in affiliate mode that includes the payout email
  the user sets. Details in the [developer reference](/developers/dashboard-embed).
</Note>
