For the complete documentation index, see llms.txt. This page is also available as Markdown.

Stripe API

Step 1: Connect Stripe to Humblytics

Before Humblytics can track your revenue, connect your Stripe account:

  1. Go to your Humblytics dashboard and open Site Settings

  2. Click the Revenue tab

  3. Select Stripe as your payment provider

  4. Choose Stripe API as the integration method

  5. Enter your Stripe API Key (see below for recommended setup)

  6. Save your configuration

For better security, we recommend using a restricted API key with read-only permissions instead of your full secret key:

  1. Click Create restricted key

  2. Give it a name like "Humblytics Revenue Attribution"

  3. Grant Read permissions for:

    • Payment Intents

    • Invoices

    • Subscriptions

    • Customers

    • Charges

    • Account

  4. Click Create key and copy it to Humblytics

Your API key is encrypted and stored securely. Restricted keys starting with rk_ are accepted and recommended for enhanced security. Full secret keys starting with sk_ also work but provide broader access than necessary.

Step 2: Add the humblytics_view_id Metadata

Tag your Stripe objects with a humblytics_view_id to link payments back to the visitor session. Humblytics looks for the first humblytics_view_id across these Stripe objects:

Stripe Object
When to Use

PaymentIntent

One-time payments or custom payment flows

Invoice

Payments generated from invoices

Subscription

Recurring payments and renewals

Checkout

Hosted checkout flows using Stripe Checkout

Customer

Apply the ID globally to future invoices/payments

💡 If you store the ID on a Subscription or Customer, Humblytics automatically applies it to future invoices and payments for that customer.

Frontend: capture the view ID

Backend examples

Attach the humblytics_view_id inside your server-side Stripe calls. Pick the object that matches your flow.

Step 3: View Attributed Revenue

After a payment succeeds, Humblytics automatically attributes the revenue to the correct visitor session—no webhooks or extra setup required. Review the revenue metrics (referrer, country, browser, etc.) in your Humblytics dashboard.

Key Benefits

Benefit
Detail

Automatic attribution

Revenue linked to visitor and campaign data

Flexible integration

Works with Checkout, PaymentIntents, Subscriptions, etc.

No webhooks needed

Metadata-based tracking keeps setup simple

Privacy-compliant

Cookie-free tracking, no consent banners

Split test ready

Use revenue as a goal in your Humblytics A/B tests

Setting Up Split Tests with Revenue Goals

  1. Create a split test on your main website

  2. Choose Revenue as your goal type

  3. Set a target revenue or select Any Revenue

  4. Launch the test - revenue is tracked automatically

Troubleshooting

  • No revenue data appearing? Confirm your Stripe account is connected to Humblytics.

  • Missing attribution? Ensure a humblytics_view_id metadata field is set on at least one supported Stripe object.

  • Need help? Reach us at support@humblytics.com.

Last updated