# Set Up Your Program

> Configure your affiliate program and choose the right integration path.

Complete these steps before you invite partners or install tracking.

<PageMeta
  items={[
    { label: 'Who this is for', value: 'Advertisers and operators' },
    { label: 'Time required', value: '10–15 minutes' },
    { label: 'Prerequisites', value: 'A created advertiser account and your initial program details' },
    { label: 'Outcome', value: 'Your program basics, approval mode, commission direction, and tracking path are ready' },
  ]}
/>

## What you are setting up

1. **Program details** — business info, approval settings, commission rules
2. **Tracking & integrations** — click, signup, and sale tracking
3. **Share program** — your partner-facing program link

![Program Settings — the checklist walks you through details, tracking, and sharing](/docs/brand/settings.png)

## 1. Program details

### Business details

| Field | Required | Notes |
|-------|----------|-------|
| Company name | Yes | pre-filled from your account |
| Website URL | Yes | main product/site URL |
| Tagline | No | shown to partners |
| Logo | Yes | PNG, JPG, or SVG |
| Terms of Service URL | No | affiliate terms / program terms |
| Resources URL | No | partner-facing marketing resources |

### Approval mode

| Mode | Description | Best for |
|------|-------------|----------|
| **Manual review** | review each partner application | quality control, B2B motions |
| **Auto-approve** | approve applicants automatically | higher-volume programs |

### Commission details

| Field | Description |
|-------|-------------|
| Commission rate (%) | default partner commission |
| Commission duration | how long a referred customer keeps earning for the partner |

Common options: one-time, fixed-month recurring, or lifetime.

---

## 2. Tracking & Integrations

Set up tracking in three steps: clicks, signups, then payments.

### Step 1 — Pageview / click tracking

Install the tracker on pages where affiliate traffic lands.

**SDK:**

```bash
npm install @affitor/sdk
```

```tsx
// app/providers.tsx — client component
'use client';
import { useEffect } from 'react';
import { init } from '@affitor/sdk';
export function AffitorInit() {
  useEffect(() => { init({ programId: YOUR_PROGRAM_ID }); }, []);
  return null;
}
// render <AffitorInit /> once in app/layout.tsx
```

**Script tag:**

```html
<script
  src="https://api.affitor.com/js/affitor-tracker.js"
  data-affitor-program-id="YOUR_PROGRAM_ID"
  data-affitor-debug="false">
</script>
```

→ [Full guide](/brand/tracking/click-tracking)

### Step 2 — Signup / lead tracking

After signup succeeds, send your internal customer ID to Affitor.

**Browser helper:**

```js
await window.affitor.signup('user_123', 'user@example.com');
```

**Server API:**

```json
{
  "click_id": "cust_42_1234567890",
  "customer_key": "user_123",
  "email": "user@example.com"
}
```

→ [Full guide](/brand/tracking/lead-tracking-signup/)

### Step 3 — Sale / payment tracking

Choose the path that matches your checkout.

| Method | How it works | Best for |
|--------|--------------|----------|
| **Server-side tracking** | your backend sends `POST /api/v1/track/sale` after payment succeeds | any payment provider or custom backend |
| **Stripe integration** | you keep taking payment in your own Stripe checkout; Affitor attributes via metadata + webhooks | existing Stripe Checkout integrations |

For Stripe integration, use these public fields in metadata:
- `affitor_click_id`
- `affitor_customer_key`
- `program_id`

For subscriptions, put the same values in both:
- `metadata`
- `subscription_data.metadata`

→ [Full guide](/brand/tracking/payment-tracking-stripe/)

---

## 3. Share Your Program

Once setup is complete, share your partner recruitment link so affiliates can apply.

---

## Recommended setup order

<Checklist
  items={[
    { text: 'Install click tracking first' },
    { text: 'Wire signup tracking with a stable internal customer ID' },
    { text: 'Choose Server-side tracking or Stripe integration for payment tracking' },
    { text: 'Run test flows before launch' },
  ]}
/>

---

## Verify it worked

Reload **Settings** and confirm each choice survived the save — every tab (business details, approval mode, commission) saves separately:

<VerifySuccess
  dashboard={[
    "Settings → Business details shows your company name, website URL, and logo",
    "Settings → Approval mode shows Manual review or Auto-approve — whichever you picked",
    "Settings → Commission shows your default rate and duration",
    "The Quick start checklist in the top bar marks the program-details step complete, leaving tracking and sharing",
  ]}
  ifNotWorking={[
    "A tab shows old values? Each tab saves on its own — reopen it, re-enter, and save that tab again",
    "Set up with the CLI instead? Run npx affitor status from your project root — it prints your program card (name, domain, Program ID) plus Stripe state, and should match what Settings shows",
    "Tracking steps still show as pending? That's expected — integration status is recalculated from real click, lead, and payment events, which you'll send in the tracking quickstart next",
  ]}
/>

---

<NextStep
  title="Install tracking"
  description="Once your program details are in place, move into the tracking quickstart to capture clicks, signups, and payments end to end."
  href="/brand/tracking/quickstart-integration"
  ctaLabel="Open tracking quickstart"
/>
