Install on Memberstack
Capture Memberstack signups via a post-signup convert event on your host platform. Memberstack is an overlay, so Rekomi installs on the host (Webflow, custom HTML, Duda), not in Memberstack itself.
Memberstack is an authentication and gated-content overlay, not a host. It sits on top of a host platform you control: Webflow, Duda, custom HTML, or another site builder. Rekomi installs on the host's head, not in Memberstack itself, because the head-script slot belongs to the host. The conversion fires on the post-signup page using Memberstack's client-side API (window.$memberstackDom) to read member data.
Install the head script on the host
Open your host platform's site-wide head code and paste the Rekomi script.
Webflow: Site settings > Custom code > Head code.
Custom HTML / static site: Paste in the shared template's <head>, before any other scripts that depend on member context.
Duda: Site Overview > Site Settings > Header HTML.
<script>
(function(){
var s=document.createElement('script');
s.src='https://js.rekomi.com/v1/rekomi.js';
s.async=true;
s.dataset.programId='YOUR_PROGRAM_ID';
document.head.appendChild(s);
})();
</script>Your program ID lives in Rekomi at Settings > Tracking. This script sets the affiliate click cookie on every host-domain page visit.
Configure the post-signup redirect destination
Memberstack lets you set where users go after signup. Rekomi needs that destination to be a page on your host platform so it can fire the convert event there.
In Memberstack: Dashboard > Plans > Default Settings > On Signup > set the redirect to a page on your host (e.g., /welcome, /app/onboarding). Avoid Memberstack-hosted URLs; the convert snippet needs to run on a page where your host's <head> (and Rekomi's script) is loaded.
If you have multiple plans with different post-signup destinations, configure each plan separately.
Fire the convert event on the post-signup page
On the destination page, add a Before-</body> custom code block. The snippet uses Memberstack's getCurrentMember() to read the new member's data and forwards it to Rekomi.
Webflow: Page settings (gear icon next to page name) > Custom code > Before </body> tag.
Custom HTML: Paste before the closing </body> of the post-signup page's template.
<script>
(async function(){
// Wait briefly for Memberstack's session to finish hydrating.
// Memberstack's getCurrentMember() can lag 100-300ms on cold loads.
await new Promise(r => setTimeout(r, 300));
if (!window.$memberstackDom) return;
const { data: m } = await window.$memberstackDom.getCurrentMember();
if (!m) return; // Not signed in (shouldn't happen post-signup, but safe).
// Find the active plan and map its id to an amount in cents.
// Memberstack doesn't expose plan price in the client SDK, so the
// map is hard-coded here (or rendered server-side from your plans config).
const PLAN_PRICES = {
'pln_basic-xxx': 1900, // $19.00/mo
'pln_pro-xxx': 4900, // $49.00/mo
};
const activePlan = m.planConnections?.find(p => p.active);
const amountCents = PLAN_PRICES[activePlan?.planId] || 0;
window.Rekomi.convert({
external_event_id: m.id,
amount_cents: amountCents,
currency: 'USD',
customer_email: m.auth?.email,
});
})();
</script>The external_event_id is the Memberstack member id, so retries are idempotent. Rekomi de-dupes on this field; a second call for the same member is a no-op.
Quirks worth knowing
Memberstack runs on a host platform. The Rekomi script always goes in the host's head, never in Memberstack's own admin panel. There is no "install Rekomi in Memberstack" option; Memberstack is the authentication layer, not the page renderer.
getCurrentMember() is async and can lag. On cold loads, Memberstack's session can take 100-300ms to hydrate after the redirect lands. The await new Promise(r => setTimeout(r, 300)) line gives it a buffer; without it, the call sometimes returns null even for a signed-in member. Adjust the delay if your testing shows races.
No per-plan price in the client SDK. Memberstack does not expose plan price client-side. You hard-code the price map (as shown above) or render the snippet server-side from your plans config. If your prices change, update the map at the same time you change them in Memberstack.
Multiple plans per member. A member can be on multiple plans simultaneously in Memberstack. The snippet above picks the first active plan; adjust the logic if you want to sum across plans or pick by priority.
SPA-style member areas. If your member-only pages are rendered in place (no full navigation between pages), the click cookie still applies because it was set on first visit to any host page. The convert snippet just needs to run on the post-signup page once per signup.
Refunds and subscription changes
Memberstack handles billing through Stripe under the hood. If your Memberstack account is on Stripe Connect with Rekomi-listening webhooks, refunds clawback automatically through the Stripe webhook rail. If you are on a Memberstack-managed billing setup that does not route through your Stripe, fire a refund S2S call from a Memberstack webhook handler to /api/tracking/refund with the same external_event_id from the original conversion.
Troubleshooting
Conversion does not appear after signup. Three likely causes: the head script is not installed on the page the affiliate sent the visitor to (cookie never set), the post-signup destination is a Memberstack-hosted URL (snippet never runs), or getCurrentMember() returns null because of the timing race (increase the delay).
Wrong amount on the commission. The PLAN_PRICES map in your snippet is out of sync with Memberstack's actual plan prices. Update both at the same time, or generate the snippet from a single source.
Member id appears as external_event_id but no commission lands. Confirm the affiliate cookie was actually set: open DevTools > Application > Cookies on the host domain and look for rekomi_referral. If it is missing, the visitor reached the signup page via a path that bypassed the head-script-bearing page.