Targeting & A/B tests

All the show-logic lives in the dashboard, evaluated server-side. Your app sends its context once — who sees which paywall, when, and how often is configuration, not code.

Rules#

A rule (Dashboard → Paywalls → Targeting) combines everything below. Rules are evaluated by priority; the first match wins. If no rule matches, non-subscribers get the published paywall and subscribers see nothing — unless an audience only rule matched the placement (see below).

FieldTypeDescription
AudienceconditionsSubscription status (never / churned / active for upsells), platforms, locales, min app version, days since first seen, custom attributes
PlacementstringEmpty = every placement. Set a name to only match showIfNeeded(placement: '…') calls. Specific beats wildcard at equal priority.
Variants1–4 paywallsSeveral = A/B test, weighted %. Assignment is stable per customer.
ScheduledatesStart/end — promos flip on and off automatically
Frequency capslimitsMax shows total / per day, cooldown after dismiss, stop after N dismissals
PrioritynumberHigher wins when several rules match
Audience onlybooleanAudience not matched → show nothing instead of the published paywall (default for new rules)
Offerdiscount% off for this rule's audience — first payment, N months, or forever
Rules are shared by test and live mode — enabling or editing one affects your live app immediately. To try a rule on yourself first, scope it with a custom attribute only your test build sends (e.g. beta eq true).

Audience conditions#

By default a rule targets non-subscribers (never paid + churned). Tick Active to build upsell rules aimed at current subscribers. Custom attributes match key/value pairs your app sends:

App side
await PayloPaywall.showIfNeeded(context,
  attributes: {'source': 'instagram', 'launches': 12});

Dashboard side: source eq instagram, launches gte 10… Operators: eq, neq, gt, gte, lt, lte, contains. All conditions must match (AND).

Min app version compares against the app_version the app sends — since SDK v0.5.0 Flutter and Swift fill it in automatically; on Kotlin pass appVersion to the Paylo(...) constructor. Days since first seen counts from the customer's first resolve call (first app launch that asked for a paywall), not from their first paywall impression.

Audience only (checkbox on the rule, on by default for new rules): when the rule matches the placement and schedule but the user fails the audience conditions, nothing is shown instead of the published paywall. That makes your conditions actually enforceable — otherwise the fallback shows a paywall to everyone and targeting looks like it does nothing. Uncheck it when the rule is a bonus on top of a default experience (e.g. a promo for churned users) and everyone else should still get the published paywall.

Placements#

Placements are named spots in your app. The code never changes — the dashboard decides what each spot shows:

// In the app, once:
showIfNeeded(..., placement: 'onboarding')
showIfNeeded(..., placement: 'feature_lock')

// In the dashboard: point each placement at a different
// paywall, schedule, or A/B test. Change anytime.

Offers — win-back discounts#

Give a rule a discount (Offer section: % off + duration) and its audience checks out at the reduced price. The classic win-back: audience Churned + 50% for 3 months. Paywalls render it automatically — original price struck through, discounted price highlighted.

Under the hood, resolve returns a signed offer (percent, duration, and a token) plus discounted_amount on each plan for display. The Flutter paywall passes the token to checkout by itself; with Swift, Kotlin or your own UI, forward it: subscribe(..., offerToken: resolved.offer?.token). Offers apply to subscriptions and to one-time (lifetime) plans alike. Tokens are HMAC-signed and expire after 24h — the app can read the discount but cannot forge or alter it. Stripe applies the real coupon, so the charged amount is always computed server-side.

A/B tests#

Add 2–4 variants to a rule with traffic weights. Each customer is assigned a variant deterministically (stable hash) — they always see the same one. Analytics shows viewers, checkouts, paid conversions and the conversion rate per variant, with the current leader highlighted. To declare a winner, set its weight to 100% or remove the other variants.

Frequency caps#

Caps are per customer and rely on the impressions and dismissals reported for the rule — automatic with the Flutter SDK, logPaywallEvent with Swift and Kotlin (pass the ruleId). When a matching rule is capped, nothing is shown — the published fallback respects your caps.

Testing and capped yourself out? Use Reset stats on the rule — it clears the tracked events so caps start fresh.

Under the hood — resolve#

POST /v1/public/:developerId/paywall/resolve
{
  "customer_id": "user_42",
  "placement": "onboarding",
  "platform": "ios",
  "locale": "fr-FR",
  "app_version": "1.4.0",
  "attributes": { "source": "instagram" }
}

The response's reason field tells you exactly which branch was taken: rule_matched, published_fallback, audience_no_match, frequency_capped, already_subscribed or no_match — your first stop when debugging targeting.