Skip to content

Add public track(_:params:) analytics alias#483

Draft
claude[bot] wants to merge 3 commits into
developfrom
track-placement-alias
Draft

Add public track(_:params:) analytics alias#483
claude[bot] wants to merge 3 commits into
developfrom
track-placement-alias

Conversation

@claude

@claude claude Bot commented Jun 27, 2026

Copy link
Copy Markdown

Requested by Jake Mor · Slack thread

Changes in this pull request

  • Adds a public 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 register method and supplying a (possibly empty) handler:

Superwall.shared.register(placement: "checkout_started", params: ["sku": "pro_yearly"], handler: nil)

After, developers can use a dedicated, intent-revealing alias with no handlers or callbacks:

Superwall.shared.track("checkout_started", params: ["sku": "pro_yearly"])

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 existing register(placement:params:handler:) overload with handler set to nil. No registration logic is duplicated; all tracking/presentation behavior remains in internallyRegister. Objective-C overloads (track(_:) and track(_:params:)) mirror the existing @objc register(placement:) / register(placement:params:) convenience methods so ObjC callers can use it too.

Naming note

track was 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 prefer trackEvent or registerEvent instead.

Checklist

  • All unit tests pass.
  • All UI tests pass.
  • Demo project builds and runs on iOS.
  • Demo project builds and runs on Mac Catalyst.
  • Demo project builds and runs on visionOS.
  • I added/updated tests or detailed why my change isn't tested.
  • I added an entry to the CHANGELOG.md for any breaking changes, enhancements, or bug fixes.
  • I have run swiftlint in the main directory and fixed any issues.
  • I have updated the SDK documentation as well as the online docs.
  • I have reviewed the contributing guide

Generated by Claude Code

claude added 3 commits June 27, 2026 13:50
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant