Stripe Buy Button
Track affiliate referrals through an embedded Stripe Buy Button.
Embed the button from Stripe
Complete Connect the Stripe account and Install the browser script on the Stripe Payment Links and embeds overview. Keep the same workspace ID on the referred landing page and on the page containing the checkout control.
- In Stripe, open a Payment Link and choose Buy button. Configure it and copy the generated embed.
- Paste Stripe’s script and stripe-buy-button element onto your page. Keep the generated button ID and publishable key.
- For a one-time purchase, configure the underlying Payment Link to create a Stripe customer.
<script async src="https://js.stripe.com/v3/buy-button.js"></script>
<stripe-buy-button
buy-button-id="buy_btn_YOUR_ID"
publishable-key="pk_YOUR_PUBLISHABLE_KEY">
</stripe-buy-button>See what gets passed to Stripe
Enable hosted checkout tracking in the Monok snippet. Monok sets client-reference-id on the stripe-buy-button element once referral capture finishes and also handles buttons your app mounts later. Leave that attribute unset or empty so Monok can fill it. Stripe sends it as client_reference_id in the Checkout Session.
Verify the button and payment
In the offer’s Affiliate integration setup, run Test browser script. This verifies that the page can capture attribution without creating an affiliate click or referral. Then open a valid affiliate link in a fresh browser session and complete the method-specific checks below. A Stripe sandbox payment does not earn a commission.
- In DevTools, inspect the outer stripe-buy-button element on your own page. Look for client-reference-id with an mk2_ value.
- Click the Buy Button, complete checkout, and confirm the Stripe session has the matching client_reference_id. Then verify the referred customer and the eligible payment in Monok.
- If the button shows but the attribute is missing, confirm the Monok script runs in the same document as the embed and that your page did not supply a non-empty client-reference-id.
