Member-specific page button missing after sign up

Upon logging in, I have a blank page with a button that takes members to their member-specific page. However, I don’t want members to ever see this page because it’s just a blank page with nothing but that button. To do this, I turned on the option in MemberStack to automatically redirect members to their member-specific page after they log in, which works perfectly.

However, it doesn’t seem to work after my members sign up. Upon signing up, new members are taken to that blank page WITH THE BUTTON HIDDEN. As far as I can tell, perhaps MemberStack doesn’t yet recognize that they are a new member because they just barely signed up. Because MemberStack still thinks they are a non-member, the button is hidden from them. If the new member refreshes that page, the button shows up.

Is there a way to have that button NOT be hidden after a new member signs up? Or even better, is there are way to automatically redirect new members to their member-specific page just like it does when old members log in?

Hi Alan!

Currently, members can’t be redirected directly to their specific page on signup. The reason for this is because immediately after signing up, MemberStack doesn’t know what their page is. MemberStack has to wait for Zapier to set the page before it’s aware of it. That’s why members will always be sent to your “Page After Signup” link under your membership settings.

This also explains the missing button problem as well. When the member first lands on the blank page, MemberStack still doesn’t know what their specific page actually is. After you refresh the page, Zapier has had enough time to set the page in MemberStack which is why the button then appears.

One possible solution is to add a message to your blank page that says something along the lines of “We are setting up your account, please refresh your page in 5 seconds.” Another option would be to add a loader to the page, and after 5 seconds use JS to refresh the page. Or even better, use JS to refresh the page, and then automatically redirect the user to their specific page.

@DuncanHamra have you seen any other solutions for this?

1 Like

Thanks @belltyler. I figured that was the issue. I tried putting in JS code to refresh the page but then I got stuck in an infinite loop. Maybe I’ll try using a conditional statement that triggers the refresh only if the button is hidden.

@belltyler So I tried using JS to automatically refresh the page after 5 seconds as you suggested, but for some reason it doesn’t seem to wait 5 seconds before the page refreshes, and then it puts me in an infinite loop. The page never stops refreshing before the link to the member page can be shown.

Would you mind double-checking my code?

Here is what I have just before the closing body tag on the page:

document.addEventListener("DOMContentLoaded", function() {
        var btn = document.getElementById('dashboard');
        window.setTimeout( check(), 500 );

        function check() {
	        if (btn.style.display = 'none') {
  	           console.log("Display is " + btn.style.display);
  	           location.reload();
	        } else if (btn.style.display = '') {
  	           console.log("Success!");
       }
       };
});

@belltyler Ok I see what the issue might be. It has nothing to do with the timing function, but rather my conditional statement is breaking it. It seems that the script stops running after checking my IF statement (before it even gets a chance to read my ELSE statement) because the condition is met, and therefore refreshes the page before it even gets a chance to continue on to display the hidden button. Any ideas on how I can prevent this?

@belltyler Sorry about my lengthy monologue, but I was able to finally resolve the issue.

In case anyone else stumbles upon this post in the future, here are the instructions to automatically show new members the button to their member-specific page upon signing up (assuming you have already set up Zapier to zap new members from MemberStack to a Webflow member CMS database):

  1. Ensure that new members are redirected to a “Signup Success!” or “Welcome!” page upon signup up. The page should contain a button that links them to their specific page/dashboard

  2. In Webflow, add the following attributes to that button: Name: “ms-member-page”, Value: “profile”

  3. In Webflow, add the following element ID to that button: dashboard

  4. Copy and paste the following custom code to the page, before the closing BODY tag:

<script> window.onload = function() { var btnState = document.getElementById('dashboard').style.display; switch (btnState) { case 'none': location.reload(); break; default: console.log('The button should be shown now.'); } } </script>

  1. Save and publish your site

That’s it! So upon successful sign up, new members will be redirected to a “Success” or “Welcome” page, but due to the lag between Zapier and MemberStack and Webflow, their specific “Member Page” button won’t show up unless they refresh the page (which they won’t know to do). The code above checks for the button. If the button is hidden, the page will refresh automatically, and therefore showing the button. If the button is shown, it will stop refreshing.

Hope this helps!

Awesome! Thanks for sharing this!

1 Like

FWIW here’s another approach. I instead tap into the MemberStack API with some custom code to check if their “member page” url has been created or not. If created, redirect:

4 Likes

@ChrisDrit, master! :+1:

3 Likes

@ChrisDrit

This is great :tada: :pray:

2 Likes

Hi! I am trying to use a variation of this and the Redirect after signup or login PowerUp in Memberstack.

So basically, the new member will be redirected back to the site they signed upon, but their Dashboard isn`t ready yet.

And I have a function where the user can save an item on that site to their dashboard, but as the member-site isnt ready it wont save until they refresh the site.

So is there a way to put in a delay in this code?

So that the hidden page, loads for a few seconds before it redirects back?

Or any other way I can get around this problem?

Thanks

Paul

Yep! Checkout: