🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Refactor filter parameters in user page and enhance getUsers API response structure by adding browser and operating system version fields for improved analytics.
Bill Yangb3f955e52a40
diff --git a/client/src/lib/filterGroups.ts b/client/src/lib/filterGroups.tsindex e8144212a..abe7ec37d 100644--- a/client/src/lib/filterGroups.ts+++ b/client/src/lib/filterGroups.ts@@ -52,8 +52,6 @@ export const USER_PAGE_FILTERS: FilterParameter[] = ["device_type","referrer","user_id",- "lat",- "lon",];export const JOURNEY_PAGE_FILTERS: FilterParameter[] = [diff --git a/server/src/api/analytics/getUsers.ts b/server/src/api/analytics/getUsers.tsindex a3e7e3b2f..ff5208321 100644--- a/server/src/api/analytics/getUsers.ts+++ b/server/src/api/analytics/getUsers.ts@@ -33,7 +33,13 @@ export interface GetUsersRequest {}export async function getUsers(req: FastifyRequest<GetUsersRequest>, res: FastifyReply) {- const { filters, page = "1", page_size: pageSize = "20", sort_by: sortBy = "last_seen", sort_order: sortOrder = "desc" } = req.query;+ const {+ filters,+ page = "1",+ page_size: pageSize = "20",+ sort_by: sortBy = "last_seen",+ sort_order: sortOrder = "desc",+ } = req.query;const site = req.params.site;const pageNum = parseInt(page, 10);@@ -58,7 +64,9 @@ WITH AggregatedUsers AS (argMax(city, timestamp) AS city,argMax(language, timestamp) AS language,argMax(browser, timestamp) AS browser,+ argMax(browser_version, timestamp) AS browser_version,argMax(operating_system, timestamp) AS operating_system,+ argMax(operating_system_version, timestamp) AS operating_system_version,argMax(device_type, timestamp) AS device_type,argMax(screen_width, timestamp) AS screen_width,argMax(screen_height, timestamp) AS screen_height,