Skip to main content

Lesson 10 of 10 · 4:14 · Intermediate · Webflow

Free access that expires (no card)

Give a free plan for a set number of days, no card needed, and remove it when time’s up.

Where this fits

Discounts get people to pay. A trial lets them try first. This lesson gives members a plan for a set number of days and takes it away when time’s up.

By the end of this lesson you can

  • Add a button that gives a member a free plan for a set number of days
  • See the plan and its end date on the member in Memberstack
  • Run more than one trial at a time, each with its own length
  • Set loading, success and error text on the trial button

Heads up: Memberstack’s built-in free trials sit on a paid price and need a card. This lesson is for free access with no card, using a MemberScript you paste in plus a few attributes on each button.

Lesson notes

How it works

Native free trials vs free access that expires

Memberstack has free trials built in. When you create a price on a paid plan, enter a length under Trials. Checkout then shows the trial length, the cost after the trial and nothing due today. Native trials require a card, and each customer gets one trial. If you're happy to ask for a card, use that and skip this lesson.

This lesson is for free access with no card. Memberstack can expire one-time prices natively, but its docs say free and recurring plans can't be set to expire. So you use a free plan plus MemberScript #206, which ends the plan for you.

How MemberScript #206 tracks and ends a trial

When a logged-in member clicks a trial button, the script adds the free plan with addPlan. It then saves a start and end date for that plan in the member's JSON, under the key ms-plan-assignments. That's the time limit you see on the member in the dashboard.

Every time the member loads a page with the script, it compares today with each end date. Once a date has passed, it removes the plan, so the member loses that plan's gated content. Each plan has its own dates, so one member can run a 7-day and a 30-day trial side by side.

The button also shows Current plan and turns disabled while the member has the plan. If the member pays before the trial ends, a Plan Logic rule on the paid plan can remove the trial plan straight away.

How to set up a trial button

Paste the script site-wide or on the pages that need it. Then give each trial button these attributes:

  1. ms-code-add-trial to mark it as a trial button.
  2. data-ms-plan-id set to the free plan's pln_ ID.
  3. data-ms-duration-days set to the trial length, for example 7.
  4. data-ms-redirect set to the page to send them to afterwards (optional).
  5. data-ms-loading-text, data-ms-success-text and data-ms-error-text for the button text while adding, after success and on failure.
  6. Repeat on each trial button with its own plan ID and days.

Before you move on

0 of 5

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

Up next: Your plans, payments and trials are ready. In Journey 3 you’ll make them matter by gating your first page.

Chapters

Common questions

Does Memberstack have free trials without code?

Yes, on paid prices. Set a trial length under Trials when you create the price. These trials require a card, and checkout shows the cost after the trial. For free access with no card, use a free plan with MemberScript #206.

Can Memberstack free plans expire on their own?

Not natively. Memberstack can expire one-time prices only. MemberScript #206 adds an end date to free plans and removes the plan once it passes.

When is the plan actually removed?

When the member next loads a page with the script after the end date. Until then the plan still shows on the member in your dashboard.

Keep going

Checked against the Memberstack docs

TranscriptAuto-generated captions
  1. 0:00

    Hey, mathn from Memberstack here and welcome to members script 206. In this video, I’m going to show you how to add expiration or time limits to your free plans. This is good for offering free trials or promo access to gated content for a set duration of time. All right, so say I had three different plans with three different durations or time limits. So, if I were to add the first plan over here, the page will refresh and you can now

  2. 0:31

    see that this says that this is my current plan. So, the redirect can be to any page you would like a user to be redirected to. So, inside of members deck, you’ll be able to see that the basic plan was added to my account and I now have a time limit set on that plan. So I can have access to anything that is under the basic plan for a period of 7 days. So if I were to edit this and say my start date was in January

  3. 1:03

    the 10th and it was supposed to end today. Go back to the page and refresh this. You’ll see that the pre-plan button has now been activated again and inside of Memberstack I now don’t have a plan as well as no assignments. So essentially I lose access to any gated content that was under that basic plan. You can also add multiple free plans at once and

  4. 1:34

    they’ll all have their own set time limits. You can see that that one was added and then this one over here. Okay, inside of members deck again see two plans were added and up here you can see that I have two different types of durations. This is 14 days and this is 30 days. Okay, now let me show you how to set all of this up

  5. 2:05

    inside of Webflow. So in Webflow you are going to need to add members script 200 and it should look like this. If you’re watching this on YouTube, the link to that code should be in the description below. And if you’re watching this on the members de site, then you should have already seen the code. You can either add this sitewide on a specific page depending on your specific use case. All right, so on the page itself, you are now going to need the following attributes for your pricing buttons. To add a free plan to a

  6. 2:37

    user, you are going to need a lot of attributes to make this work. The first attribute is MS code add trial and then you’re going to need data MS plan ID and that’s going to be the ID that you’re going to be adding to a user. This ID will be different for the different types of plans. Okay. The next one will be data MS duration days. So for the basic plan we have 7 days for any other plans that you define over here can be any other set duration. MS

  7. 3:09

    redirect where you’d like a user to be redirected to and then MS um data MS loading text when ASA clicks on the button what would you like the text to say and then data MS success text text after they have added a plan what would you like that um button to say and the same goes for data MS error text if a free plan could not be added to a user what would you like that button to say okay and then you repeat the same for all other free plans So that was the

  8. 3:39

    basic plan. Over here we have a business plan. As you can see that the ID now changes to business and the saturation trial days is now 14. But everything else stays the same. If you want to redirect them to another page once they’ve subscribed to business, you can do that over here as well. And that is it. You’ll now essentially be able to create free trials or promo access on your site. If you have any questions on this, feel free to reach out in the Slack 2.0 channel. Bye.

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.