Ghost
Run a newsletter referral program in Ghost.org with Referral Rocket
Welcome to the help guide for the integration between Ghost.org and Referral Rocket. This powerful connection allows you to launch and manage a complete referral program for your newsletter, rewarding your subscribers for sharing your content and helping you grow your audience.
With this integration, you can:
Automatically Sync Subscribers: New Ghost members are seamlessly added to your Referral Rocket program.
Track Referral Links: Monitor exactly who is sharing your newsletter and how effective their efforts are.
Incentivize Sharing: Offer rewards, discounts, or exclusive content to your top referrers.
Grow Your Audience: Leverage word-of-mouth marketing to acquire high-quality, trusted new subscribers.
Use the guides below to get your referral program up and running in minutes.
Step 1 - Tracking Referrals
Create a new referral page in ghost where referred users will land. Add the sign up widget that allows to add labels on this page. Design this page as per your liking to increase the chances of conversion (ie user subscribing to your newsletter)

On this referral landing page, add the following javascript in the header. (This script is important to track the referral link) Note - Replace this with your campaign ID
//Add script to head tag
<script type="text/javascript" campaign-id="YOUR-CAMPAIGN-ID" defer src="https://app.referralrocket.io/widget/widgetIndex.js"></script>

Next, add the following script in the HTML page.

<script>
function getCookie(name) {
let nameEQ = name + "=";
let ca = document.cookie.split(';');
for(let i=0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) === 0) {
console.log(' found ' + c.substring(nameEQ.length, c.length));
return c.substring(nameEQ.length, c.length);
}
}
console.log('not found');
return null;
}
// Wait for DOM to be ready
function setFieldFromCookie() {
const cookieValue = getCookie('rr_referral_code');
if (cookieValue) {
// Try multiple possible selectors
const labelInput = document.querySelector('input[data-members-label="referral"]')
|| document.querySelector('input[name="labels"]')
|| document.querySelector('input[data-members-label]');
if (labelInput) {
labelInput.value = cookieValue;
console.log('Referral code set:', cookieValue);
} else {
console.warn('Input field not found');
}
}
}
// Run when DOM is ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', setFieldFromCookie);
} else {
setFieldFromCookie();
}
</script>Step 2 - Configuring your campaign
Copy the referral page link, add use that in the campaign configuration. This is the link referred users will land.

Step 3 - Setting up webhooks and integration
Follow the steps to integrate Referral Rocket with Ghost.org to automatically track referrals/sign ups.
Go to your integration settings in campaign and click on Ghost

Click Connect

Copy the Webhook link and head to Ghost.org
Create a webhook in Ghost.org
Add the link
Select "Member Added" event
Create a secret key


Copy the secret key and paste it into Referral Rocket.
Save
You are done connecting Referral Rocket with Ghost.org.
Last updated