Skip to main content

Rules

AIAsk AIChatGPTClaude

Rules allow you to change the visibility of certain components, in order to customise a single paywall to better fit a multitude of scenarios.

What rules can I use?

RuleWhen the rules will take effectWhat Rules are available
offer.introIf the user selects a package that includes an introductory offerVisibility and text overrides
offer.promoIf the user selects a package that includes a promotional offerVisibility and text overrides
package.identifierIf the user selects a package that matches the defined identifierVisibility only
Custom variableIf the paywall is rendered with or without the defined custom variable.Visibility only
offer.multiphaseIf the user selects a package that includes a promotional offerVisibility and text overrides

Each rule is connected to a single variable. If you need multi-variable conditions (e.g., "show this when the user is in the US AND selected the annual plan"), compute the result in your app and pass it as a single custom variable (e.g., a boolean show_annual_us_promo), then compute the rule from it.

How can I create Rules?

To access the Paywall Rules page, select the Paywall logic tab in the left sidebar.

Here you'll see a button to create a new rule.

Firstly, you must pick what you want the Rule to be based off (see table above).

Rules sidebar location

Then, you're able to select already existing components from your paywall to change their visibility, or add new components that are only visible for that Rule type.

Basic rule set up

While you are viewing your Rule (as shown by the purple highlight around the preview) any component that you add will be set to only be visible for that Rule. You can edit this later if you require it to be visible in more cases.

Once published, your rules will all be evaluated at runtime, meaning that multiple rules can exist on a component. The rules will be applied to a component in your paywall in the order defined in the above table (with custom variables then being A -> Z).

Limitations

There are certain components you are not able to change the visibility of using Rules, these include:

  • Express checkout buttons
  • Individual pages of a carousel
  • Individual tabs
  • Footer
  • Sheet
  • Purchase Button
📘SDK Version Requirements

Rules requires minimum SDK versions (iOS 5.62.0, Android 9.23.2)

Examples

Show a trial timeline only when a trial is available

Suppose your paywall has two components: a timeline that illustrates the trial period, and a features list that you want to show when no trial is available. You can use a rule to swap their visibility based on whether the selected package includes an introductory offer.

  1. Add both the timeline component and the features list component to your paywall.
  2. Open the Paywall logic tab and create a new rule based on offer.intro.
  3. Select the Present case and set the timeline to Show Layer and the features list to Hide Layer.
  4. Select the Not Present case and do the opposite: hide the timeline and show the features list.

You can preview each case by clicking on it in the rules panel, or by using the Rule Preview button at the top of the screen frame.

Show different packages based on a custom variable

Suppose you have an offering that contains both family sharing and non-family sharing packages, and you want to control which set is shown at runtime.

  1. In your paywall, place the family sharing packages in one package stack and the non-family sharing packages in a second package stack.
  2. Create a boolean custom variable named family-sharing.
  3. Open the Paywall logic tab and create a new rule based on the family-sharing custom variable.
  4. In the true case, show the family sharing stack and hide the non-family sharing stack.
  5. In the false case, do the opposite.

At runtime, pass the variable into the paywall to control which package stack is displayed.