Install RelayWonder

Start with how you take payments. Subscriptions connect through Stripe; online stores through Shopify. Once connected, every payment a partner brings in earns commission automatically.

  1. 1

    Add the tracking script

    Drop this in the <head> of every page. It reads the ?via= parameter, writes a first-party cookie on your own domain, and reports the click.

    html
    <script async src="https://cdn.relaywonder.com/rw.v1.js"
      data-program="prg_moody"></script>
  2. 2

    Pass the referral into Stripe

    When you create a Checkout Session on your server, pass the cookie the script set (rw_ref). That’s the link between a click and an invoice.

    javascript
    // 服务端(Node / Stripe SDK)
    // rw_ref 是追踪脚本写在你自己域名下的第一方 Cookie
    const session = await stripe.checkout.sessions.create({
      mode: 'subscription',
      line_items: [{ price: 'price_xxx', quantity: 1 }],
      success_url: 'https://moodywonder.com/welcome',
    
      // 这一行就是点击与发票之间的那根线
      client_reference_id: req.cookies.rw_ref,
    })
  3. 3

    Connect Stripe

    One OAuth authorisation. Read-only plus webhooks — we never touch your balance or move money.

Events we listen for

  • checkout.session.completedBinds the visitor to a Stripe customer
  • invoice.paidCreates a commission — first payment and every renewal
  • charge.refundedWrites a negative commission record
  • charge.dispute.createdSame, for chargebacks
  • customer.subscription.deletedStops future recurring commission

Verify it works

Open your site with ?via=test appended. If the cookie is set and a click appears in your dashboard within a few seconds, you're done.

On WooCommerce, Paddle or a custom checkout? Not supported yet. Contact us about the API.

Install tracking: one script and one checkout line · RelayWonder