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

Anonymous Analytics #398

Open
7 of 14 tasks
Alfagun74 opened this issue Apr 27, 2024 · 0 comments
Open
7 of 14 tasks

Anonymous Analytics #398

Alfagun74 opened this issue Apr 27, 2024 · 0 comments
Labels
💻 client There are things to do on the client 🔧 feature New feature or request 🎛️ server There are things to do on the server

Comments

@Alfagun74
Copy link
Contributor

Alfagun74 commented Apr 27, 2024

To understand how people use GameVault better, we could track anonymous data both in the backend and on the frontend. This means we can collect information to see what parts of the software needs improving and which features users like the most.

The Microsoft Store gives us some basic numbers, but they're not very detailed.

We'll make sure users can choose to turn off this tracking if they want to.

Here are some examples of the information we could collect:

  • When and for how long people are using GameVault actively. (This could help us decide when to release updates.)
  • How many games users have, what types they are, and which platforms they're on. (This could help us make GameVault run better.)
  • Popular preferences like whether users use SQLITE or Postgres, or if they have Auto-Extract turned on. (This could help us make default settings easier to understand.)
  • Which parts of our user interface are used a lot and which ones aren't. (This could help us focus on adding new features, removing unused ones, and improving the ones that work well.)
  • Hardware Stats ( For example for Performance Optimization )

We currently use swetrix.com for website analytics. I believe we can also use their API to track data in these services.

Backend: https://github.com/Swetrix/swetrix-node
Client: https://docs.swetrix.com/events-api

To-Do:

Settings

  • Implement Settings Toggle (Default On): "Send anonymous usage reports to Phalcode to help us improve your experience."
  • Toggle should disable any analytics
  • Get IP Address of user on app startup: (string pubIp = new System.Net.WebClient().DownloadString("https://api.ipify.org");)

Heartbeat

  • The GameVault App sends a Heartbeat every 30 Seconds
    • Request:
      POST https://analytics.platform.phalco.de/log/hb
      {"pid":"N2kuL4i8qmOQ"}
    • Headers:
      User-Agent: Gamevault/13.0.0 (like everywhere else)
      X-Client-IP-Address: Ip Adress of the user.
  • Fire and forget. Ignore response.

Log Page Views

  • The App should log a page-view event on every visual view it opens. (e.g. GameView, LibraryView, GameSettings)
    • Request:
      POST https://analytics.platform.phalco.de/log
      {
        "pid":"N2kuL4i8qmOQ",
        "tz": "Europe/Berlin", //Timezone of the user, as IANA Time Zone Database identifier like (Europe/Berlin) (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
        "pg": "/library", //Imaginary page structure the User is on / is the root (e.g. /library, /game, /settings, /settings/data, /community/user-settings/, etc.)
        "prev": "/library", // Previous page the user was on. When switching from /library to /game this is /library
        "lc": "en-US", // Locale of the user (IETF language tag standard)
      }
    • Headers:
      User-Agent: Gamevault/13.0.0 (like everywhere else)
      X-Client-IP-Address: Ip Adress of the user.
    • Fire and forget. Ignore response.

Log Button Clicks

  • The App should track all button click events by using a global eventlistener and some sort of id like automation ID
    • Request:
      POST https://analytics.platform.phalco.de/log/custom
      {
        "pid":"N2kuL4i8qmOQ",
        "ev": "click_Window.MainGrid.MainPanel.SubmitButton" // Visualtreepath of the button. 
        "tz": "Europe/Berlin", //Timezone of the user, as IANA Time Zone Database identifier like (Europe/Berlin) (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
        "pg": "/library", //Imaginary page structure the User is on / is the root (e.g. /library, /game, /settings, /settings/data, /community/user-settings/, etc.)
        "lc": "en-US", // Locale of the user (IETF language tag standard)
      }
    • Headers:
      User-Agent: Gamevault/13.0.0 (like everywhere else)
      X-Client-IP-Address: Ip Adress of the user.
    • Fire and forget. Ignore response.

Log Custom Events

  • The App should track specific custom events with some metadata that are useful to our work. for example:
    • Request:
      POST https://analytics.platform.phalco.de/log/custom
      {
        "pid":"N2kuL4i8qmOQ",
        "ev": "game_download" // custom event name
        "tz": "Europe/Berlin", //Timezone of the user, as IANA Time Zone Database identifier like (Europe/Berlin) (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
        "pg": "/library", //Imaginary page structure the User is on / is the root (e.g. /library, /game, /settings, /settings/data, /community/user-settings/, etc.)
        "lc": "en-US", // Locale of the user (IETF language tag standard)
        "meta": {size: "21252521", game_type: "PORTABLE_WIN"} // js object with anything we need. ONLY STRING VALUES ALLOWED!
      }
    • Headers:
      User-Agent: Gamevault/13.0.0 (like everywhere else)
      X-Client-IP-Address: Ip Adress of the user.
    • Fire and forget. Ignore response.

Events we need

Implemented Event Tracking Name Metadata to track
No Start App APP_INITIALIZED App Settings, Hardware Info.
No Load Installed Games INSTALLED_GAMES_LOADED Count of Installed games, Row Count
No Load Server Games SERVER_GAMES_LOADED Count of total server games
No Filter Games SEARCH_FILTERS_CHANGED All Filters Used
No Start Download GAME_DOWNLOAD_STARTED Game Size, Game Type
No Abort Download GAME_DOWNLOAD_ABORTED Game Size, Game Type, Download Progress
No Pause Download GAME_DOWNLOAD_PAUSED Game Size, Game Type, Download Progress
No Resume Download GAME_DOWNLOAD_RESUMED Game Size, Game Type, Download Progress
No Finish Download GAME_DOWNLOAD_COMPLETED Game Size, Game Type
No Start Extraction GAME_EXTRACTION_STARTED Game Size, Game Type
No Abort Extraction GAME_EXTRACTION_ABORTED Game Size, Game Type, Extraction Progress
No Finish Extraction GAME_EXTRACTION_COMPLETED Game Size, Game Type
No Start Installation GAME_INSTALLATION_STARTED Game Size, Game Type
No Finish Installation GAME_INSTALLATION_COMPLETED Game Size, Game Type
No Start Uninstallation GAME_UNINSTALLATION_STARTED Game Size, Game Type
No Finish Uninstallation GAME_UNINSTALLATION_COMPLETED Game Size, Game Type
No Set A Games Progress (for you or somebody else) PROGRESS_CHANGED State
No Switch Community Profile COMMUNITY_PROFILE_VIEWED Opened Users Id
No Change Community Sorting COMMUNITY_SORTING_CHANGED Sorting Option
No Load Metadata Providers METADATA_PROVIDERS_LOADED List of used Providers and their priorities
No Search Metadata Provider for Remap METADATA_SEARCHED Provider Slug
No Map Metadata METADATA_MAPPED Provider Slug
No Unmap Metadata METADATA_UNMAPPED Provider Slug
No Change Provider Priority METADATA_PRIORITY_CHANGED Provider Slug, Priority

Track Errors

Swetrix also supports Error tracking!

  • Clarify together whether we replace or extend the current Phalcode Discord Webhook Error Handler
  • If Analytics Setting is enabled or Send Crashlog is on, send all unhandled client exceptions to:
    • Request:
      POST https://analytics.platform.phalco.de/error
       {
           "pid": "N2kuL4i8qmOQ",
           "name": ex.GetType().Name,
           "message": ex.Message, (max 2000 characters.)
           "lineno": new System.Diagnostics.StackTrace(ex, true).GetFrame(0)?.GetFileLineNumber() ?? 0,
           "filename": new System.Diagnostics.StackTrace(ex, true).GetFrame(0)?.GetFileName() ?? "unknown",
           "tz": "Europe/Berlin", //Timezone of the user, as IANA Time Zone Database identifier like (Europe/Berlin) (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
           "pg": "/library", //Imaginary page structure the User is on / is the root (e.g. /library, /game, 
           "lc": "en-US", // Locale of the user (IETF language tag standard)
      }
    • Headers:
      User-Agent: Gamevault/13.0.0 (like everywhere else)
      X-Client-IP-Address: Ip Adress of the user.
  • Fire and forget. Ignore response.
@Alfagun74 Alfagun74 added 🔧 feature New feature or request 🎛️ server There are things to do on the server 💻 client There are things to do on the client labels Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 client There are things to do on the client 🔧 feature New feature or request 🎛️ server There are things to do on the server
Projects
Status: 🧑‍💻 In progress
Development

No branches or pull requests

1 participant