Miniwall Docs
Web SDK

Answers

Receive what visitors chose or typed on questions and multi-screen flows, and learn what is and is not sent to Miniwall.

Screens can ask questions (single choice, multiple choice, text field) and link to other screens. The SDK collects the answers in the browser and hands them to your code.

type Answers = Record<string, string | string[]>;

The key is the question's Field ID set in the editor. The value is:

QuestionValue
Single choiceThe chosen Answer ID, such as 'lose_weight'.
Multiple choiceA list of Answer IDs, such as ['mon', 'wed'].
Text fieldThe typed text.

A question with no answer has no key. Emptying a text field removes it. See Flows and questions for building them.

Getting the answers

WhereHow
onAnswer({ fieldId, value, answers })Every change. value is undefined once cleared.
onAction({ actionId, answers }) and onPurchase({ packageId, product, answers })Always have answers ({} if none).
The presentPaywall resultanswers is added to purchased, restored, closed and action when at least one question was answered.
handle.answers()From mountPaywall.
Web componentdetail.answers on uikit-purchased, uikit-action and uikit-close, and uikit-answer for each change.
const result = await UIKit.presentPaywall({
  paywall: { placement: 'onboarding' },
  onAction: ({ actionId, answers }) => {
    if (actionId === 'finish_onboarding') saveProfile(answers); // { goal: 'strength', days: ['mon','wed'], email: 'a@b.com' }
  },
});

Flows

A button with the action Go to another screen opens another screen inside the same frame. A button with Back to previous screen goes back (on the first screen it closes). Answers carry across screens, and earlier answers stay selected when the visitor goes back. The first screen is the one the placement returns, so its A/B test, schedule and audiences apply to the whole flow. Linked screens are loaded ahead of time from their published versions. For JSON or URL sources pass screens. If a linked screen cannot be loaded, the button reports the error to onError and stays.

Each screen of a flow counts as a view.

What is sent to Miniwall

Only for screens loaded by placement or paywall ID, and only with analytics on:

  • A view for every screen.
  • For choice questions, an answer event with the Field ID and the chosen Answer ID, sent when the visitor moves on, closes, buys or presses a button. One event per option, once.
  • Typed text is never sent. It can be an email or a name. It stays with your site.

Analytics shows the counts in its Answers table. See Analytics.

On this page