Referral Rock

JavaScript Referral Program Integration

Embed Referral Rock on any website using the JavaScript SDK for custom referral tracking, sharing widgets, and member portal experiences.

About Our JavaScript Referral Integration

JavaScript logo

JavaScript

JavaScript Snippet

Embed Referral Rock on any website using the JavaScript SDK for custom referral tracking, sharing widgets, and member portal experiences.

What it does
Share | Track
Category
Other
Documentation
View Setup Guide
Plans
Available with all Referral Rock plans
Data Privacy
When using this integration, it's up to you to comply with applicable laws and regulations, as well as Referral Rock's Terms of Service and Privacy Policy.

Referral Rock provides a robust JavaScript Library to directly integrate your referral program with your online assets and workflows.

How the JavaScript Integration Works

1

Embed the JS library

Add the Referral Rock JavaScript library to your site or app with a single script tag. A few lines of code is all it takes to get started.

2

Capture referral events on your page

Fire tracking events on any conversion: page load, form submit, checkout, or custom triggers. Referral Rock attributes each event to the right referrer.

3

Embed the member portal in-app

Render the Referral Rock member portal or share widget directly inside your own platform for a fully on-brand, seamless sharing experience.

4

Reward based on on-page events

Rewards issue automatically when a tracked conversion event fires, no backend changes required for standard reward flows.

Embed the referral experience directly into your own site or app

Control the brand experience for all your referral program participants. Add Referral Rock links and direct sharing features into your own platform.

Add new referrals to your program

Create referrals based on on-page conversion events, values in the page's URL string, and even pages where you can't insert JavaScript.

Trigger rewards based on changes

Fully automate your referral program from start to finish, without interrupting your CRM users or sales team. Referral Rock will issue rewards based on on-page referral update events placed on confirmation pages.

Track site visits

Measure the amount of traffic members are generating so you can analyze conversion rates and better optimize your program.

JavaScript Referral Integration — FAQ

You add the Referral.js snippet to your site or app with a single script tag, then call its methods to track conversions or render referral UI. Step-by-step installation instructions are in the Referral.js SDK documentation.
Referral.js lets you capture referral events on any page (page load, form submit, checkout, or custom triggers), create referrals from on-page events or URL parameters, embed the Member Portal or Share Widget directly in your platform, and measure the traffic your members generate, all client-side, with no backend changes for standard flows.
Many of our platform integrations, including Shopify, WooCommerce, Webflow, Wix, Squarespace, and most form builders, use Referral.js under the hood to track conversions. If you're connecting one of those specific platforms, the exact snippet placement and setup are covered in that platform's own integration documentation. This page covers the underlying library for custom or direct implementations.
It takes minimal dev resources. Pasting the snippet and tracking a simple conversion is straightforward, but custom event tracking or embedding the portal in your app is best handled by a developer. Concierge Onboarding is available on all plans if you'd like hands-on help.
The full Referral.js SDK reference, covering installation, tracking methods, and embedding options, is available in our Referral.js SDK documentation.
“Their integrations, their obsession to be on the leading edge of their niche, the overall customizability... All in all, I saved thousands by not needing to build an app or sign up for a long-term contract.”

Need help setting up?

Every Referral Rock plan includes dedicated onboarding support. Our team will help you configure the JavaScript integration and make sure everything is working perfectly. View the setup guide →

Ready to Connect JavaScript?

Start your free trial and set up the integration in minutes. No credit card required.