# Affiliate funnel

How to set up an affiliate program, where its signups come from, Meta ad accounts read per ad, rep commission on signups, stated exchange rates and the checks a person makes.

An affiliate funnel is paid by another company's program for each signup it keeps past the program's window, not by cash from a call. Leads opt in on a page, reps dial them or message them and log each signup, and the program's own data says which signups were kept. This page holds the program and everything that feeds it. Base44 is the first program run this way; the [Base44 partner](/docs/settings/base44-partner) page covers the older call-based model.

## Who can open it

Owners, admins and ops members can open it. Only owners and admins can change it. Closers, setters and SDRs who open the address are sent back to Account; they log their signups on [Affiliate signups](/docs/features/affiliate-sales).

## The program

1. Tick `This workspace sells through an affiliate program`.
2. Fill in `Program` (for example Base44), `Platform` (Impact, or another platform) and `Retention window, days`. The window is how long a signup must stay before the program pays for it, 14 days by default.
3. Fill in `Payout per retained signup` and its `Currency`, as the program pays it.
4. In `Plans`, put one plan per line: its key, monthly or yearly, its tier, and whether it counts. A plan that does not count is still logged, but never paid on.
5. Fill in `Affiliate link`, the `Opt-in parameter` (subId1 by default) and the `Rep parameter` (sharedid by default). PYLO builds each rep's own link from these.
6. Set the targets if the program has them: `Yearly share target`, `Usage target` and `Opt-in to signup floor`, each as a percentage.
7. Choose `Save the program`.

## Where signups come from

Choose one under `Where signups come from`.

- **The program's API.** PYLO reads Impact every six hours. Type the `Impact account SID` here; it is not secret. The auth token is: it arrives through a key drop, never through this form or a chat. `Read the program now` reads it straight away, and the page says when it was last read and why a read failed.
- **A CSV report.** Download Impact's Advanced Action Listing as CSV and import it below.
- **Logged by hand.** A person checks each signup once its window has passed (below).

Each signup the program reports is matched to a logged sale by its sub ID, then by the rep's Shared ID. A signup no rep logged becomes a sale "from the program". A signup whose Shared ID names a different rep from the one who logged it is listed on [Affiliate signups](/docs/features/affiliate-sales) for a person to decide.

## The sales portal

Paste the client's own sales portal address, https only, and choose `Save link`. Reps and the agency open it from PYLO. PYLO links to it and never opens it for you.

## Meta ad accounts

Spend is read per ad, so each opt-in and signup is tied to the ad that brought it. Every ad's link carries `utm_content={{ad.id}}`.

1. Type the `Ad account id` (act_ followed by the number).
2. Under `Read through`, choose the agency's Meta connection (set on [Affiliate funnels](/docs/agency/affiliate) in Agency OS) or this workspace's own Meta key.
3. Choose `Add account`. Add as many as the client runs.

`Read spend now` reads every named account. Afterwards the page lists any active ad whose link does not carry the ad id, so it can be fixed in Ads Manager. `Unlink` stops reading an account and keeps the spend already stored.

## Import the program's report

Choose the CSV file, then `Check the file`. Nothing is written yet: the page shows how many actions it read, how many are new or changed, how each matched, how many sales it would create, and how many would move to confirmed, retained or reversed. Choose `Import` to apply it. An action already imported is updated, never counted twice.

## Rep commission on signups

These rules are apart from commission on cash. A rule is a share of the program's commission or a flat amount per signup, for one role (SDRs, setters or closers), for every plan or only monthly or yearly plans, from a date. A signup inside its window shows as pending, a retained one as earned, and a reversed one as nothing. Choose `Add rule`, and `Stop` to end one.

## Stated exchange rates

When ad spend and the program's commission are in different currencies, cost per signup and return on spend are shown only once you state a rate for that month. Fill in `Month`, then 1 of one currency `is` the rate `of` the other, and a `Note` saying where the rate came from, then choose `State the rate`. PYLO uses it for those two figures and for profit-share statements, and nowhere else: never for cash, commission or payouts.

## Signups to check

Shown only when signups are logged by hand. Each signup past its window is listed until someone answers. Look it up in the program's own dashboard, then choose `Retained` or `Not retained`.
