JavaScript Referral Program Integration
Referral.js, Referral Rock's website script, tracks referral visits on every page and records each referred conversion with one short script.
About our JavaScript referral integration
Referral Rock is referral program software for businesses with teams. The Referral Rock JavaScript library, Referral.js, connects your referral program to your website, app and workflows.
JavaScript
- A website where you can add a script to every page's head
How JavaScript connects to Referral Rock
-
Referral.js loads on every page
The script sits in the head of every page of your site.
-
A friend arrives through a referral link
Referral.js tracks the referral visit and each return visit.
-
The friend converts
On your confirmation page, or right after a form submit, the conversion script sends the friend's details.
-
Referral Rock records the referral
The referral is created and credited to the customer who sent the friend.
- How Referral.js connects
- One script on every page of your site, plus a short conversion script where friends convert.
- What the conversion script sends
- Email or an external ID (one is required), name, an amount for purchase-based rewards, a status, and up to three custom text fields and two custom options.
- What Referral.js tracks on its own
- Referral visits and return visits, from the first page view.
- What Referral.js doesn't do
- Blocked cookies, including by cookie-consent tools, can stop a conversion from being recorded.
When teams use JavaScript with a referral program
Software companies
Record sign-ups in a single-page app
The conversion script can run any time after the page loads, so a sign-up that never reloads the page still counts as a referral.
Ecommerce brands
Reward a share of what the friend spent
Pass the order amount on your confirmation page, and percentage rewards are worked out from the real purchase.
Sites on any platform
Track referrals where no integration exists
If your form or checkout tool has no integration page, Referral.js and a conversion script on the confirmation page cover the gap.
Setting up Referral Rock with JavaScript
- 1
Copy your Referral.js script
YouIn Referral Rock, open Integrations and copy your unique Referral.js script.
- 2
Add the script to every page's head
YouAdd the script to the head of every page, through your host's settings, Google Tag Manager or a developer. Check with ?rrverify=1.
- 3
Turn on web conversions and add the conversion script
YouTurn on web conversions in your conversion settings, then set the conversion script on your confirmation page or after your form submits.
- 4
Test with the Integration Event Log
YouSend a test conversion with the referral code TESTID and check the details in the Integration Event Log.
Full steps: the JavaScript setup guide.
See a referral flow built based on your business
Give us your website. Our team builds you a referral flow from it, styled to your brand.
Yours to keep. No sales call.
How it works
- 1 We build a referral flow from your website, styled to your brand
- 2 We send you a link to preview it
- 3 See the experience you'd send your customers
JavaScript referral integration FAQs
Copy your unique script from the Integrations page in Referral Rock and add the script to the head of every page, through your host's settings, Google Tag Manager or a developer. Add ?rrverify=1 to any page to confirm the install.
Track referral visits on every page, and, with the conversion script, record each referred sign-up or sale with the friend's details and an amount. Referral.js also powers Member Access sharing experiences.
Install Referral.js on every page, add the conversion script where friends convert, and set your reward. Each referred conversion is credited to the customer who sent the friend.
Referral Rock is referral program software for businesses with teams. An advisor sets up your program with you on every plan, with no setup fee.
Many integration pages, like the form and website builder pages, run on Referral.js underneath. Where a platform has its own page, follow that page; where none exists, the conversion script fills the gap.
Not for the install: pasting one script into your site's settings is enough. The conversion script is short, but someone needs to fill in your page's values, such as the email field.
Yes. If cookies are missing or blocked, including by cookie-consent software, a conversion may not be recorded.
“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 onboarding help. Our team will help you configure the JavaScript integration and make sure everything is working perfectly. View the setup guide
Other popular integrations
More of the tools that connect to Referral Rock.
Ready to connect JavaScript?
Start your free trial and set up the integration. No credit card required.
Not ready to talk? See a free referral flow →