Chargebee analytics: revenue by channel
ProductLense connects to Chargebee and attributes every payment, refund and renewal to the channel, campaign and landing page that first brought the customer. Chargebee customers, subscriptions, transactions and credit notes, on Product Catalog 1.0 or 2.0.
Setup steps
- In Chargebee, open Settings → Configure Chargebee → API Keys and create a read-only key.
- In ProductLense, open Settings → Billing connections → Chargebee and paste the site name and key.
- In Chargebee → Settings → Webhooks, add a webhook endpoint with the URL ProductLense shows after you save the connection (pattern https://api.productlense.app/api/webhooks/{provider}/{connection_id}).
- Turn on basic authentication with a username and password and enter the same pair in ProductLense.
- ProductLense backfills 12 months of transactions and credit notes.
Credentials and permissions
| Field | Secret | Where to find it |
|---|---|---|
| Site name | No | The subdomain of your Chargebee site: {site}.chargebee.com. |
| API key | Yes, encrypted at rest | A read-only full-access key from Settings → Configure Chargebee → API Keys. |
| Webhook username | No | The basic-auth username you set on the webhook in Chargebee. |
| Webhook password | Yes, encrypted at rest | The basic-auth password you set on the webhook. |
Webhook
URL pattern, shown with your connection id after you save:
https://api.productlense.app/api/webhooks/chargebee/{connection_id}Events: payment_succeeded, payment_refunded, subscription_* (created, changed, cancelled and the rest), customer_* (created, changed)
Verification: Basic auth on the webhook URL, compared in constant time.
What ProductLense reads
- Customers
- Customers with email.
- Subscriptions
- Subscriptions on Product Catalog 1.0 and 2.0.
- Payments
- Payment transactions.
- Refunds
- Refund transactions and offline credit-note refunds.
- Fees
- Not available: gateway fees are not stored in Chargebee, so they are recorded as 0.
What ProductLense never touches
- Never creates, changes, refunds or cancels anything: read-only API calls and incoming webhooks only.
- Never moves money, issues payouts, or reads bank account details.
- Never sees full card numbers; providers do not expose them.
- Never sends your customer data to the AI model: Ask and the daily insight see aggregates only.
Match payments to your users
Set metadata or a custom field cf_pl_user_id on the customer to match by id.
Chargebee does not hold gateway fees. Connect either Chargebee or its gateway for a given payment, not both, so a payment is not counted twice.
curl https://YOUR_SITE.chargebee.com/api/v2/customers \
-u CHARGEBEE_API_KEY: \
-d email="a@b.com" \
-d meta_data='{"pl_user_id":"user_123"}'Chargebee and ProductLense: questions
- Does ProductLense work with Chargebee?
- Yes. ProductLense connects to Chargebee with site name, aPI key, webhook username, webhook password, backfills 12 months of history, and stays current through signed webhooks plus a nightly reconcile. One connection is included on Starter; Growth and Scale allow every provider at once on the same site.
- What data does ProductLense read from Chargebee?
- Customers, subscriptions, payments, refunds and fees, read-only. Payments: payment transactions. Refunds: refund transactions and offline credit-note refunds. Fees: not available: gateway fees are not stored in Chargebee, so they are recorded as 0.
- Can ProductLense change anything in my Chargebee account?
- No. ProductLense only makes read calls and receives webhooks. It never creates, changes, refunds or cancels anything, never moves money, and never sees card numbers. Credentials are encrypted at rest, and the AI features only ever see aggregated numbers, never your customers’ data.
- How does ProductLense match Chargebee payments to visitors?
- Set metadata or a custom field cf_pl_user_id on the customer to match by id. Your site calls identify with the same user id after signup, and ProductLense follows the payment to that visitor’s first touch: source, medium, campaign and landing page.
- Are Chargebee fees subtracted from revenue?
- Not available: gateway fees are not stored in Chargebee, so they are recorded as 0. Net revenue is the charge minus the fee; refunds subtract the refunded amount and its fee. Profit per channel then subtracts ad spend.
Connect Chargebee and see revenue by channel today.
Add the script, connect Stripe or any of 14 other billing providers, and see revenue by channel the same day.