Embeddable Referral Widget
Add a referral-code field to your website so visitors can attribute their booking or checkout to an affiliate.
The embeddable widget adds a compact referral code input to your own website -- for example on a booking or checkout page. Visitors enter an affiliate's code; ViralRef validates it and stores attribution for later.
It is not a full affiliate signup form. For signup, send people to /ref/{code} or /join.
What the Widget Does
The widget is a small iframe that:
- Lets a visitor type a referral code
- Validates the code against your organization
- On success, shows the affiliate's name and sets a
ref-codecookie for attribution
Paste it where you want the referral field to appear (booking flow, landing page, etc.).
Getting the Embed Code
- Go to Settings > Organization > Developers
- Find the Embed code card
- Copy the iframe snippet
The snippet looks like:
<!-- ViralRef Referral Widget -->
<iframe
src="https://your-subdomain.viralref.com/widget/referral?org=your-slug"
style="border:none;width:320px;height:80px;"
title="Referral Code"
loading="lazy"
></iframe>Optional: append &color=%23HEX to match your brand accent (the Developers card includes your accent when set).
Adding the Widget to Your Site
Paste the iframe into any HTML page -- WordPress, Squarespace, Wix, custom HTML, or any platform that allows embeds.
Keep the iframe size close to 320×80 so the field and button fit without scrollbars.
What Visitors See
- A single referral-code field and submit control
- Success state with the affiliate's name when the code is valid
- An error message when the code is invalid
After a valid code, the ref-code cookie (30-day, SameSite=Lax) helps attribute a later signup or purchase to that affiliate.
Customization
- Organization slug is required in the query string (
org=) - Accent color can be passed as
color(hex, URL-encoded) - Preview the live field from the Developers embed card before publishing
Where to Use the Widget
- Online booking pages
- Checkout or "request appointment" forms
- Landing pages where someone already knows a friend's code
For recruiting new affiliates, link to /join or share /ref/{code} instead.
Next Steps
Affiliate Screen
How affiliates verify, share, and track on /ref.
Tracking Conversions
How referral attribution turns into rewarded purchases.