Install & setup
Three steps: add the snippet, add the webhook, pass the code into Checkout. Your company’s exact snippet and webhook URL (with your public id) are shown on your dashboard.
Quick start
1. Add the tracking snippet to your site’s head:
<script src="https://ambassly.com/a.js" data-ambassly="YOUR_PUBLIC_ID"></script>
2. In your own Stripe dashboard, add a webhook to your Ambassly hook URL with these events:
https://ambassly.com/api/hook/YOUR_PUBLIC_ID checkout.session.completed invoice.paid charge.refunded customer.subscription.deleted
3. Pass the referral (code + link + ts) into Stripe Checkout metadata:
const r = window.Ambassly?.getReferral?.(); // { code, link, ts }
stripe.checkout.sessions.create({
client_reference_id: r?.code,
metadata: {
ambassly: r?.code, // affiliate code
ambassly_link: r?.link ?? undefined, // per-content link token
ambassly_ts: r?.ts != null ? String(r.ts) : undefined,
},
});Guides
Install the Ambassly Tracking Snippet
Add a.js to your site, understand the ?via= referral cookie, and test that attribution is ready for Stripe Checkout.
Embed Affiliate Signup
Let visitors join your affiliate program from your own site with Ambassly's passwordless signup widget.
Pass Ambassly Referrals into Stripe Checkout
Copy-paste examples for sending Ambassly referral codes, link tokens, and click timestamps to Stripe Checkout Sessions and Payment Links.
Set Up the Stripe Webhook
Add Ambassly's per-company Stripe webhook endpoint, choose the required events, and understand signature verification and idempotency.
Ambassly Attribution Rules
The exact attribution, hold, clawback, and self-referral rules Ambassly applies to merchant Stripe events.
Ambassly MCP server
Connect Claude Code, Claude Desktop, or Cursor with scoped company or affiliate API keys.
Operate Ambassly from an AI Agent
What an AI agent can do with Ambassly today: live MCP server, scoped API keys, and dashboard-assisted workflows.
A note on Safari: tracking prevention caps client-set cookies to about 7 days, so a long developer-tool funnel can outlast the cookie. Passing the code into the Checkout Session (step 3) is the durable fix — once it’s on the session it never expires. We document this rather than pretend it away.