Skip to main content

Starts at 0:47, after the intro.

Lesson 5 of 6 · 11:24 · Intermediate · Webflow

Every way to gate content

Gated content, restricted URLs, hosted content and visibility: when to use each.

Where this fits

You’ve gated pages, parts of pages and articles past a free limit. This lesson steps back and compares every gating method, so you know which to use where.

By the end of this lesson you can

  • Tell client-side gating (restricted URLs, attributes) from server-side hosted content
  • Use hosted content for things you sell, like ebooks and files
  • Choose between member JSON and metadata for data only one member should see

Heads up: Reverse proxying is only described here. The video says there’s no tutorial for it yet.

Lesson notes

How it works

Client-side gating: restricted URLs and data-ms-content

The two methods you've used so far, restricted URLs and data-ms-content attributes, both run in the visitor's browser. The page is delivered, then the Memberstack script decides whether to redirect the visitor or hide an element. They are quick to set up and you keep managing the content in Webflow.

The trade-off is that someone who knows what they're doing can get around them, for example by reading the page source, and if Memberstack fails to load the content isn't hidden. Use restricted URLs to keep people out of whole areas, like everything starting with app, and use attributes for user experience, like hiding a profile button from logged-out visitors.

Hosted content: server-side gating for things you sell

Hosted content lives in Memberstack, not in Webflow. In a gated content group you add a piece of HTML or a link, and Memberstack gives you a data attribute to put on an element in Webflow. The HTML or link is only sent to the browser after the member is authenticated and has access to that group, so it never sits in your page source.

That makes it the right choice for ebooks, files and anything where a leak hurts your business. It is harder to manage, because to change the content you edit it in Memberstack rather than Webflow, so it suits small, valuable pieces rather than whole dashboards.

Member JSON or metadata: data for one member

Some data belongs to a single member. Member JSON holds nested data, up to 1MB per member, and the member's browser can read and write it, which makes it good for things like marking a lesson complete. Because the member can edit it, never use it to decide access.

Metadata is key value pairs, up to 500 characters per member. The browser can read it, but only your backend can change it, using your secret key. Use it for things the member must not edit, like how many team seats they're allowed.

Reverse proxy and combining methods

A reverse proxy sits between Webflow and the visitor and checks access before anything reaches the browser. It is the most secure option and the hardest to set up. Most projects combine the other methods: restricted URLs for areas, attributes for small things, hosted content for what you sell.

Before you move on

0 of 4

Tick these off on your own site. Done with all of them? You’re ready for the next lesson.

Up next: Your content is locked to the right people, so the last step is switching the site live.

Chapters

Common questions

What is the most secure way to gate content in Memberstack?

Of Memberstack's built-in options, hosted content is the most secure. The HTML or link is stored in Memberstack and only sent after the member is authenticated and has access. Restricted URLs and data-ms-content attributes run in the browser.

What is the difference between member JSON and metadata in Memberstack?

Member JSON holds up to 1MB of nested data per member and can be read and written from the browser. Metadata holds up to 500 characters of key value pairs, can be read from the browser, and can only be changed from your backend.

Can I use more than one gating method on the same site?

Yes. Most larger Memberstack projects combine restricted URLs, data-ms-content attributes, hosted content and member data, picking each by how secure the content needs to be.

Keep going

Checked against the Memberstack docs

TranscriptAuto-generated captions
  1. 0:00

    Hey there Julian from Memberstack here and in this video I want to talk about gating content in Memberstack and what I mean by that is all of the different ways that you can gate content and show the correct stuff to the people who should be seeing it and hide the correct stuff from the people who should not be seeing it so just to get started let’s go ahead and talk about who this video is actually for so as you can see here all of these things are highlighted which mean this video is useful for everyone whether you are a complete beginner or you are a pro now the only

  2. 0:32

    people who this video is not for are people who are already extremely familiar with Memberstack and all of the ways of gating content because we’re just going to talk about the different ways that content can be gated so if you already know that then well this video is not going to be too great for you but anyways let’s get into it here with the first method and the first method is gating content and gating restricted URLs so what that means is when you set up a gated content group in Memberstack so here we are in Memberstack and we can see gated content and I can add a

  3. 1:04

    gated content group let’s say I can give this a name call it all members and then I can add restricted URLs here so this is super useful for let’s say gating the entire platform everything inside it to only people who are logged in so let’s just say all pages starting with app where if you have a folder in your Webflow site called app everything in here is going to be gated and and then we would redirect them to let’s say log in and this is the simplest way to gate entire

  4. 1:38

    pages to the correct people now a couple things about this are one it is very easy to set up as you just saw now it is also client side gated and what that means if you’re not familiar is it is gating everything it’s hiding the correct stuff when the user goes to the page so while that is good for a lot of situations you do need to keep in mind that if somebody knows what they are doing they can possibly access this they can access the content on the page they can view the page source so this is good

  5. 2:11

    for generally gating content like I said gating the entire app folder so that when people go on it who are not supposed to be there they are going to get redirected that being said this is not something that should be used for gating extremely sensitive stuff we’ll get to those methods later on in the video but while we’re here let’s talk about the second method which is gated content attributes so going back in Memberstack here let’s say we’ve added our gated content group called all members and we’ve gated it to all

  6. 2:41

    members this is essentially the same thing but what we’re doing here is gating specific items so we can see the content ID here all- mbrs and what we could do is go on a page in Webflow and apply the attribute data- ms- content equals all- mbrs and what that’s going to do is hide that individual piece of content from people who do not match the condition of all members or members on specific plan

  7. 3:13

    whatever it is that you set up so a couple things about this as well are that one again it is very very easy to set up and two again it is client side gated so somebody who knows what they are doing can possibly see these things this is very very good for stuff that you are gating for user experience so for example let’s say you have a button which launches the profile model where they can then update their profile well this is good because then you’re not going to have people who aren’t logged

  8. 3:45

    in clicking it and unable to do anything this is mostly for user experience for hiding things from people that are going to confuse them if they don’t have the correct level of access so again this is good for General gated content but for things which need to be very very very secure this is probably not your best bet now let’s move on to the next method and that is hosted content now this is where it gets more secure because what’s actually happening here is the content is being gated inside of Memberstack so if we go back into Memberstack over

  9. 4:18

    here we can see hosted content in this panel and I can click add content and select between HTML or link give it a name let’s just say ebook for example and then I can paste in some HTML there a link to a file whatever it may be and back into our presentation over here some things about this are that one like I said it allows links in HTML so you can put in any form of content you can add a link whatever it is that you want to do and it is gated

  10. 4:49

    server side which means that it’s not doing what we were talking about before the user is not going on the page and then it’s being hidden from them it’s actually not even going to get get that HTML or that link from Members sack until they’ve been authenticated and it’s been proven that they have access to that content group so this is very secure this is perfect for private stuff like for example if you’re selling an ebook if you’re selling files whatever it may be stuff where it is jeopardizing your business model to have any sort of

  11. 5:23

    security issues now while this is really really great just keep in mind it can be hard to manage so what I mean by that is with the previous stuff we were talking about just standard kind of gating content using attributes you can still manage that content inside of Webflow but using hosted content you’re actually pasting in the HTML or the link which means you need to go into Memberstack and manage that if you want to change it so this is not very good for let’s say getting an entire page an entire

  12. 5:55

    dashboard this is good for gating the stuff that is just really needs to be secure so now let’s talk about the next method and now we’re getting into member specific stuff so what member JSON is is basically some stuff associated with a member hidden inside of that member and it can only be accessed by them so this can be added in a number of different ways it could be added through zapier and make it can be added using our

  13. 6:25

    front-end API however you add it is up to you it depends on the use case but this is serers side gated as well which means that the only people who are going to be able to access this our are the member who actually has that specific JSON nobody else is going to be able to access it so you can rest assured knowing that whatever goes in the JSON here cannot be accessed by anyone except for that specific member which is great as long as it doesn’t need to be public of course um and some things about this

  14. 6:57

    are that it has a large limit each member can have 1 million characters of JSON in them which really gives you a ton of possibilities and like I said it is in JSON format obviously with the name so with this anything that you do will have to be able to pass through in JSON format and something about this to keep in mind is that it can be updated from the front end which means that one it’s very good because if you have a script using a front-end API that is

  15. 7:29

    allow allowing people to add or remove things from their JSON they have total control over that so it’s really great for as you can see in this example we have this chapter one lesson two marked as true which means they’ve completed that this example is for a course site where we want users to be able to say I finished this lesson I haven’t finished this lesson so on and so forth um but if you’re doing something which let’s say you want to be able to have full control over the member can never touch it it can only be updated from back end then

  16. 8:00

    member JSON isn’t for you but what might be for you is the next method which is metadata so metadata again is server side this cannot be accessed by anyone except for that specific member now metadata does have a smaller limit of 500 characters per member so you’re not going to want to keep a whole bunch of super complex stuff in there in their metadata the format of this is key value pairs so as you can see here in this example this member has allowed children for current children too and this is a

  17. 8:32

    great example of when we’re making a team accounts prototype using Memberstack something that we don’t want the user to be able to automatically update on their own if they know how to code um because then they’d be able to say that they’re allowed more people on their plan than they’re actually allowed uh this is really great for that kind of thing now this cannot be updated from the front end this can only be updated in the back end and what that means is users clicking buttons performing some kind of action are not going to be able

  18. 9:02

    to update the metadata which is great for stuff like this um it actually needs to be passed through in the back end so for example we have an automation for this where when the member purchases a higher plan it will update the amount of allowed children that they can have so for anything like that that is specific to that member needs to be secure and you do not want them to be able to update it on their own only when when you’ve said so this is a perfect way of going about it and finally let’s talk

  19. 9:34

    about the most difficult and most secure method which is reverse proxying so if you don’t know what reverse proxying is it’s basically using what is on your Webflow site to show the user content but adding a layer in between that to check un certain things if you have a reverse proxy setup then you can actually completely control every everything who is being served the content before it even gets sent to their browser which is really great and this is super powerful

  20. 10:07

    also because you can use certain whatever database you want to use you can use Zeno you can use superp base you can use air table whatever it is that you want to use to actually control this content and serve it to the user you don’t just need to use the Webflow CMS so this is really really powerful that being said this is the hardest one to set up we don’t have any tutorials on this yet but we do aim to in the near future when we do I will drop it in the description here and let you know so this one is super powerful but also

  21. 10:38

    super difficult and finally just to wrap this all up the way gating content in Memberstack works there’s no right or wrong answer you really need to take a look at your situation your project who you want to hide the content from when you want to hide it from them and how secure it needs to be to decide which type of method you want to use because some of them are easier to set up some of them are harder to set up some of them are more secure some of them are less secure and you don’t just need to use one method for your whole project

  22. 11:08

    most bigger Memberstack projects are using a combination of at least the first five of these without the reverse proxy so a lot of different things that you can do if you do have any questions just drop them right here in the comments I’ll talk to you soon and have a great day

This is v1 of Memberstack University, built from the tutorials we’ve put so much work into over the years. We’d like to make a more organized series.