Add public track(_:params:) analytics alias#483
Draft
claude[bot] wants to merge 3 commits into
Draft
Conversation
Adds a thin, fire-and-forget convenience alias that delegates to register(placement:params:handler:) with handler nil. Lets developers send arbitrary analytics events that are queryable via the Query API, without paywall presentation handling or feature gating. Includes Objective-C overloads mirroring the existing register convenience methods.
Give the @objc track convenience overloads explicit selectors (trackEvent:, trackEvent:params:) so they no longer collide with the track: selector exported by the unavailable track tombstone in SuperwallGraveyard.
The @objc track convenience overloads shared the Swift signature track(_:params:) with the active Swift track(_:params:) alias. @available(swift, obsoleted: 1.0) does not exempt a declaration from Swift's redeclaration check (only @available(*, unavailable) does), so the module failed to compile (run-tests and build-maccatalyst, exit 65). Give the ObjC-only overloads a labeled 'event:' parameter so their Swift signatures (track(event:), track(event:params:)) are distinct from the Swift track(_:params:), mirroring the existing register(placement:) ObjC convenience pattern. The explicit trackEvent:/trackEvent:params: ObjC selectors are unchanged, so the Objective-C API is preserved.
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.
Requested by Jake Mor · Slack thread
Changes in this pull request
track(_:params:)convenience alias (plus Objective-C overloads) for sending fire-and-forget analytics events.Before / After
Before, sending an arbitrary analytics event meant calling the paywall-oriented
registermethod and supplying a (possibly empty) handler:After, developers can use a dedicated, intent-revealing alias with no handlers or callbacks:
This positions Superwall as an agent-first analytics destination: events are uncapped, free, and queryable via the Query API.
How
track(_:params:)is a thin delegation — it forwards directly to the existingregister(placement:params:handler:)overload withhandlerset tonil. No registration logic is duplicated; all tracking/presentation behavior remains ininternallyRegister. Objective-C overloads (track(_:)andtrack(_:params:)) mirror the existing@objc register(placement:)/register(placement:params:)convenience methods so ObjC callers can use it too.Naming note
trackwas chosen as the analytics alias because it matches the vocabulary developers expect from analytics SDKs (Mixpanel/Amplitude/PostHog). Reviewers should weigh in if they'd prefertrackEventorregisterEventinstead.Checklist
CHANGELOG.mdfor any breaking changes, enhancements, or bug fixes.swiftlintin the main directory and fixed any issues.Generated by Claude Code