Revenue attribution
Attribute Stripe Payment Links
Add the visitor id to buy.stripe.com links as client_reference_id with a few lines of JavaScript, so Payment Link purchases are credited to their visits.
Stripe Payment Links (https://buy.stripe.com/…) accept a client_reference_id in the URL, and Stripe puts it on the Checkout Session. Add the visitor id to your links with a few lines of JavaScript, after the SuprAnalytics script:
<script>
document.addEventListener("click", function (e) {
var link = e.target.closest && e.target.closest('a[href^="https://buy.stripe.com/"]');
if (!link || !window.supr || !window.supr.visitorId) return;
var url = new URL(link.href);
url.searchParams.set("client_reference_id", window.supr.visitorId());
link.href = url.toString();
}, true);
</script>Then set up the Stripe webhook. SuprAnalytics uses a client_reference_id of 8 to 64 letters, digits, - and _ as the visitor id.
Payment Links for subscriptions: renewals aren't linked to the first payment's metadata, but SuprAnalytics still credits them to the same visitor through the Stripe customer id.
AI agent or LLM? Read this page as Markdown