Ambassly

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

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.