You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Settings (# of blocked URLs, screenshots enabled, cookies enabled, localstorage enabled)
Page clicked (viewed)
Total archive size
Non-compliant requirements:
Self-hosted Matomo (currently using test environment)
Requires further human verification:
Verify that the analytics data is being properly received in the Matomo dashboard
Confirm that the opt-out functionality completely stops all tracking
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 Security concerns
Sensitive information exposure: The implementation tracks URLs of archived pages and sends them to Matomo. While this is expected for analytics, it's important to ensure users understand that their browsing history (in the form of archived URLs) is being sent to a third-party service. The opt-out option helps mitigate this concern, but the PR should ensure that when analytics is disabled, no data is sent to Matomo.
The Matomo URL and Site ID are hardcoded in the file. As mentioned in the PR description, these will need to be updated with the proper credentials once provided.
All event tracking functions include console.log statements that should be removed or disabled in production to avoid cluttering the console.
exportasyncfunctiononPageClicked(pageUrl: string): Promise<void>{console.log("onPageClicked called with URL:",pageUrl);awaittrackEvent("Archive","ViewPage",pageUrl);}// Track when a torrent is created for sharingexportasyncfunctiononTorrentCreated(numPages: number): Promise<void>{console.log("onTorrentCreated called with pages:",numPages);awaittrackEvent("Sharing","TorrentCreated",`${numPages} pages`);}// Track when a page is successfully archivedexportasyncfunctiononPageArchived(pageUrl: string,pageSize?: number,): Promise<void>{console.log("onPageArchived called:",pageUrl,pageSize);awaittrackEvent("Archive","PageArchived",pageUrl);// If page size is provided, track it separatelyif(pageSize!==undefined){awaittrackEvent("Archive","PageSize",`${Math.round(pageSize/1024)}KB`);}}// Track settings changesexportasyncfunctiononSettingsChanged(settingName: string,value: string|boolean|number,): Promise<void>{console.log("onSettingsChanged:",settingName,value);awaittrackEvent("Settings",settingName,String(value));}// Track total archive sizeexportasyncfunctiontrackArchiveSize(totalSizeBytes: number): Promise<void>{constsizeMB=Math.round(totalSizeBytes/(1024*1024));console.log("trackArchiveSize:",sizeMB,"MB");awaittrackEvent("Archive","TotalSize",`${sizeMB}MB`);}// Track when archiving startsexportasyncfunctiononArchivingStarted(pageUrl: string): Promise<void>{console.log("onArchivingStarted:",pageUrl);awaittrackEvent("Archive","Started",pageUrl);}// Track when archiving stopsexportasyncfunctiononArchivingStopped(reason: string="manual",): Promise<void>{console.log("onArchivingStopped:",reason);awaittrackEvent("Archive","Stopped",reason);}
The checkAndTrackArchiveSize function is called frequently and may impact performance, especially with the 5-minute interval timer that runs continuously.
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
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.
User description
Implemented matomo analytics (for now, in my own matomo environment). #39
Once Chase provides me with the credentials, I will change the URL and SITE_ID.
PR Type
Enhancement
Description
Implemented Matomo analytics with opt-out capability
Added event tracking for user actions
Created archive size monitoring system
Added analytics toggle in settings
Changes walkthrough 📝
matomo.ts
Core Matomo analytics implementationsrc/matomo.ts
events.ts
Event tracking system implementationsrc/events.ts
bg.ts
Background tracking integrationsrc/ext/bg.ts
settings-page.ts
Analytics settings UI implementationsrc/settings-page.ts
recorder.ts
Archive event tracking integrationsrc/recorder.ts
argo-archive-list.ts
Page view tracking integrationsrc/argo-archive-list.ts
sidepanel.ts
Torrent creation trackingsrc/sidepanel.ts