Tracking Overview
Affitor tracking captures the complete customer journey—from the first click on an affiliate link to the final purchase.
How Tracking Works
Section titled “How Tracking Works”When a partner shares their affiliate link, Affitor tracks three key events:
| Event | What it captures | When it fires |
|---|---|---|
| Click | Visitor arrives via affiliate link | Page load with ?ref= parameter |
| Signup | Visitor registers or submits a form | Your signup form completion |
| Sale | Customer completes purchase | Stripe payment success |
Each event is linked together using tracking cookies, so you always know which partner drove which sale.
The Tracking Flow
Section titled “The Tracking Flow”graph LR A[Partner Shares Link] --> B[Customer Clicks] B --> C[Visits Site] C --> D[Signs Up] D --> E[Purchases]
A -.->|Unique ?ref= URL| A1[Unique link] B -.->|Cookie set| B1[Click tracked] C -.->|60 day cookie| C1[Cookie persists] D -.->|trackLead called| D1[Lead tracked] E -.->|Stripe metadata| E1[Sale tracked]Step by step:
- Partner gets unique link:
https://yoursite.com?ref=PARTNER123 - Customer clicks: Affitor script detects
?ref=parameter - Cookie stored:
customer_codesaved (60-days lifetime) - Customer browses: Cookie persists across sessions
- Customer signs up: You call
trackLead()withuser_id→ linked to customer - Customer purchases: Stripe metadata with
user_idcaptures sale → commission created
What You Need to Implement
Section titled “What You Need to Implement”Three integrations connect your site to Affitor:
| Integration | Purpose | Difficulty |
|---|---|---|
| Pageview Tracker | Track clicks from affiliate links | Easy – npm install or one script tag |
| Lead Tracking | Track signups and registrations | Easy – one function call |
| Payment Tracking | Track sales via Stripe | Medium – metadata setup |
Most advertisers complete all three in under 30 minutes.
Choose Your Integration Method
Section titled “Choose Your Integration Method”| Method | Install | Best for |
|---|---|---|
npm SDK (@affitor/tracker) | npm install @affitor/tracker | React, Next.js, Vue, any JS/TS app |
| Script tag | Copy-paste <script> tag | Static HTML, WordPress, no-build sites |
Both methods provide the same tracking functionality. The npm SDK adds TypeScript types, Promise-based loading, and React hooks.
Attribution
Section titled “Attribution”How Attribution Works
Section titled “How Attribution Works”Affitor uses last-click attribution with cookie-based tracking.
When a customer clicks an affiliate link:
customer_codecreated and stored in cookie- Customer-partner relationship created in database
- Cookie lasts 60 days
- Attribution window is 60 days from first click
- Any purchase within window credits that partner
Multiple Clicks
Section titled “Multiple Clicks”If a customer clicks Partner A’s link, then later clicks Partner B’s link:
- Partner B gets credit (last-click wins)
- Cookie is overwritten with new customer code
Tracking Data
Section titled “Tracking Data”What Affitor Captures
Section titled “What Affitor Captures”| Data | Source | Purpose |
|---|---|---|
customer_code | Auto-generated on first click | Identify visitor & link events together |
program_id | Your program ID | Route to correct program |
| Timestamp | Automatic | When event occurred |
| User agent | Browser | Analytics |
| IP address | Request | Fraud detection |
Cookie Storage
Section titled “Cookie Storage”| Cookie | Value | Lifetime |
|---|---|---|
customer_code | Unique visitor ID | 60 days |
Cookies are set automatically by the tracker script. No action required.
Privacy & Compliance
Section titled “Privacy & Compliance”GDPR Considerations
Section titled “GDPR Considerations”Affitor tracking uses first-party cookies on your domain. You should:
- Include in cookie policy: Mention affiliate tracking cookies
- Cookie consent: If required in your jurisdiction, include in consent flow
- Data retention: Tracking data follows your Affitor program settings
No Third-Party Tracking
Section titled “No Third-Party Tracking”Affitor doesn’t:
- Use third-party cookies
- Share data with ad networks
- Track users across other sites
Next Steps
Section titled “Next Steps”Set up tracking in order:
- Pageview Tracker – Capture clicks (5 minutes)
- Lead Tracking – Capture signups (10 minutes)
- Payment Tracking – Capture sales (15 minutes)