What this integration can and can’t track
Read this before you start, so you know what to expect in your reports.Before you start
You’ll need:- A Referly program that’s live, with at least one affiliate you can test with. If you haven’t set that up yet, start with setting up your program.
- Admin access to your Memberstack dashboard.
- Access to your site’s custom code. On Webflow that means you need permission to edit Site settings.
- A Stripe account already connected to Memberstack, with your membership plans and prices set up there.
Open the Memberstack instructions in Referly
Everything you copy and paste in this guide is pre-filled with your program’s own details inside Referly, so start there rather than typing values by hand. In your Referly dashboard, open Settings from the left sidebar, then select Integrations. Find the card titled Memberstack With Stripe and select Instructions. Keep this window open in a browser tab for the rest of the setup. It contains your tracking script, your program’s own webhook address, and the exact custom field name, all filled in for you. The card is marked Medium difficulty because it involves pasting code, but you don’t need a developer for it.Add the Referly tracking script to your site
The tracking script is what notices that a visitor arrived from an affiliate link. It drops a small marker in their browser that lasts for the length of your cookie window, so a visitor who clicks today and signs up next week is still credited correctly. Copy the script from Step 1: Tracking clicks in the instructions window. It looks like this, with your own program’s identifier already in place ofYOUR_PROGRAM_ID:
- Webflow
- Any other site
- Google Tag Manager
Open your site settings
Paste into Head code
html, head, or body tags around it, as Webflow warns that this breaks the page layout.Save and publish
Create the custom field in Memberstack
Memberstack needs somewhere to store which affiliate sent a member. That’s what this field is for. The name has to match exactly, in all lowercase with no spaces or dashes, or Referly won’t find it.Open Custom Fields
Add a custom field
Hide it from your members
Save
pushLapAffiliateId, pushlap_affiliate_id, and pushlapaffiliateID all fail silently: Memberstack accepts them, but Referly never sees the value and no referral is created.Pass the referral into Memberstack
This is the piece that joins the two systems. When someone lands on your site from an affiliate link, the Referly script works out who referred them. This next snippet takes that answer and writes it into the member’spushlapaffiliateid field as soon as they’re signed in.
Copy this from Step 3: Send Affiliate ID to Memberstack in the instructions window, and paste it into your site the same way you pasted the tracking script, on every page that has Memberstack on it:
- Order matters. This snippet has to load after both the Referly tracking script and the Memberstack script, so put it last in your Head code field, underneath the tracking script. It waits for Referly to finish working out the referral before it does anything, and it does nothing at all for visitors who didn’t come from an affiliate link.
- The Memberstack script must be present. This uses Memberstack’s own front-end tools to update the member. On Webflow, Memberstack adds its script for you when the integration is enabled. On a custom site, make sure you’ve installed Memberstack’s DOM package first, following their Vanilla JS guide.
Connect Stripe to Referly
Memberstack takes payments through Stripe, which means Referly reads your revenue from Stripe directly. Without this step you’ll see referred members appear with no money attached to them, and your affiliates earn nothing. In the instructions window, go to Step 4: Connect Stripe and select Connect Stripe. You’ll be sent to Stripe to authorise the connection, then returned to Referly. Use the same Stripe account that Memberstack is connected to. If Memberstack is charging through one Stripe account and Referly is watching a different one, no payment will ever match a referral. For the full picture on what Referly reads from Stripe, see the Stripe integration.Add the Referly webhook in Memberstack
The last connection to make: Memberstack has to tell Referly when a member’s referral information has been filled in.Open Webhooks
Add an endpoint
Paste your address
program_id= is what tells Referly which program the members belong to, and one wrong character means nothing gets recorded.Name it
Referly Integration so you recognise it later.Choose the event
Save the endpoint
member.updated is the right event, not member.created. A brand new member exists for a moment before the referral is written into their profile, so it’s the update, not the creation, that carries the information Referly needs.Test it end to end
Don’t take it on trust. Run one real referral through the whole path before you tell your affiliates it’s live.Get a real affiliate link
https://your-site.com/?ref=their-code.Open it in a clean browser
Sign up as a new member
Check the member in Memberstack
pushlapaffiliateid column, or open the member’s profile. There should be a value in that field. If it’s empty, the connection between your site and Memberstack isn’t working, and nothing further will happen.Check the referral in Referly
Make a test payment
How Referly decides who gets the credit
Useful to understand when you’re looking at an unexpected result. When a visitor arrives on an affiliate link, Referly records that click and remembers it in their browser for the length of your cookie window. When they sign up, the snippet on your site writes that specific click into their Memberstack profile, and Memberstack passes it to Referly. Referly then looks up that exact click and credits the affiliate behind it. If the click can’t be found, Referly falls back to matching the value against your affiliates’ referral codes and credits whoever owns that code. That fallback is what keeps things working when a visitor clears their cookies mid-visit or takes an unusual path through your site. Referly also stores the member’s Stripe customer reference at this point. That’s the thread that connects every later payment, renewal, and refund back to the same referral, without needing Memberstack to tell it anything else. Once a member is credited to an affiliate, that credit sticks. Later clicks from other affiliates don’t take it over.Limitations to be aware of
- A member must exist in a browser to be tracked. Members you create yourself in the Memberstack dashboard, import from a file, or create through Memberstack’s admin tools never pass through your site, so there’s nothing to attribute. Add those referrals by hand instead, following adding a sale.
- The visitor has to sign up on the device they clicked from. Someone who clicks on their phone and signs up on their laptop won’t be matched.
- No revenue comes from Memberstack. Sign-ups arrive with no value attached. All amounts, renewals, and refunds come from Stripe, which is why the Stripe connection is required.
- Plan changes aren’t recorded as events. If a member moves from a free plan to a paid one, Referly sees the payment, not the plan change.
- Free-plan members show as referred customers with no revenue. That’s correct behaviour, and it’s how you measure sign-up volume per affiliate before anyone pays.
- Ad blockers and strict privacy settings can block the tracking script. A small share of clicks will always go uncounted for this reason, whatever tool you use.
- Coupon-based tracking isn’t available here. Someone who never clicks a link and only uses a code won’t be matched through Memberstack. If you rely on codes, see coupons and promo codes.
Troubleshooting
The custom field stays empty in Memberstack
The custom field stays empty in Memberstack
pushlapaffiliateid in lowercase. Check that both snippets are on the page where the member signs up, and that the referral snippet comes after the tracking script. Then check that you published your site after adding them, since custom code doesn’t run in the Webflow Designer preview.Also make sure you actually arrived on an affiliate link in that browser session. Without one, the snippet correctly does nothing.The field is filled in but no referral appears in Referly
The field is filled in but no referral appears in Referly
member.updated is selected under Message Filtering. Memberstack keeps a log of recent deliveries there, so you can see whether anything was sent and what came back.Referrals appear but with no revenue
Referrals appear but with no revenue
Clicks are counted but no members are ever created
Clicks are counted but no members are ever created
The wrong affiliate got the credit
The wrong affiliate got the credit
Everything worked in testing and then stopped
Everything worked in testing and then stopped