How to add referral and affiliate program in Memberstack using Referral Rocket Affiliate Software?
Hey Folks
Alot of you have inquired about integrating a referral/affiliate program in your memberstack site using Referral Rocket affiliate software. This is a simple guide that will take you through the steps
Prerequisites
- An active Memberstack account
- A Referral Rocket account
- Access to your website's code
Follow these steps
- Create an affiliate program in Referral Rocket and enable discounts
- Connect to Stripe
- Grab the campaign Id from the campaign created in Referral Rocket
- Add the tracking script to your Memberstack website's
<head>
section (on all pages the new user will visit). Do not forget to replace with your campaign Id
<script type="text/javascript" campaign-id="YOUR-CAMPAIGN-ID" defer src="https://app.referralrocket.io/widget/widgetIndex.js"></script>
5. Add and update this script after sign up is complete
<script>
const handleMemberSignup = ({ detail }) => {
const { memberInfo } = detail;
// Get campaign instance
const campaign = window.Rocket.getCampaign();
// Add the new member as a participant
campaign.addParticipant({
email: memberInfo.email
})
.catch(error => {
console.error('Error processing referral:', error);
});
}
// Listen for MemberSpace signup events
document.addEventListener('MemberSpace.member.info', handleMemberSignup);
</script>
More details - https://referral-rocket.gitbook.io/docs/integrations/memberspace
Comments
3 comments
Thanks for sharing this!!
For sure. Would it possible to add these steps as an integration guide in the integration section?
Let's keep it here for now and see what kind of demand it gets. Can you check-back with me in about 2-3 months?
Please sign in to leave a comment.