-
Notifications
You must be signed in to change notification settings - Fork 404
Track customer center purchases through paywalls #5691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📸 Snapshot Test76 modified, 803 unchanged
🛸 Powered by Emerge Tools |
| @_spi(Internal) public func paywallSource(_ source: PaywallSource?) -> some View { | ||
| self.environment(\.paywallSource, source) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This felt cleaner than adding a parameter to the view
| @MainActor | ||
| func updatePaywallSource(_ source: PaywallSource?) { | ||
| self.paywallSource = source | ||
|
|
||
| if let source { | ||
| self.eventData?.source = source.rawValue | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this to avoid modifying PaywallEvent. Now I am thinking that maybe we should call this offeringSource, rather than paywallSource
| func track(paywallEvent: PaywallEvent, source: String? = nil) async { | ||
| let eventWithSource = paywallEvent.withSource(source) | ||
| self.purchasesOrchestrator.track(paywallEvent: eventWithSource) | ||
| await self.paywallEventsManager?.track(featureEvent: eventWithSource) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me think if we should just add source to any PaywallEvent instead of mutating the event here
24600c5 to
a9885c2
Compare
| } | ||
| ], | ||
| "settings" : { | ||
| "_askToBuyEnabled" : false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to rever this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would revert the last line change of the json files. When they are opened with Xcode, it leaves a blank line at the end. This can cause issues with tests (if these are ever compared upon load)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always use VSCode for this
JZDesign
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, good work!
Motivation
We need to start tracking revenue generated from Customer Center. This PR aims to evolve how we track paywalls, adding a source to it.
Description