Track web checkout opened paywall event#6909
Conversation
Add support for a "web checkout opened" flow: introduce WebCheckoutOpenedPreferenceKey and a published UUID (PurchaseHandler.webCheckoutOpened) to signal distinct web-checkout taps; add PurchaseHandler.signalWebCheckoutOpened to emit the preference and track a paywall_web_checkout_opened analytics event. Wire the signal from the purchase button, expose an onWebCheckoutOpened View modifier and WebCheckoutOpenedHandler, and add a PaywallViewController delegate callback. Extend PaywallEvent and networking enums to include webCheckoutOpened and add tests covering event tracking and PurchaseHandler behavior. Reset webCheckoutOpened on new sessions.
Generated by 🚫 Danger |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c80491e. Configure here.
| return self.paywallEventTracker.createPurchaseInitiatedEvent(package: package, sessionID: sessionID) | ||
| } | ||
|
|
||
| /// Signals that the user tapped a web checkout CTA and the paywall was dismissed to open the browser. |
There was a problem hiding this comment.
Stale web checkout on reappear
Medium Severity
webCheckoutOpened is cleared in resetForNewSession, which SwiftUI paywall presentation often never calls on a new show. A new trackPaywallImpression does not clear it either, so a leftover UUID can make onWebCheckoutOpened run when the paywall reappears without a new web checkout tap.
Reviewed by Cursor Bugbot for commit c80491e. Configure here.
4 builds increased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 29.6 kB |
| Code Signature | ⬆️ 3.1 kB |
| RCPurchases.Objc Metadata | ⬆️ 2.5 kB |
| RevenueCat.Backend.Backend | ⬆️ 2.4 kB |
| RevenueCatUI.PaywallViewController.PaywallViewController | ⬆️ 2.0 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 18.1 kB (0.14%)
Total download size change: ⬆️ 4.6 kB (0.11%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 2.9 kB |
| RevenueCat.PurchasedTransactionDataEncodedWrapper.value witness | ⬆️ 2.5 kB |
| RevenueCat.LocalTransactionMetadata.value witness | ⬆️ 2.1 kB |
| RevenueCat.PaywallEvent.value witness | ⬆️ 1.7 kB |
| 📝 RevenueCatUI.PaywallEventTracker.trackWebCheckoutOpened(package,s... | ⬆️ 1.7 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 47.3 kB (0.17%)
Total download size change: ⬆️ 7.7 kB (0.12%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 16.9 kB |
| DYLD.String Table | ⬆️ 6.1 kB |
| RevenueCat.PurchasedTransactionDataEncodedWrapper.value witness | ⬆️ 2.5 kB |
| RevenueCat.LocalTransactionMetadata.value witness | ⬆️ 2.1 kB |
| RevenueCat.PaywallEvent.value witness | ⬆️ 1.7 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 18.1 kB (0.16%)
Total download size change: ⬆️ 5.8 kB (0.13%)
Largest size changes
| Item | Install Size Change |
|---|---|
| RevenueCat.PurchasedTransactionDataEncodedWrapper.value witness | ⬆️ 2.5 kB |
| RevenueCat.LocalTransactionMetadata.value witness | ⬆️ 2.1 kB |
| RevenueCat.PaywallEvent.value witness | ⬆️ 1.7 kB |
| 📝 RevenueCatUI.PaywallEventTracker.trackWebCheckoutOpened(package,s... | ⬆️ 1.7 kB |
| RevenueCat.PaywallEvent.init(from) | ⬆️ 776 B |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
|
Superseded by #7260 |






Add support for a "web checkout opened" flow: introduce WebCheckoutOpenedPreferenceKey and a published UUID (PurchaseHandler.webCheckoutOpened) to signal distinct web-checkout taps; add PurchaseHandler.signalWebCheckoutOpened to emit the preference and track a paywall_web_checkout_opened analytics event. Wire the signal from the purchase button, expose an onWebCheckoutOpened View modifier and WebCheckoutOpenedHandler, and add a PaywallViewController delegate callback. Extend PaywallEvent and networking enums to include webCheckoutOpened and add tests covering event tracking and PurchaseHandler behavior. Reset webCheckoutOpened on new sessions.
Checklist
purchases-androidand hybridsMotivation
Description
Note
Medium Risk
New public delegate/modifier APIs and a persisted paywall analytics event; behavior is isolated to web-checkout CTAs but affects host integrations and event pipelines.
Overview
Adds a dedicated web checkout opened path so hosts can react when users leave the app for external checkout instead of treating it as a purchase cancel.
PurchaseHandlernow exposessignalWebCheckoutOpened(package:), which assigns a fresh UUID onwebCheckoutOpened, emitsWebCheckoutOpenedPreferenceKey, and records a storedPaywallEvent.webCheckoutOpened(paywall_web_checkout_opened) with optional package/product IDs. Session reset clears that UUID without affectinghasPurchasedInSession.V2
PurchaseButtonComponentViewcalls the signal after launching the browser. SwiftUI gainsonWebCheckoutOpened/WebCheckoutOpenedHandler; UIKit gains optionalpaywallViewControllerDidOpenWebCheckout. Event plumbing and API testers are updated; unit tests cover tracking and handler behavior.Reviewed by Cursor Bugbot for commit c80491e. Bugbot is set up for automated code reviews on this repo. Configure here.