Stripe (Other Methods)

If you're using Stripe Checkout API, follow this guide instead. If you're using Stripe Payment Links, follow this guide instead. Make sure you've connected your Stripe account to Humblytics first.

Use the JavaScript snippet below to track revenue after successful payment:

// Track revenue after successful payment (amount in cents)
window.Humblytics.trackRevenue(9999, "USD");

Pass the actual amount in cents and currency of the payment to the trackRevenue function.

Example Implementation

Let's say your customers are redirected to a /welcome page after completing a checkout. You want to fire the Humblytics payment event on this page. Using React, you can do this like this:

"use client";

import { useEffect } from "react";

export default function Dashboard({ user, order }) {
  useEffect(() => {
    // Convert dollars to cents if needed
    const amountInCents = Math.round(order.amount * 100);
    window.Humblytics.trackRevenue(amountInCents, order.currency);
  }, [order]);

  return (
    <div>
      <h1>Welcome to the app!</h1>
    </div>
  );
}

When to Use This Method

  • Third-party payment processors that use Stripe

  • Stripe Elements implementations

  • Mobile app payments

  • Custom checkout flows not covered by other methods

Important Notes

  • Works with any payment flow as long as you have the payment amount (in cents) and currency

  • Privacy-compliant - cookie-free tracking, no consent banners required

After receiving a successful payment, you should see revenue data in your dashboard (referrer, country, browser, etc.). If you don't, please contact us at [email protected].

Key Benefits

Benefit
Detail

Flexible implementation

Works with any payment flow

Manual control

Track payments exactly when you want

Privacy-compliant

Cookie-free tracking, no consent banners

Split test ready

Use revenue as conversion goals in 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 your target revenue amount or use "Any Revenue" for all purchases

  4. Launch your test - revenue will be automatically tracked

Troubleshooting

  • No revenue data appearing? Check that your Stripe account is properly connected

  • Missing attribution? Verify the amount (in cents) and currency are being passed correctly to the trackRevenue call

  • Need help? Contact [email protected] for assistance

Last updated

Was this helpful?