diff --git a/content/shared/showing-paywalls/feature-gating.mdx b/content/shared/showing-paywalls/feature-gating.mdx index 31a318e8..c16e5c7e 100644 --- a/content/shared/showing-paywalls/feature-gating.mdx +++ b/content/shared/showing-paywalls/feature-gating.mdx @@ -344,6 +344,43 @@ Analytics.shared.track( ``` ::: +### Every `register` call is an analytics event + +Registering a placement doesn't only decide whether to show a paywall — it also records an analytics event. Every `register` call is captured by Superwall, **uncapped and free**, so you can use the SDK you already have as a full-fledged analytics destination with no separate library to install. + +You don't need a feature closure or a presentation handler to log an event. Call `register` with just a placement name (and, optionally, params) and Superwall records it — fire-and-forget: + +:::ios + + +```swift Swift +Superwall.shared.register(placement: "workout_complete", params: ["total_workouts": 17]) +``` + +::: +:::android +```kotlin Kotlin +Superwall.instance.register("workout_complete", params = mapOf("total_workouts" to 17)) +``` +::: +:::flutter +```dart Flutter +Superwall.shared.registerPlacement("workout_complete", params: {"total_workouts": 17}); +``` +::: +:::expo +```tsx React Native +Superwall.shared.register({ + placement: "workout_complete", + params: new Map([["total_workouts", 17]]), +}); +``` +::: + +The exact same call powers both behaviors — the only thing that changes is whether you pass a feature closure or handler. With a `feature:` block, `register` can gate a feature or present a paywall based on the user's entitlements. Without one, it's a pure analytics event with nothing to run afterward. That means anything you log today can become a paywall moment later, **without an app update**. + +Because there's no per-event fee and no cap, you can pipe **every** analytics event you already fire into Superwall and then query it back with row-level-security-protected SQL through the [Query API](/dashboard/guides/query-clickhouse). That makes Superwall a viable, agent-first home for your product analytics alongside (or instead of) Mixpanel, Amplitude, and PostHog — on top of everything it already does for paywalls. + ### Getting a presentation result Use `getPresentationResult(forPlacement:params:)` when you need to ask the SDK what would happen when registering a placement — without actually showing a paywall. Superwall evaluates the placement and its audience filters then returns a `PresentationResult`. You can use this to adapt your app's behavior based on the outcome (such as showing a lock icon next to a pro feature if they aren't subscribed).