> For the complete documentation index, see [llms.txt](https://docs.humblytics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.humblytics.com/how-to-track-purchase-events/stripe/stripe-other-methods.md).

# Stripe (Other Methods)

For Stripe Elements, tools built on Stripe, and any other flow: identify the buyer by email with one line of code.

{% hint style="info" %}
[Connect Stripe](/how-to-track-purchase-events/stripe.md) first. Using Payment Links or your own Stripe API calls? The [Payment Links](/how-to-track-purchase-events/stripe/stripe-payment-links.md) and [Stripe API](/how-to-track-purchase-events/stripe/stripe-api.md) methods are more precise.
{% endhint %}

## How it works

Tell Humblytics the buyer's email during their visit. When a Stripe payment arrives with the same email, Humblytics matches it to that visit.

```javascript
window.Humblytics.trackCustomer(customerEmail);
```

Call it on a page that loads the Humblytics script, as soon as you know the buyer's email. Right before you confirm the payment works well.

## Example: Stripe Elements

```jsx
const handleSubmit = async (event) => {
  event.preventDefault();

  // Link this visit to the buyer before paying
  window.Humblytics.trackCustomer(customerEmail);

  await stripe.confirmPayment({
    elements,
    confirmParams: { return_url: `${window.location.origin}/welcome` },
  });
};
```

## Use this method for

* Stripe Elements checkouts
* Third-party checkout or membership tools that process payments through your Stripe account
* Any flow where you know the buyer's email on your site

## Troubleshooting

* **Revenue, but no attribution:** the email you pass must match the email on the Stripe payment exactly.
* **Still stuck?** Email **<support@humblytics.com>**.
