Test your setup
Testing Integration
Verify click, signup, and server-side tracking before going live
Before going live, verify each layer in order to confirm that your identifiers, metadata, and revenue path line up correctly:
- click tracking
- signup/lead tracking
- sale tracking
The synthetic verification chain
Once your tracking code is live on your public site, Affitor detects it automatically (no debug mode required). Go live publishes the program once its business details, commission and payments are set (what each needs). It does not test your integration, and the sale in the synthetic chain below does not count as your payment connection: with the Server API, the sale that unlocks Go live has to come from your server.
To check the whole pipeline without a real customer, run the synthetic click → signup → sale chain through Affitor's real attribution and commission pipeline, with no real money. Three ways run it:
- Run check under Check Affitor's tracking on the Payments step of setup, once payments are connected (Stripe connected, or with the Server API, a first sale received from your server)
npx affitor onboard, which fires the chain and then polls readiness untilintegration_verifiedis reached (see CLI commands)- the MCP
affitor_run_verificationtool, followed byaffitor_readiness
affitor test click|lead|sale sends one test event at a time; it does not run the chain.
The chain needs an active commission policy (so the synthetic sale can produce a commission). Set your commission first, then run it. Limited to 10 runs per program per hour.
The manual, per-layer checks below are optional — useful when you want to confirm a specific layer is firing in the browser.
1. Test Click Tracking (optional, manual)
Tracker debug mode
Enable debug mode in your tracker install.
Script tag:
<script
src="https://api.affitor.com/js/affitor-tracker.js"
data-affitor-program-id="YOUR_PROGRAM_ID"
data-affitor-debug="true">
</script>What to verify
- the tracker script loads successfully
- the page can set/read Affitor cookies
- click/pageview-related requests are visible in the browser
- your dashboard shows test/debug activity for the pageview step
When testing with real affiliate links, remember that a real ?aff= flow can still create real attribution data. Use test/debug guidance carefully and avoid mixing production referral links into synthetic tests unless that is your intent.
2. Test Lead Tracking
Browser-side signup test
After a successful signup in a tracked browser session, call:
await window.affitor.signup('user_123', 'user@example.com');Verify that:
- the same internal ID you passed as
customerKeyis the one you plan to reuse later - the tracker emits the expected network/debug activity
- the dashboard/test-event view reflects lead test activity where applicable
Server-side lead API test
curl -X POST https://api.affitor.com/api/v1/track/lead \
-H "Content-Type: application/json" \
-d '{
"click_id": "test_lead_001",
"customer_key": "test_customer",
"additional_data": {
"test_mode": true,
"program_id": "YOUR_PROGRAM_ID"
}
}'Expected response:
{
"success": true,
"message": "Test lead event tracked successfully",
"data": {
"eventId": 456,
"programId": 1,
"test_mode": true
}
}What test mode means for leads
- creates a test lead event only
- does not create a production lead/customer progression
- helps verify that your program ID and endpoint wiring are correct
3. Test Sale Tracking
You can test sale tracking in two different ways depending on your implementation: server-side tracking vs Stripe integration.
Option A — Test Server-side tracking
curl -X POST https://api.affitor.com/api/v1/track/sale \
-H "Authorization: Bearer YOUR_PROGRAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"additional_data": { "test_mode": true },
"amount_cents": 9999,
"currency": "USD",
"sale_type": "payment"
}'Expected response:
{
"success": true,
"message": "Test sale event tracked successfully",
"data": {
"eventId": 789,
"programId": 1,
"test_mode": true
}
}What test mode means for sales
- still requires the Bearer token
- creates a test sale event only
- does not create commissions
- does not create platform fees
- does not update production metrics
Option B — Test Stripe integration
If you use Stripe Checkout:
- switch Stripe to test mode
- complete a test checkout
- check that the program's Stripe card under Program settings › Payments reads Connected. Affitor receives the events through Stripe Connect, so there is no webhook delivery to verify on your side
- inspect the metadata on the checkout/payment objects
Check that metadata includes:
program_idaffitor_click_idaffitor_customer_key
For subscriptions, also confirm the same values exist in subscription_data.metadata.
4. Verify Test Events Were Received
Each test-mode call above answers with "test_mode": true and an eventId when the event was recorded, so the response is your first check.
The dashboard also looks up recent test events through POST /api/tracking/check-test-events, for every step or for one (pageview, referrals or payments). It is a dashboard endpoint: it needs a signed-in dashboard session from someone on the program's team with the Member, Admin or Owner role (a Viewer is refused) and does not accept a program API key, so you cannot call it from your backend.
5. Recommended Real-World Test Scenarios
Scenario A — Full tracked funnel
- open a fresh browser session
- land through an affiliate link
- sign up
- complete payment
- verify click → lead → sale linkage
Scenario B — Server-side tracking path
- complete a backend-controlled purchase
- send
POST /api/v1/track/sale - verify the response contains
sale_idandcommission_id - confirm no duplicate retries reuse the same
transaction_id
Scenario C — Stripe subscription path
- create a Stripe Checkout subscription in test mode
- ensure
subscription_data.metadatacarriesaffitor_click_idandaffitor_customer_key(Affitor reads the subscription's invoices, which carry it, not the session'smetadata) - check that the subscription's first payment appears under Commissions, marked Test
- confirm your renewal setup will preserve those identifiers
Common Failure Modes
Lead works but sales do not attribute
Usually caused by one of these:
customerKeyat signup does not match the later payment identifier- Stripe metadata uses the wrong customer key
transaction_idis duplicated or missing in the server-side tracking path- no tracked click/customer relationship exists for the customer
One-time Stripe works but renewals do not
Usually caused by:
- missing
subscription_data.metadata: the subscription's invoices carry it, not the checkout'smetadata, so the first subscription payment never sees the click (renewals follow the first payment) - relying only on initial checkout metadata
- mismatched customer key between signup and Stripe metadata
Dashboard status is confusing
The dashboard combines:
- test event presence for click/lead verification
- Stripe connection/configuration state for payment setup
- real sale events for broader integration completeness
Treat dashboard status, test-event checks, and the payments in your Stripe Dashboard as complementary signals: no single source is the full picture.
Before You Send Partner Traffic
Go live itself needs only business details, commission and payments (Go live). Before partners start sending traffic, confirm all of the following:
- tracker installed on all landing pages
- signup tracking sends a stable internal customer ID
- Server-side tracking or Stripe integration path is fully implemented
- Stripe subscription metadata is duplicated correctly when relevant
- one end-to-end test has succeeded with the exact path you will use in production
Related guides: