Skip to content
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

Track TestFlight vs AppStore installations in Posthog #1735

Merged
merged 7 commits into from
Jan 15, 2025

Conversation

pelumy
Copy link
Contributor

@pelumy pelumy commented Jan 15, 2025

Issues covered

#130

Description

This PR tries to track where the app running in the user's device is downloaded from. There is a link in the ticket that shows that the appstoreReceiptUrl can be used to differentiate App Store from TestFlight.

There were 2 tracking options: Identify and Capture.

Though, Identify matches the user to a specific event across all devices, so no single user's download across various devices is tracked twice.

I opted to use Capture instead because, if the user is not logged in, we won't be able to associate them with their unique id, which can be their npub in this case. It also defeats the purpose of getting the real number of downloads as it won't count a user that hasn't logged in yet. But it will include each download by a single user across multiple devices.

If we only want to get the number of downloads of people, I can update the tracking to use identify instead of capture.

How to test

Merge and check if events shows up on Posthog after app is downloaded on TestFlight and App Store.

Nos/Service/Analytics.swift Show resolved Hide resolved
Nos/Extensions/Bundle+Current.swift Outdated Show resolved Hide resolved
Nos/Extensions/Bundle+Current.swift Outdated Show resolved Hide resolved
Nos/Extensions/Bundle+Current.swift Show resolved Hide resolved
pelumy and others added 3 commits January 15, 2025 14:55
Co-authored-by: Bryan Montz <bryanmontz@me.com>
Co-authored-by: Bryan Montz <bryanmontz@me.com>
@pelumy pelumy requested a review from bryanmontz January 15, 2025 14:44
@pelumy pelumy added this pull request to the merge queue Jan 15, 2025
Merged via the queue into main with commit 2103c57 Jan 15, 2025
4 checks passed
@pelumy pelumy deleted the it/track-installation-source branch January 15, 2025 20:15
@mplorentz
Copy link
Member

@pelumy did you test this on the macOS version of our app? I thought I read somewhere that the receipt trick doesn't work on macOS.

@pelumy
Copy link
Contributor Author

pelumy commented Jan 15, 2025

@pelumy did you test this on the macOS version of our app? I thought I read somewhere that the receipt trick doesn't work on macOS.

@mplorentz, this only works for iOS. I didn't include the macOS one because we don't have the app released on macOS. Do we want to include that?

@mplorentz
Copy link
Member

@pelumy yeah I think that's a requirement. We do have the app released on macOS, it's just not compiled for macOS. But it shows up in the Mac App Store under "iPhone & iPad apps". I think currently we'll count TestFlight installs on macOS as App Store installs, so the numbers will be off. I think this gist claims to work on macOS too.

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.

3 participants