Create an Affiliate Program with Memberful
Step-by-step guide to integrating affiliate tracking with your Memberful membership platform
Memberful is a membership platform that helps creators monetize their content through subscriptions and memberships. If you're using Memberful to manage memberships and want to grow through affiliate marketing, AffiliateBase provides seamless integration.
This comprehensive guide will walk you through everything you need to know about setting up an affiliate program with Memberful, from webhook configuration to tracking membership sign-ups, subscription purchases, and member upgrades.
Whether you're running a paid newsletter, offering tiered memberships, or selling access to exclusive content, an affiliate program can help you acquire new members while rewarding your partners for successful referrals.
Follow these steps to integrate AffiliateBase with Memberful:
Set Up Memberful Webhooks
https://api.affiliatebase.com/webhooks/memberful
Select Webhook Events
Add Webhook Secret to AffiliateBase
Configure Commission Rules
Pass Affiliate IDs to Memberful
Test the Integration
Memberful Webhook Handler Example
Here's an example of how to handle Memberful webhooks for affiliate tracking:
// Example: Next.js API route for Memberful webhooks
import { headers } from 'next/headers';
import crypto from 'crypto';
import { AffiliateBase } from '@affiliatebase/sdk';
const affiliateBase = new AffiliateBase({
apiKey: process.env.AFFILIATEBASE_API_KEY!,
});
export async function POST(request: Request) {
const body = await request.text();
const signature = headers().get('x-memberful-signature')!;
// Verify webhook signature
const expectedSignature = crypto
.createHmac('sha256', process.env.MEMBERFUL_WEBHOOK_SECRET!)
.update(body)
.digest('hex');
if (signature !== expectedSignature) {
return new Response('Invalid signature', { status: 401 });
}
const event = JSON.parse(body);
// Handle different event types
switch (event.type) {
case 'member.created':
// Only track if member has a paid subscription
if (event.data.member.subscription_id) {
await affiliateBase.trackConversion({
affiliateId: event.data.member.metadata?.affiliateId,
type: 'membership_signup',
amount: event.data.member.subscription?.price,
currency: event.data.member.subscription?.currency,
customerId: event.data.member.id,
subscriptionId: event.data.member.subscription_id,
metadata: {
plan_id: event.data.member.plan_id,
plan_name: event.data.member.plan_name,
},
});
}
break;
case 'subscription.created':
await affiliateBase.trackConversion({
affiliateId: event.data.subscription.metadata?.affiliateId,
type: 'subscription',
amount: event.data.subscription.price,
currency: event.data.subscription.currency,
customerId: event.data.subscription.member_id,
subscriptionId: event.data.subscription.id,
metadata: {
plan_id: event.data.subscription.plan_id,
plan_name: event.data.subscription.plan_name,
},
});
break;
case 'order.completed':
await affiliateBase.trackConversion({
affiliateId: event.data.order.metadata?.affiliateId,
type: 'order',
amount: event.data.order.total,
currency: event.data.order.currency,
customerId: event.data.order.member_id,
metadata: {
order_id: event.data.order.id,
subscription_id: event.data.order.subscription_id,
},
});
break;
case 'subscription.updated':
// Track subscription upgrades/downgrades
if (event.data.subscription.previous_price !== event.data.subscription.price) {
await affiliateBase.trackConversion({
affiliateId: event.data.subscription.metadata?.affiliateId,
type: 'subscription_upgrade',
amount: event.data.subscription.price - event.data.subscription.previous_price,
currency: event.data.subscription.currency,
customerId: event.data.subscription.member_id,
subscriptionId: event.data.subscription.id,
});
}
break;
}
return new Response(JSON.stringify({ received: true }), { status: 200 });
}
Why Use AffiliateBase with Memberful?
AffiliateBase is the perfect solution for Memberful users who want powerful affiliate tracking without complexity.
Native Memberful Integration
Built-in integration with Memberful webhooks. Automatically tracks membership sign-ups, subscriptions, and upgrades without custom code.
Subscription Lifecycle Tracking
Tracks subscription renewals, upgrades, downgrades, and cancellations. Ensures affiliates receive commissions for recurring revenue.
Multiple Membership Plans
Support for different commission rates based on membership plan or tier. Perfect for sites with multiple membership levels.
Real-Time Tracking
Track conversions in real-time as members join or upgrade. No delays or batch processing.
Affiliate Dashboard
Give your affiliates a professional dashboard to track their performance, view commissions, and generate affiliate links for your membership site.
Webhook Security
Built-in webhook signature verification ensures only legitimate Memberful events are processed, protecting your affiliate program from fraud.
Frequently Asked Questions
Does AffiliateBase work with Memberful? ▼
Yes! AffiliateBase integrates seamlessly with Memberful through webhooks. It automatically tracks membership sign-ups, subscription purchases, and membership upgrades.
How are membership sign-ups tracked? ▼
AffiliateBase tracks Memberful memberships through webhooks. When a member joins your site via an affiliate link, the member.created or subscription.created webhook triggers affiliate tracking and commission calculation.
Can I track subscription renewals? ▼
Yes! AffiliateBase tracks Memberful subscription renewals automatically through the order.completed webhook. When a member's subscription renews, the original affiliate receives commission for the renewal, ensuring they're rewarded for recurring revenue.
What happens when a member upgrades or downgrades? ▼
AffiliateBase tracks membership changes through the subscription.updated webhook. The original affiliate maintains attribution, and commissions can be calculated based on the upgrade amount or new subscription level.
Can I set different commission rates for different membership plans? ▼
Yes! You can configure different commission structures in AffiliateBase based on membership plan, tier, or price. This gives you full control over your affiliate program.
How do I add affiliate tracking to my Memberful sign-up URLs? ▼
Add affiliate tracking parameters to your Memberful sign-up URLs (e.g., ?ref=AFFILIATE_ID). AffiliateBase will capture these parameters and attribute conversions correctly when members join.
Do affiliates get their own dashboard? ▼
Yes! Affiliates get access to a professional dashboard where they can view their conversions, commissions, performance metrics, and generate affiliate links for your membership site.
Related Platform Guides
Create an Affiliate Program with MemberPress
Complete guide to setting up an affiliate program with MemberPress. Track membership sign-ups, renewals, and upgrades using AffiliateBase and Stripe integration.
Create an Affiliate Program with Memberstack
Complete guide to setting up an affiliate program with Memberstack. Track membership sign-ups, subscriptions, and upgrades using AffiliateBase and webhooks.
Create an Affiliate Program with Next.js
Complete guide to setting up an affiliate program in Next.js. Step-by-step integration with code examples and best practices for Next.js developers.
Create an Affiliate Program with Nuxt
Complete guide to setting up an affiliate program in Nuxt. Step-by-step integration with Nuxt 3, server routes, and composables for Vue developers.
Create an Affiliate Program with WordPress
Complete guide to setting up an affiliate program in WordPress. Step-by-step integration with plugins, themes, and Stripe for WordPress SaaS and membership sites.
Ready to Launch Your Memberful Affiliate Program?
Get started with AffiliateBase today and start growing your Memberful membership site through affiliate marketing.