Refport

Track Conversions

Report leads and sales from your server, or let Stripe and Shopify send payment events to Refport automatically.

After click tracking is installed, report the events that matter to your referral program. Refport uses the click ID to connect those events back to the partner link.

Conversion flow

EventWhen to send itRecommended path
LeadA referred visitor signs up or becomes qualifiedBetter Auth plugin or track.lead()
SaleA referred customer completes paymentStripe, Shopify, or track.sale()
RefundA tracked payment is refundedStripe or Shopify integration

Lead tracking

If your app uses Better Auth, install the plugin and let Refport track sign-ups automatically.

The manual pattern is always the same:

  1. Read the refp_id cookie from the incoming request.
  2. If there is no click ID, skip tracking.
  3. Call track.lead() after the user is created.
  4. Never let tracking errors block sign-up.

Sale tracking

Use an integration when your sales happen in Stripe or Shopify. This keeps payment attribution, recurring revenue, and refunds aligned with the source of truth.

Minimal server SDK setup

npm install refport
lib/refport.ts
import { Refport } from "refport";

export const refport = new Refport({
  apiKey: process.env.REFPORT_API_KEY!,
});

Keep REFPORT_API_KEY on the server. Never expose it in browser code.

Where the portal fits

Conversion tracking powers the embedded portal. Once leads and sales are flowing, partners can see clicks, conversions, earnings, and payouts directly inside your product.

On this page