Repository navigation
Conversation
… page - chrome.runtime.onInstalled now tracks extension_installed (reason install) or extension_updated (with previous_version) on the install's analytics id. The id is created when missing, with the same key and format as plugins/mixpanel.ts (new helper common/helper/install-id.ts). - The service worker has no window or document, so mixpanel-browser is not loaded there. The events go to Mixpanel's /track endpoint with fetch, through MIXPANEL_API_HOST, in the same shape mixpanel-browser sends. A failed request never throws. - On install it opens https://subturtle.app/?install_id=<id>&utm_source=extension&utm_medium=install for the landing page (D-01). Unpacked builds (local dev, CI e2e) skip the tab, so they do not open the site or count fake installs. - Tests: tests/install-tracking.test.ts. Work list: subturtle-doc docs/tech/analytics-fixes-implementation.md Pairs with landing D-01 (codebridger/subturtle-dashboard-app#144). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…E-01 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Replaced by #62, which combines all extension rows (E-01 to E-06) into one PR. |
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.
What
chrome.runtime.onInstallednow sends one Mixpanel event on the install's analytics id:extension_installed(reasoninstall)extension_updatedwithprevious_version(reasonupdate)analyticsAnonymousId) and format assrc/plugins/mixpanel.ts.https://subturtle.app/?install_id=<install id>&utm_source=extension&utm_medium=installWhy
There was no install event anywhere. The landing page could not be joined to the install that follows it. Work list: subturtle-doc
docs/tech/analytics-fixes-implementation.md(row E-02).Service worker safety
mixpanel-browserneedswindowanddocument. A MV3 service worker has neither. So the background sends the event withfetchto Mixpanel's/trackendpoint (throughMIXPANEL_API_HOST), in the same shapemixpanel-browseruses.One change from the work list
The welcome page opens only for Web Store installs (the manifest has
update_url). Unpacked builds (local dev, the CI e2e run, a dev zip) still send the event but do not open subturtle.app. This stops dev reloads and CI runs from opening the site and counting fake installs on the landing page.How tested
tests/install-tracking.test.ts(install, update, existing id, Chrome update ignored, unpacked build, failed request, URL encoding).yarn typecheck: clean.yarn test: 41 files, 365 tests pass.yarn build: OK.Dependencies
install_idfrom the URL.src/common/helper/install-id.tswith the same content, so they merge in either order. fix(analytics): E-01 E-05 send the install id and trigger with translation calls #58 also makesmixpanel.tsuse this helper; this PR leavesmixpanel.tsalone so it stays independent.🤖 Generated with Claude Code