Commit graph

17 commits

Author SHA1 Message Date
Bill Yang
ca0faeb484
Add goal management functionality in analytics (#100)
* Add goal management functionality in analytics

- Introduced goal creation, deletion, and updating capabilities in the analytics API, allowing users to define conversion goals based on path or event types.
- Implemented corresponding React hooks for managing goals, including fetching, creating, updating, and deleting goals.
- Enhanced the UI with a dedicated Goals page and components for listing and managing goals, improving user experience in tracking conversions.
- Updated package dependencies to include necessary libraries for form handling and validation.

* Enhance goals management with pagination and sorting

- Added pagination and sorting capabilities to the goals fetching logic in the analytics API, allowing users to navigate through goals more efficiently.
- Updated the GoalsPage component to manage current page state and handle page changes, improving user experience.
- Modified the GoalsList component to display pagination metadata and navigation controls, facilitating better goal management.
- Adjusted the server-side getGoals function to support pagination and sorting parameters, ensuring accurate data retrieval.

* Refactor GoalsPage and GoalCard components for improved UI and functionality

- Updated GoalsPage to include a SubHeader component and adjusted layout for better responsiveness.
- Enhanced loading and empty state handling in GoalsPage for a smoother user experience.
- Modified GoalCard to use icons for goal types, improving visual clarity and consistency in the UI.

* Refactor CreateGoalButton and GoalCard components for improved modal handling

- Updated CreateGoalButton to utilize a trigger prop for the GoalFormModal, simplifying modal state management.
- Refactored GoalCard to integrate GoalFormModal for editing goals, enhancing user interaction and reducing state complexity.
- Removed unnecessary state management and modal handling from both components, streamlining the codebase.

* Refactor GoalCard and Clickhouse initialization for improved code clarity

- Removed unnecessary imports in GoalCard component, streamlining the code.
- Updated Clickhouse initialization to include a new 'props' JSON field alongside 'properties', enhancing data structure for analytics.
- Added a utility function in PageviewQueue to parse properties, improving error handling and data integrity.

* enable clickhouse

* fix ch build

* fix ch build

* fix ch build

* wip

* wip

* wip

* Enable json

* add network

* add network

* Refactor Clickhouse configuration and remove unused properties from data models

* Refactor property value handling in analytics queries to utilize native JSON types in ClickHouse, improving type safety and performance.
2025-04-28 20:58:43 -07:00
Bill Yang
03152db284 Update package.json and package-lock.json to include @maxmind/geoip2-node dependency; refactor pageviewQueue to utilize local geolocation service for IP address tracking 2025-04-21 22:33:05 -07:00
Bill Yang
a915489fda
Refactor analytics data structure to replace 'iso_3166_2' with 'region' (#92)
* Refactor analytics data structure to replace 'iso_3166_2' with 'region'

- Updated multiple files across the client and server to change references from 'iso_3166_2' to 'region' for consistency in data handling.
- Adjusted type definitions, API responses, and SQL queries to reflect the new naming convention.
- Enhanced filter parameters and UI components to ensure seamless integration of the updated region data.

* Refactor Clickhouse session table and materialized view creation

- Updated the Clickhouse integration to create a streamlined sessions table with essential fields for session tracking.
- Introduced a materialized view for aggregating session data from events, ensuring accurate session start and end times, along with user and pageview information.
- Removed commented-out code for clarity and improved maintainability.
2025-04-17 22:48:19 -07:00
Bill Yang
009c04cee1 Refactor analytics queries to use 'events' table instead of 'pageviews'
- Updated multiple analytics functions to replace references from 'pageviews' to 'events' for consistency in data tracking.
- Adjusted SQL queries across various files including getEvents, getFunnel, getLiveSessionLocations, and others to ensure accurate event data retrieval.
- Enhanced the deleteSite function to remove events associated with a site, improving data management.
2025-04-17 22:27:03 -07:00
Bill Yang
b234a72f06 Update TopBar component to include an image and enhance UTM parameter tracking in the backend
- Replaced text link with an image link in the TopBar component for improved branding.
- Added UTM parameters to the Clickhouse database schema for better tracking of marketing campaigns.
- Implemented UTM parameter extraction utility and integrated it into the pageview tracking process.
2025-04-17 22:19:20 -07:00
Bill Yang
ecf69fb828 Enhance channel detection and self-referral handling in tracking
- Introduced a new function to check for self-referrals, allowing for better categorization of internal traffic.
- Updated the getChannel function to treat self-referrals without UTM parameters as "Internal" traffic.
- Modified pageviewQueue to clear self-referrer data when applicable, improving data accuracy.
- Added a utility function to clear self-referrer if it matches the current hostname, enhancing tracking precision.
2025-04-04 15:47:48 -07:00
Bill Yang
d7bd778bd6 Update RetentionChart margin and add channel field to Clickhouse schema
- Adjusted the margin of the RetentionChart component for improved layout.
- Added a new 'channel' field to the Clickhouse schema to enhance data tracking capabilities.
- Integrated the 'channel' field into the pageviewQueue to capture additional context from page views.
2025-04-04 15:33:16 -07:00
Bill Yang
cf62c8ccc8 Implement real-time session location map with zoom functionality
- Added a new RealtimePage component to display live session locations on a map.
- Integrated zoom handling to adjust circle sizes based on session counts.
- Utilized GeoJSON for rendering country boundaries and added tooltips for session count visibility.
- Updated server routes to fetch live session locations data.
2025-03-30 22:49:03 -07:00
Bill Yang
1ccf714b91 im dumb 2025-03-26 17:56:48 -07:00
Bill Yang
4f4bea40b7 log 2025-03-26 17:54:46 -07:00
Bill Yang
12f8d06f74 add lat lon 2025-03-25 23:55:31 -07:00
Bill Yang
545c3bc174 update event type 2025-03-15 23:25:02 -07:00
Bill Yang
fcdbe1429f add event tracking 2025-03-15 21:41:41 -07:00
Bill Yang
c928e9ccbb wip 2025-03-14 16:45:05 -07:00
Edward Cui
aa62a3c843
Improve Map (#29)
* Mostly working map

* Fix tooltip

* Merge position and viewOptions state

* Merge Position and ViewOptions into MapView

* Rework tooltip state and display country flag

* Minor map back button text change

* Rebase to resolve merge conflicts

* Fix tooltip

* Merge position and viewOptions state

* Merge Position and ViewOptions into MapView

* Rework tooltip state and display country flag

* Minor map back button text change

* Delete map from before stuff got moved around

* Use Leaflet map

* Remove outline on click and highlight region on hover

* Remove Antarctica from countries.geojson

* Remove countries with no ISO_A2 (Dhekelia Sovereign Base Area, Somaliland, US Naval Base Guantanamo Bay, Brazilian Island, Northern Cyprus, Cyprus No Mans Area, Siachen Glacier, Baykonur Cosmodrome, Akrotiri Sovereign Base Area, Southern Patagonian Ice Field, Bir Tawil, Indian Ocean Territories, Coral Sea Islands, Spratly Islands, Clipperton Island, Ashmore and Cartier Islands, Bajo Nuevo Bank (Petrel Is.), Serranilla Bank, Scarborough Reef)

* Remove Antarctica from subdivisions.geojson

* Remove subdivisions for countries with no ISO_A2 (Dhekelia Sovereign Base Area, Somaliland, US Naval Base Guantanamo Bay, Northern Cyprus, Siachen Glacier, Baykonur Cosmodrome, Akrotiri Sovereign Base Area, Indian Ocean Territories, Coral Sea Islands, Spratly Islands, Clipperton Island, Ashmore and Cartier Islands)

* Remove react-simple-maps

* package-lock.json change after npm install

* Center tooltip and modify hover opacity

* Center map on load

* Fix tooltips not reflecting updated data

* Remove old countries and subdivisions geojson

* Add new countries and subdivisions json
2025-03-11 21:03:34 -07:00
Bill Yang
e54284d902 update pv queue 2025-02-26 08:44:23 -08:00
Bill Yang
d6a1112648 add loading state to sites with no data 2025-02-21 22:11:19 -08:00
Renamed from server/src/actions/pageviewQueue.ts (Browse further)