Polar Other Methods
Track and attribute revenue in Faurya for Polar Other Methods.
Faurya can automatically attribute revenue to sessions, campaigns, and sources by connecting your payment flow to your Faurya site. This guide shows the safest, most reliable way to do that with Polar.
What “revenue attribution” means in Faurya
When a visitor lands on your site, the Faurya script assigns a Visitor ID and Session ID. When the visitor starts checkout, you pass those IDs (or the Faurya attribution token) into your payment provider. When the payment succeeds, your server (or webhook handler) confirms the payment and notifies Faurya. Faurya then ties the purchase back to the original session and attributes revenue to the right channel.
Other methods
Common scenarios:
- Subscription renewals
- Upgrades/downgrades
- Refunds and partial refunds
What to record in Faurya
- For renewals: record each paid invoice/renewal as a separate “purchase” event
- For refunds: optionally record a “refund” event (negative amount) so revenue charts net out
Idempotency (do this to avoid double counting)
Always make your revenue writes idempotent:
- Use a unique
orderIdfrom your DB or - Use the provider’s unique payment/transaction ID as the idempotency key
- Store a “revenue_recorded_at” timestamp on your order row so repeated webhook deliveries don’t duplicate revenue
Troubleshooting
Revenue shows as “unattributed”:
- Make sure you are passing
faSessionIdorfaAttributionTokenfrom the browser to your server when you create checkout. - Confirm your checkout/session metadata includes that value.
- Confirm your webhook handler reads it back and sends it to Faurya.
Revenue is duplicated:
- Ensure you’re not recording revenue both on “return URL” and on webhook.
- Add idempotency using
orderId/ provider transaction ID.
Currency or amount looks wrong:
- Decide one convention (minor units recommended) and keep it consistent.
- Always store currency codes in ISO 4217 (USD/INR/EUR).