How to Add a Referral Widget to Your Website

A referral widget turns your website into a quiet sales channel — a small on-page element that invites happy customers to share your business and rewards them when a friend buys. Most small-business owners assume this requires a developer, but in practice it’s closer to pasting a script tag.

This guide walks through the actual steps: choosing a referral platform, getting your embed code, and placing it correctly depending on whether you run Shopify, WordPress, Webflow, Squarespace, Wix, or a custom-built site.

Quick Answer

Sign up with a referral platform (options like ReferralCandy, Friendbuy, Referral Factory, or Partnero), create a referral program in their dashboard, then copy the widget’s embed script and paste it into your site — usually just before the closing tag, or into your builder’s custom-code or embed block. Publish the page and test the widget before promoting it.

Step-by-Step: Installing a Referral Widget

Pick a referral platform first. The right choice depends on what you sell: ecommerce stores typically lean toward ReferralCandy, Friendbuy, or Yotpo’s referral tools, while service businesses, SaaS, and agencies often use more general-purpose builders like Referral Factory, Partnero, or ReferralHero. Most offer a free trial, so you can test the widget on a staging page before committing.

Set up your referral program before touching any code. In the platform’s dashboard, define the reward (store credit, a discount code, cash, or a free item), write the referral messaging, and preview the widget’s look — most platforms let you adjust colors and copy to match your brand.

Copy the embed script. This usually lives under a section named something like ‘Widgets,’ ‘Promote Your Campaign,’ or ‘Installation.’ It’s typically a short snippet of JavaScript you paste once; the widget itself renders dynamically after that.

Place the code on your site. If you’re on a platform that lets you edit raw HTML, add the script right before the closing tag — this is the standard spot for floating or pop-up widgets so they don’t block the rest of the page from loading. Some platforms (like Partnero’s site-wide snippet) instead ask you to place their tag before the closing tag, so check your platform’s specific instructions.

On no-code builders, use the embed block instead of raw HTML editing. In Webflow, drag an Embed element onto the page (or add it site-wide) and paste the script into its code editor. In Squarespace, add a Code block to the page and paste it there. In Wix, go to your site’s custom code settings, add the script, and set it to load in the page Head across all pages. On Shopify, many referral apps skip code entirely — install the app, then add the referral widget as an app block through the theme editor’s Add Block / Add Section menu.

Publish and test. Open your live site in an incognito or private window, confirm the widget appears and opens correctly, and walk through a test referral end-to-end if the platform allows it — generate a link, open it in another browser, and confirm the reward triggers.

Where to Place It for Best Results

Widget placement matters more than most people expect. A floating widget in a bottom corner (common with ReferralCandy and similar tools) stays visible without interrupting browsing, which tends to generate more organic clicks than a widget buried on a dedicated ‘Refer a Friend’ page nobody visits.

High-intent pages work best: the post-purchase confirmation page, the account/order-history page, and the footer of your homepage are the spots where customers are already thinking positively about your business. Avoid stacking more than one referral widget on a single page — platforms like ReferralCandy explicitly recommend using only one per page to avoid confusing visitors or conflicting scripts.

If you run email or SMS alongside your site, add the same referral link or widget to post-purchase emails and receipts. The website widget catches browsing traffic; email catches people after they’ve already had a good experience.

Tips / Common Mistakes

Don’t skip the test referral. It’s common to publish a widget, confirm it visually loads, and never actually click through a test link — only to find weeks later that the reward never fired because of a configuration error.

Check that your platform actually allows custom code. If you’re on a locked-down website builder or an older CMS without HTML/JavaScript access, you may need to hand the script to whoever manages your site, or choose a referral platform with a native plugin/app for your specific platform instead of a raw embed.

Keep the reward simple and visible in the widget copy itself — vague language like ‘get rewarded’ converts worse than a specific, concrete offer stated right in the widget.

Mobile-check it separately. A widget that looks fine on desktop can cover navigation or a checkout button on mobile; always preview on an actual phone before calling the install done.

Explore more: More referral marketing guides.

Referral widget installation FAQs

Do I need a developer to add a referral widget?

Usually not. Most referral platforms give you a short embed script and clear instructions for Shopify, Webflow, Squarespace, Wix, and WordPress. You only need developer help if your site has a custom, highly restricted codebase or no custom-code access at all.

Where should the referral widget code go on the page?

For most floating or pop-up widgets, place the script right before the closing tag. Some platforms use a site-wide snippet that instead goes in the section — always follow the specific platform’s install guide since this varies.

Can I use a referral widget on Shopify without editing code?

Yes. Most Shopify-focused referral apps let you add the widget as an app block directly in the theme editor, with no manual code editing required.

Where on my site will a referral widget perform best?

Post-purchase/confirmation pages, account pages, and your homepage footer tend to outperform a standalone ‘refer a friend’ page, since customers see them while already engaged with your business.

Turn Customers Into Your Growth Engine

Launch a referral program that turns happy customers into your best growth channel — with ReferralEarl. Try ReferralEarl.

Want this in your inbox? Subscribe to the free newsletter.

Photo by Team Nocoloco on Unsplash.