Track purchase button component interactions for component and legacy paywalls#3336
Merged
MonikaMateska merged 1 commit intoApr 13, 2026
Conversation
… paywalls (PWENG-32) Co-authored-by: Alexander Repty <alex.repty@revenuecat.com>
Generated by 🚫 Danger |
JZDesign
approved these changes
Apr 13, 2026
dfc88cf
into
monika/Ul-events/paywall-control-interaction
23 of 35 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
purchases-iosand hybridsMotivation
Paywall component interaction analytics did not consistently record taps on purchase CTAs for Paywalls V2 (component JSON) or v1 template paywalls. Product and backend need a purchase_button interaction type with stable component_value, package/product identifiers, and URL semantics aligned with how checkout is opened (in-app vs web / browser mode).
Resolves: PWENG-32
Description
ButtonComponentStyleactions, emitPaywallComponentType.PURCHASE_BUTTONviapaywallPurchaseButtonAction, usingpackageForPurchaseButtonInteractionfor package/product IDs andpurchaseButtonInteractionComponentUrl(built onresolveWebCheckoutUrlForInteraction) forcomponent_url(external browser = fully resolved checkout URL; in-app / deep link = package/offering WPL + custom URL fallback as implemented).PurchaseButtonComponent.nameintoButtonComponentStyle.componentNamewhere applicable.PurchaseButtonand the validation-warningDefaultPaywallViewpurchase path, usingPaywallLegacyComponentInteractionconstants for stablecomponent_name/component_value.PaywallComponentTypewithpurchase_buttonand keep backend flattening in sync; fixPaywallEventSerializationTeststo castBackendStoredEvent.Paywallsbefore readingevent.paywallCarouselPageChangeparameters intoCarouselPageChangeInteraction(with@Suppress("LongParameterList")on the data class constructor if needed).Note
Medium Risk
Changes paywall analytics emission and URL resolution for purchase-related buttons across both component (V2) and legacy paywalls, which could affect event payloads and downstream reporting. No purchase/entitlement logic is modified, but incorrect URL/package resolution could misattribute interactions.
Overview
Adds a new paywall component interaction type,
PaywallComponentType.PURCHASE_BUTTON, and wires backend flattening/serialization to emit thepurchase_buttonwire value.Updates RevenueCatUI to track purchase CTA taps for both component paywalls (purchase-related
ButtonComponentStyleactions) and legacy templates (including the validation-warning/default paywall), emitting a standardizedpurchase_buttoninteraction with stablecomponent_value, optionalcomponent_name,currentPackageIdentifier/currentProductIdentifier, and consistentcomponent_urlsemantics.Refactors web-checkout URL construction into a shared resolver (
resolveWebCheckoutUrlForInteraction) and adjusts carousel page-change tracking to use aCarouselPageChangeInteractioncontainer to reduce parameter noise; tests are updated/added to validate the new purchase-button interaction shape and stored-event casting.Reviewed by Cursor Bugbot for commit 02014ea. Bugbot is set up for automated code reviews on this repo. Configure here.