Integrating a Memberstack ID into the URL parameter for logged-in users on your Webflow website involves a few key steps. Here's how to do it:
<script>
MemberStack.onReady.then(function(member) {
if (member) {
const memberId = member["id"];
const currentUrl = window.location.href;
const newUrl = currentUrl.includes('?') ? ${currentUrl}&memberstack_id=${memberId} : ${currentUrl}?memberstack_id=${memberId};
window.history.replaceState({}, '', newUrl);
}
});
</script>
```
By adding a custom script within Webflow's custom code section, you can dynamically insert the Memberstack ID of logged-in users into the page's URL parameters. This involves using Memberstack’s onReady function to retrieve the member ID and modifying the current URL accordingly.