'Webflow Onboarding Redirect | (Using Memberstack)

I have a Dashboard Application in Webflow and I use Memberstack for User and Permissions.

Now the Issue I have is the following: I'm creating a new Memberstack User with Zapier, then I'm logging into Webflow with the new created User and it opens the Dashboard page. The Issue is, that I want, if a user loggs in for the first time, to redirect them to another page called "Onboarding".

My approach was to solve it in Memberstack, but it doesn't seem to work when I create the User with Zapier. Then I tried to find a solution in Webflow, to create a redirect if a Variable in the CMS Item is not set (For example "onboarding" = false).

Can someone help me to make this work?



Solution 1:[1]

Let me know if this works! I adapted some code I had which also will add the first time the member logged in to their Memberstack metadata.

Try adding this code before the site-wide </ body > tag:

<script>

MemberStack.onReady.then(async function(member) {

  // if member is logged in
    if(member.loggedIn){

        var first_logged_in_timestamp = member["first-logged-in-timestamp"];
        if(first_logged_in_timestamp === undefined || first_logged_in_timestamp == null || first_logged_in_timestamp.length < 1)
            {     // set first-logged-in-timestamp
            var first_logged_in_timestamp = timestamp;

            member.updateProfile({
                "first-logged-in-timestamp": timestamp,
                }, false)
            }  

        window.location.href='https://RedirectHereIfFirstLogIn.com'; 
    }
    else{
        window.location.href='https://RedirectHereIfNotLoggedIn.com';
    }
}

</script>

Solution 2:[2]

I am having the same problem here. It seems Memberstack doesn't have an off-the-shelf solution for that, but there are people setting timeouts to let Zapier to its thing before redirecting the user. As you can see right here:

https://forum.memberstack.io/t/member-specific-page-after-signup/1282

I've tried their suggestions in this post but they're not working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris Lally
Solution 2 Lucas Piccoli Weinmann