Create a Free Trial for a Blocks App

When you set up your app's pricing in the app dashboard, you can choose to provide users with a free trial. This is recommended especially if you don't provide a free version of your app, so you can let users experience your app's value before they decide whether to upgrade.

Once you choose to add a free trial, your app market listing will show how many days of free trial the app offers. 

Free trial user experience: best practices

When providing a free trial, you should cover the experience of site builders who install your app and their site visitors - in all stages of the free trial. This means what happens during the trial, after the trial, for the entire app, or for specific features. 

During the trial: site builder experience

  • The app should work fully.
  • Tell site builders how many days they have left in the trial. Indicate this, for example, in a message in your app's settings panel, or in your app's Dashboard page. 
  • Provide entry points to upgrade your app in case someone wants to upgrade before the trial ends.

After the trial: site builder experience

When the free trial is over, the app should behave as follows:

  • In the site editor, display a notification in a central, visible place in the app, and prevent the app (or specific features) from working. Note the difference between a premium app, which does not work at all unless it's paid for, and a freemium app, where you should block only the premium features. 
  • Provide entry points to upgrade your app. This can be done in the widget's action bar, settings panel, or in the app Dashboard.

After the trial: site visitor experience

Your direct user is the site builder who installed your app. However, you should also think about the user of your user, the site visitor. 

When the free trial is over, lock the app (or its premium features) from working. If it's a premium only app, we recommend to collapse (delete) it, so it's not seen on the site. If you cannot collapse it, present an indication, such as: "This app / feature is currently unavailable, contact the site owner for details". This is also true for Dashboard apps - collapse the app or present a proper message. 

Here is a code example for collapsing the widget after the trial: 

Copy

Tracking the free trial dates

Currently, there is no out-of-the-box solution for tracking an app's free trial (however, there is an open feature request for it). So, each developer might choose to implement this differently. 

To provide a free trial, you must save the instanceId (returned by the getDecodedAppinstance() Velo function), together with the installation date, in your own external database. This database can also hold information of who your users are, what are their website's URL, etc.

Your app's business logic should look something like the following. This is only a recommendation. 

  1. When the widget is ready, check whether or not this instance of the app was upgraded. If  getDecodedAppInstance().vendorProductId is null, then this app was never upgraded on this site. 
  2. If the app was not upgraded, compare its instanceId to your external database.
  3. If you find the instanceId in your database, check the install date you stored with it, to see whether it is eligible for a free trial. 
  4. If the instanceId is not in the database, save it, together with the date. 

Note The same app on the same site will always have the same instanceId (even if it's deleted and installed again). This means that the site builder will not be able to do another free trial on the same site.

Did this help?