Miniwall Docs
Web SDK

Targeting attributes

Tell the SDK about your visitor so placements can pick an audience, and handle the case where nothing is shown.

Placement audiences can test facts about the visitor, like plan or country. Your site passes those facts as attributes. They are compared in the visitor's browser and are never sent to Miniwall. Miniwall stores only the rules.

type Attributes = Record<string, string | number | boolean | null | undefined>;

Passing attributes

WhereUse
configure({ attributes })Defaults for the whole page.
setAttributes(partial)Adds to or changes the saved attributes, for example after sign-in. A value of null removes one.
attributes option of a callMerged over the saved ones for that call only.
Reactattributes prop of <Paywall>, or usePaywall({ attributes }), useAutoPlacements({ attributes }).
Web componentThe visitorAttributes property (attributes is already a built-in name of every element).
UIKit.configure({ apiKey: 'pk_...', attributes: { plan: 'free' } });
// after the user upgrades:
UIKit.setAttributes({ plan: 'pro', country: 'VN' });

In the dashboard a condition on plan is Attribute from your site with the name plan. Names start with a letter and use letters, numbers and _, up to 40 characters.

Built-in facts

These need no attributes: locale (the call's locale, else navigator.language), device (mobile, tablet or desktop), path (location.pathname), seen_count and days_since_first_seen. See Audience for exact rules.

When nothing is shown

Targeting applies to sources of the form { placement }. In order: the frequency limit, the first matching audience, the holdout. See Audience.

type SkipReason = 'frequency_cap' | 'audience' | 'holdout';
WhereYou get
presentPaywallResolves { outcome: 'skipped', reason }. Nothing opens.
mountPaywallA handle with shown: false and skipReason. Nothing is drawn.
Any callonSkip({ reason }) is called.
Web componentA uikit-skipped event with detail.reason.
startAutoPlacementsonResult receives the skipped result.

A holdout skip records a holdout event. The other two send nothing.

Rules in the browser

  • Text comparisons ignore case. A missing, null or empty value fails every comparison except is not and is not set.
  • Number comparisons need numbers on both sides.
  • The frequency counters and the first-visit date are kept in localStorage (uikit:shown:*, uikit:first-seen) and sessionStorage (uikit:session-shown:*).

On this page