AffiliateWP Automations
How to Log AffiliateWP Payouts to a Google Sheet When Referrals Are Paid
Paying affiliates creates a paper trail you will want for tax time and for settling disputes. To log AffiliateWP payouts to a Google Sheet, use Zapify's An affiliate's referral changes status trigger set to Paid with the Add a row to a spreadsheet action. AffiliateWP and Google Sheets are Zapify PRO integrations.
What this automation does
The automation is one trigger plus one action:
- Trigger: An affiliate's referral changes status (
AFFWP_REFERRAL_STATUS_CHANGED, AffiliateWP) - Action: Add a row to a spreadsheet (
GOOGLESHEETS_APPEND_ROW, Google Sheets)
Each time a referral is marked Paid, Zapify adds a row to your payout ledger with the affiliate's payment email, the amount and the referral.
PRO feature
AffiliateWP and Google Sheets are Zapify PRO integrations, so this automation needs an active Zapify PRO licence.
No Connection needed for AffiliateWP
AffiliateWP runs on your own site, so there is no API key to paste for it and nothing to set up under Settings → Connections.
Before you start
- AffiliateWP installed and active.
- A Google account with access to the spreadsheet, and its Spreadsheet ID, the long string in its URL between
/d/and/edit.
How to build the automation
Step 1: Connect Google Sheets
Google Sheets connects by signing in rather than pasting a key.
- Go to Settings → Connections.

- Choose Google Sheets and click Add New.

- Sign in with the Google account that can edit your sheet and approve the permissions.
See Connections for how this works and how to reconnect one that expires.
Step 2: Create a new automation
- In the WordPress admin, go to Zapify → Automations.
- Click Add New to open the builder.
- Name it clearly, such as Log affiliate payouts.

Step 3: Add the "An affiliate's referral changes status" trigger
- Click Add Trigger.

- Choose AffiliateWP as the app.

- Select An affiliate's referral changes status.

- Configure the trigger:
| Field | Required | What it does |
|---|---|---|
| Referral type | Yes | Any type, or one type such as Sale. |
| New status | Yes | The status that should start the automation: Pending, Unpaid, Paid or Rejected. |
Set New status to Paid.
Step 4: Add the "Add a row to a spreadsheet" action
- Click Add Action.

- Choose Google Sheets as the app.

- Select Add a row to a spreadsheet.

Step 5: Configure the action
| Field | Required | What it does |
|---|---|---|
| Connection | Yes | The Google account from Step 1. |
| Spreadsheet ID | Yes | The ID from the sheet's URL, the long string between /d/ and /edit. |
| Sheet name | No | The tab to append to. Defaults to the first one. |
| Columns | Yes | One entry per column, left to right. |
Give the sheet a header row such as Referral, Affiliate, Payment email, Amount, Order. Add one Columns entry per column, in order:
- the Referral ID token
- the Affiliate ID token
- the Affiliate payment email token
- the Referral amount token
- the Referral reference (order ID) token

Step 6: Set the steps Live and save
Each trigger and action has its own Live / Off / Draft switch. A new automation starts as a Draft and does nothing until its steps are Live.
- Set the trigger and every action to Live.
- Click Save.

Step 7: Test it
Mark a test referral as paid in AffiliateWP → Referrals, then check the sheet.
Tokens you can use
The trigger offers the affiliate's details, the referral's details, one extra token for the old status, and the user tokens.
| Token | What it holds |
|---|---|
| Affiliate ID | The affiliate's numeric ID in AffiliateWP. |
| Affiliate status | Their status: active, inactive, pending or rejected. |
| Affiliate referral URL | Their personal referral link, ready to put in an email. |
| Affiliate payment email | The address they get paid at. |
| Affiliate rate / Affiliate rate type | Their commission rate and whether it is a percentage or a flat amount. |
| Affiliate earnings / Affiliate unpaid earnings | What they have earned in total, and what is still waiting to be paid. |
| Referral ID | The referral's numeric ID. |
| Referral amount | The commission earned. |
| Referral type / Referral status | Sale, opt-in or lead, and the status it has now. |
| Referral context | The source of the referral, such as woocommerce or edd. |
| Referral reference (order ID) | The order or record the referral was earned from. |
| Referral description | The description AffiliateWP saved with it. |
| Referral products | The products on the referral, as a readable list. |
| Referred customer email | The customer's email, when AffiliateWP recorded one. |
| Referral previous status | The status the referral had before the change. |
| User ID / Username / User email | The user the automation runs for: the affiliate, or the referred customer when Run for is set to the customer. |
| Display name / First name / Last name | Their name details. |
Conclusion
With the An affiliate's referral changes status trigger on Paid and the Add a row to a spreadsheet action, you get a payout ledger with no copying. To tell the affiliate at the same time, add a payout email.
FAQs
Is this free in Zapify?
No. AffiliateWP and Google Sheets are both Zapify PRO integrations and need an active Zapify PRO licence. Google Sheets also needs a Connection.
Does each payout row mean money was sent?
No. It means the referral was marked paid in AffiliateWP. Zapify records what AffiliateWP says and does not move money.
Can I add a date column?
Yes. Add a final Columns entry with a date token, or fill it in with a sheet formula.
Do I need to write any code?
No. Everything is configured visually in the Zapify builder.