Targeting attributes
Tell the SDK about your user so placements can pick an audience, and handle the case where nothing is shown.
Placement audiences can test facts about the user, like plan or country. Your site or app passes those facts as attributes. They are compared in the browser or on the device and are never sent to Miniwall. Miniwall stores only the rules.
An attribute is a string, a number or a boolean.
Passing attributes
| Where | Use |
|---|---|
configure (attributes) | Defaults for the whole page or app. |
setAttributes | Adds to or changes the saved attributes, for example after sign-in. null (nil on iOS) removes one. |
attributes option of a call | Merged over the saved ones for that call only. |
| Web: React | attributes prop of <Paywall>, or usePaywall({ attributes }), useAutoPlacements({ attributes }). |
| Web: component | The visitorAttributes property (attributes is already a built-in name of every element). |
type Attributes = Record<string, string | number | boolean | null | undefined>;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. The SDK reads them itself and, like your attributes, never sends them to Miniwall.
| Fact | Web | iOS and Android |
|---|---|---|
locale | The call's locale, else navigator.language. | The call's locale, else the device's, such as vi_VN. |
device | mobile, tablet or desktop. | mobile or tablet. A tablet is a screen at least 600 dp wide on Android and an iPad on iOS. |
path | location.pathname. | No value in an app. |
seen_count, days_since_first_seen | Kept in the browser. | Kept on the device. |
platform | Not available. | ios or android. |
os_version | Not available. | The major version of the operating system, as text: 17 for iOS 17.4.1, 14 for Android 14. Compare it with a number, such as is at least 16. |
app_version | Not available. | Your app's version name: CFBundleShortVersionString on iOS, versionName on Android, such as 2.3.1. Compare it with is, starts with or contains, or as a version with is at least, is more than, is at most and is less than: the parts between the dots are compared as numbers, one by one, so 2.10.0 is above 2.9.4, and a missing part counts as 0 (2 is 2.0.0). A version with a part that is not a number, such as 2.0-beta, matches none of the four. |
country | Not available. | The region part of the locale, in capitals: VN for vi_VN and vi-VN. It comes from the device's language and region setting, not from the IP address, so a traveller keeps their home setting. Empty when the locale has no region (vi). |
React Native and Flutter use the iOS and Android values. When the SDK cannot read a fact, it is empty and every comparison except is not and is not set fails. See Audience for exact rules.
Older mobile SDK versions do not know os_version, app_version and country, and compare app_version as plain numbers. A condition on them fails there (as platform does on the web), so put an audience that uses them after one that catches everyone else, or update the SDK first.
Campaign and referrer
Where a visitor came from is not a built-in fact: the SDK does not read the page link. Your site reads utm_source, utm_medium, utm_campaign and the referring site, and passes them as attributes with those names. In the dashboard they have their own choices under Campaign (your site passes it). See Target by campaign and referrer.
When nothing is shown
Targeting applies to placement sources (on web, { placement }). In order: the frequency limit, the first matching audience, the holdout. See Audience.
type SkipReason = 'frequency_cap' | 'audience' | 'holdout';| Where | You get |
|---|---|
present | Finishes with skipped and a reason. Nothing opens. |
| Embedded screen | Web: a handle with shown: false and skipReason. Mobile: onFinish receives skipped. Nothing is drawn. |
| Web: any call | onSkip({ reason }) is called. |
| Web: component | A uikit-skipped event with detail.reason. |
| Auto placements | onResult receives the skipped result. |
A holdout skip records a holdout event. The other two send nothing.
Rules in the browser and on the device
- Text comparisons ignore case. A missing,
nullor empty value fails every comparison except is not and is not set. - Number comparisons need numbers on both sides.
- Frequency counters and the first-visit date are kept in
localStorage(uikit:shown:*,uikit:first-seen) on web,sessionStoragefor the per-visit counter (uikit:session-shown:*), and on the device on mobile (see Events and privacy). On mobile, a per session limit counts screens shown since the app process started.
Related
Purchases and prices
Pass prices to the SDK by package ID, run your own checkout or store purchase, and report purchases that finish elsewhere.
Events and privacy
What the SDK sends to Miniwall, what it never sends, what it stores, how to answer the App Store and Google Play privacy questions, and how to turn analytics off.