Skip to Content
Variable SystemOverview

Variable System

Variables are the backbone of personalization, routing, and data capture in AppFunnel. Every piece of user data, quiz answer, product selection, and system state is a variable. When a variable changes, every component that references it updates immediately — no manual wiring required.

How Variables Work

Variables are key-value pairs organized into namespaces. You reference them with dot notation: namespace.key or namespace.subkey.property.

{{ answers.incomeGoal }} {{ products.monthly.price }} {{ device.isMobile }}

The variable system is reactive. When a visitor selects a quiz answer, that value is stored in a variable. Any text element, condition, route, or style that references that variable re-evaluates instantly.

All user-created variables (answers.*, data.*, query.*, user.*) are automatically persisted across sessions. If a visitor closes the browser and returns later, their previous answers are restored. System and computed variables are recalculated on each session.

Variable Namespaces

AppFunnel organizes variables into namespaces based on their source and purpose.

User-Created Variables (Persistent)

These variables are saved to the visitor’s session and persist across visits.

NamespacePurposeCreated byExamples
answers.*Quiz and survey responsesYouanswers.incomeGoal, answers.experience, answers.interests
data.*App state and flagsYoudata.showDiscount, data.discountTimerStart, data.selectedPlan
query.*URL parametersYou (values auto-populated from URL)query.utm_source, query.ref, query.promo
user.*User identityAuto-populateduser.email, user.name, user.dateOfBirth, user.stripeCustomerId

Variable Panel Insert image: The Variable Panel in the left sidebar showing the list of user-created variables organized by namespace (answers, data, query, user), each with its name, type badge, and value

Response Variables (answers.*)

Created in the variable panel. These capture visitor input from quiz pages, forms, and interactive elements. Available types: string, number, boolean, stringArray.

When you add a Single Select or Multi Select element, a response variable is automatically created to store the selection.

Data Variables (data.*)

General-purpose state variables. Use these for internal app logic — toggling UI states, tracking timers, storing computed values from click actions.

Query Variables (query.*)

Populated automatically from URL parameters when a visitor lands on the funnel. Five UTM parameters are pre-configured:

  • query.utm_source
  • query.utm_medium
  • query.utm_campaign
  • query.utm_content
  • query.utm_term

You can add custom query variables (e.g., query.ref, query.promo) to capture additional URL parameters.

User Variables (user.*)

Identity fields for the visitor. Pre-configured defaults:

  • user.email — captured via an email input element
  • user.name — captured via a name input element
  • user.dateOfBirth — captured via a date input element
  • user.stripeCustomerId — set automatically after a Stripe payment
  • user.paddleCustomerId — set automatically after a Paddle payment

System Variables (Auto-Generated, Read-Only)

System variables are computed automatically by AppFunnel. You cannot set them directly — they reflect the current state of the visitor’s device, browser, session, and funnel progress.

Page (page.*)

VariableTypeDescriptionUpdates
page.currentnumberOne-based count of pages visited in this sessionOn page change
page.currentIndexnumberZero-based count of pages visitedOn page change
page.currentIdstringID of the current pageOn page change
page.totalnumberExpected total pages in the funnel pathOn demand
page.progressPercentagenumberProgress as a percentage (0-100)On page change
page.timeOnCurrentnumberSeconds spent on the current pageEvery second
page.startedAtnumberTimestamp when the current page was loadedEvery second

Device (device.*)

VariableTypeDescription
device.isMobilebooleanWhether the device is a mobile phone
device.isTabletbooleanWhether the device is a tablet
device.typestring"mobile", "tablet", or "desktop"
device.screenWidthnumberScreen width in pixels
device.screenHeightnumberScreen height in pixels
device.viewportWidthnumberViewport width in pixels
device.viewportHeightnumberViewport height in pixels
device.pixelRationumberDevice pixel ratio

Browser (browser.*)

VariableTypeDescription
browser.namestringBrowser name (e.g., "Chrome", "Safari")
browser.versionstringBrowser version string
browser.languagestringBrowser language code (e.g., "en")
browser.onlinebooleanWhether the browser has internet connectivity
browser.cookieEnabledbooleanWhether cookies are enabled

OS (os.*)

VariableTypeDescription
os.namestringOperating system name (e.g., "iOS", "Windows")
os.versionstringOperating system version
os.platformstringPlatform identifier
os.timezonestringSystem timezone (e.g., "America/New_York")

Session (session.*)

VariableTypeDescription
session.startedAtnumberTimestamp when the session began

Purchase (purchase.*)

VariableTypeDescription
purchase.statusstringPurchase status
purchase.successbooleanWhether the purchase completed successfully
purchase.cancelledbooleanWhether the purchase was cancelled
purchase.amountnumberPurchase amount
purchase.currencystringPurchase currency code
purchase.modestring"payment" or "subscription"

Payment (payment.*)

VariableTypeDescription
payment.loadingbooleanWhether a payment operation is in progress
payment.errorstringError message from the last payment operation
payment.intentIdstringStripe PaymentIntent ID after a charge

Product Variables (Computed from Price Data)

Product variables give you access to all pricing and subscription details for the products configured in your funnel. Products are accessed by name, not by index.

{{ products.monthly.price }} → "$9.99" {{ products.yearly.period }} → "year" {{ products.selected.trialDays }} → 7

The special products.selected namespace always refers to the currently selected product.

See the Product Variable Reference for all properties (pricing, currency, billing period, trial, etc.).


Where Variables Are Used

Variables appear throughout the platform:

  • Liquid Templates — Dynamic text in text elements, HTML blocks, custom CSS, and event payloads.
  • Conditions — Routing rules, dynamic properties, active style triggers, and visibility.
  • Click Actions — Set Variable, Toggle Array Item, and Select Product actions modify variables directly.
  • Input Bindings — Input, Switch, Single Select, and Multi Select components bind to variables automatically.

Next Steps

Last updated on