LuriaDocs
Connect

Stripe

Count purchases on a non-Shopify site that checks out through Stripe, with one line of code or a thank-you page redirect.

plain textupdated 2026-08-19

If your store runs on Shopify, skip this page: purchases are counted by the Luria app automatically and Stripe never comes into it. This page is for everyone else, a custom site, a landing page builder, a course platform, anything that takes payment through Stripe Checkout or Stripe Elements.

Luria needs to know two things: that a purchase happened, and how much it was worth. You have three ways to tell it, from easiest to most robust.

Option 1: Send Stripe to a thank-you page (no code)

Luria automatically counts a purchase when a visitor lands on a URL containing /thank-you, /thank_you, or /orders/<id> on a non-Shopify site. So the simplest setup is to make Stripe send people to a page like that after they pay.

In Stripe Checkout, that's the success_url on your Checkout Session. Point it at your thank-you page:

https://yourstore.com/thank-you?session_id={CHECKOUT_SESSION_ID}

If you use Stripe Payment Links, set the confirmation page under After payment > Redirect to your website and enter the same URL.

Make sure the Luria snippet is installed on the thank-you page (it should be on every page; see Install on a custom site).

Limitation: auto-detection counts the conversion but does not know the order value, so revenue-based reporting will show the purchase without an amount. If you care about value, add Option 2.

Option 2: Call window.luria.convert on your success page (one line)

On your thank-you page, after the Luria snippet has loaded, call:

<script>
  window.luria.convert("purchase", 129.00);
</script>

Replace 129.00 with the order total in your store's currency. Most setups read the amount from the server when rendering the thank-you page, or fetch it using the session_id Stripe appended to the URL.

Guard against the snippet not being ready yet:

<script>
  (window.luria && window.luria.convert)
    ? window.luria.convert("purchase", 129.00)
    : (window.luriaQueue = window.luriaQueue || []).push(["convert", "purchase", 129.00]);
</script>

The full list of goals and values is in JavaScript events. If you also auto-detect via the URL, don't worry about double counting: Luria deduplicates a manual purchase call and an auto-detected one on the same page view.

Refreshes and back buttons

If a visitor reloads the thank-you page, the script runs again. Luria deduplicates repeated purchase events from the same visitor within a short window, so you won't see phantom orders. If you want to be strict, pass an order ID as a third argument: window.luria.convert("purchase", 129.00, { orderId: "cs_123" }).

Option 3: Connect Stripe for server-side confirmation (optional)

Browser-side counting misses a few purchases: the visitor closes the tab before the thank-you page loads, an ad blocker eats the script, a payment completes asynchronously. If you want Luria's purchase count to match Stripe's to the order, connect Stripe and let Luria confirm purchases from Stripe's webhooks.

Step 1: Connect in the dashboard

Dashboard > Connect > Stripe > Connect Stripe, then sign in and authorize read access. Luria asks for permission to read payment events only; it cannot create charges, issue refunds, or see full card numbers.

Step 2: Pass the Luria visitor ID to Stripe

Luria needs to link a Stripe payment back to the visitor who saw a variant. When you create the Checkout Session, add the Luria visitor ID as metadata. Read it from window.luria.visitorId on the page and send it to your server with the checkout request.

// server side, when creating the Checkout Session
metadata: { luria_visitor: req.body.luriaVisitorId }

Step 3: Verify with a test payment

Make a test-mode purchase. It should appear in Luria's conversion log within a minute, marked as confirmed by Stripe.

With Stripe connected, refunds are also reflected: a fully refunded order is removed from Luria's attributed count.

Which option should I use?

SituationUse
Landing page builder, no developerOption 1
You can edit the thank-you pageOption 2 (Option 1 as a fallback)
You want counts that match Stripe exactly, or refunds handledOption 3, plus Option 2 for instant dashboard feedback

Good to know

  • Subscriptions: count the first payment as the purchase. Renewals happen without a page view, so Luria only sees them via the Stripe connection.
  • Currency is your store's currency as set in the Luria dashboard. Pass amounts as plain numbers, no symbols.
  • Luria never touches your Stripe account settings, webhooks you already have, or your payment flow. If you disconnect, purchases keep counting through Options 1 and 2.

Next steps

On this page