Commit Graph
49 Commits
Author SHA1 Message Date
Francis Cao b3aec54bb3 Fix excludeBounce query, simplify bounce definition for SPA websites, query routing for performance, add tests 2026-07-30 09:34:35 -07:00
Federico D'Eredità cb035fdc1a feat(queries): add BOUNCE_THRESHOLD and enhance bounce calculation logic
Updated bounce calculations to account for visits with custom events
(`EVENT_TYPE.customEvent`). A visit counts as a bounce only when its
custom event count is below `BOUNCE_THRESHOLD`, so engaged single
pageview visits are no longer misreported.

Since #3614 was opened v3 moved `getInsights` into `getBreakdown` and
copied the old formula into the channel, pageview and session
breakdowns, so those are updated too.
2026-07-26 18:49:59 +02:00
Francis Cao 9bf95ef112 updaet session stitching model for post-identify reads. fix fullPath search 2026-07-20 12:21:07 -07:00
Mike Cao 306ca4a435 Lint format files. Updated rng function. 2026-06-02 22:35:07 -07:00
Francis Cao fa182d0947 implement URL pageview metric/expanded metric 2026-05-07 16:59:30 -07:00
Francis Cao 73c045118b Merge branch 'dev' into fix/pages-url-query 2026-05-07 16:15:46 -07:00
Francis Cao 04eb4b675e 3.1 relational bug fixes 2026-04-15 10:31:21 -07:00
seojcarlos c229f7466f fix: revert arrayMap on stats_hourly to avoid misaligned arrays
The website_event_stats_hourly materialized view stores url_path and
url_query as independently filtered arrays, so their indices do not
correspond event-by-event. Using arrayMap to zip them would produce
wrong URL pairings and silently drop entries.

Reverted the stats_hourly path to use arrayJoin(url_path) as before.
The url_query concatenation still works correctly on direct
website_event queries (both PostgreSQL and ClickHouse).
2026-04-08 08:22:49 +02:00
seojcarlos 509a91b990 fix: include url_query in pages report display
Pages report now concatenates url_path and url_query when rendering
URLs, so pages like /viewtopic.php?t=1 and /viewtopic.php?t=2 are
shown as separate entries instead of collapsing into /viewtopic.php.

Applies to PostgreSQL and ClickHouse queries for path, entry, and
exit page types in both standard and expanded metrics views.

Fixes #4133
2026-04-07 19:56:33 +02:00
Francis Cao f6a6d2cc31 performance updates checkpoint 2026-03-05 10:12:30 -08:00
Francis Cao ee698b636a implement exclude bounces feature 2026-01-30 00:12:13 -08:00
Francis Cao 9339383497 remove www. prefix from hostname during comparison. Closes #3256 2026-01-28 17:18:03 -08:00
Francis Cao 3f173889ea Fix "name" alias for relational query to be compatible with Postgres 12. Closes #3970 2026-01-22 22:04:11 -08:00
Mike Cao 5a44e6deb2 Merge pull request #3791 from travzhang/master
fix: fix SQL syntax error in getPageviewExpandedMetrics query
2025-11-25 16:05:58 -08:00
Travis Zhang 67e1af7e55 fix: fix SQL syntax error in getPageviewExpandedMetrics query 2025-11-25 21:13:35 +08:00
Mike Cao fa8d8055df Reformatted files with biome. 2025-11-22 22:42:42 -08:00
Francis Cao 30781430c5 remove timezone from realtime. Closes #3700 2025-11-11 13:13:25 -08:00
Francis Cao 2ffde37f5b v3 prisma queries update 2025-10-27 11:48:35 -07:00
Francis Cao 61b667c587 update psql expanded metrics queries 2025-10-24 10:38:35 -07:00
Mike Cao 1def80ba42 Merge remote-tracking branch 'origin/dev' into dev 2025-10-02 16:57:23 -07:00
Mike Cao da572864ac Added more function names to queries. 2025-10-02 16:56:56 -07:00
Francis Cao 1809959b99 fix event type queries for pixels/links. remove hardcoded event types 2025-10-01 12:29:31 -07:00
Mike Cao 8a977b0164 Updated pixel/link endpoints. Added name to rawQuery. 2025-09-30 16:11:21 -07:00
Mike Cao 08f9adaddf Updated expanded view. Some style fixes. 2025-08-23 03:05:21 -07:00
Francis Cao 2f1f704728 implement filtering and cohorts to all relevant queries 2025-08-19 15:26:41 -07:00
Francis Cao 69aa4ca035 cleanup cohort/filtering for some queries 2025-08-12 16:13:44 -07:00
Francis Cao 38f251ead5 finish expanded queries and ui. 2025-08-07 09:47:18 -07:00
Francis Cao 0a0c1f27c6 implement pageviews, events, and channels queries 2025-08-05 00:37:44 -07:00
Mike Cao 25f96f6b6b Fixed nav display. 2025-07-20 00:38:15 -07:00
Mike Cao 2f7f8911cd Merge branch 'dev' into jajaja
# Conflicts:
#	pnpm-lock.yaml
#	src/queries/sql/getWebsiteStats.ts
#	src/queries/sql/pageviews/getPageviewMetrics.ts
#	src/queries/sql/sessions/getWebsiteSessionStats.ts
#	src/queries/sql/sessions/getWebsiteSessions.ts
#	src/queries/sql/sessions/getWebsiteSessionsWeekly.ts
2025-07-18 10:13:21 -07:00
Francis Cao 954404f8df route to view or raw table based on filters 2025-07-15 16:26:03 -07:00
Mike Cao a9a9b57f80 Merge branch 'dev' into jajaja
# Conflicts:
#	pnpm-lock.yaml
#	src/app/(main)/websites/[websiteId]/events/EventProperties.tsx
#	src/components/messages.ts
#	src/lib/constants.ts
#	src/queries/sql/pageviews/getPageviewMetrics.ts
#	src/queries/sql/sessions/getWebsiteSessions.ts
2025-07-15 13:01:50 -07:00
Francis Cao 2dcb9e21bd change pagestable to visitors and update clickhouse hostname column to array 2025-07-13 22:44:09 -07:00
Mike Cao 8c26e310f7 Fixed editing and navigation issues. 2025-07-13 00:37:43 -07:00
Mike Cao 87449ece9e Merge branch 'dev' into jajaja
# Conflicts:
#	db/postgresql/schema.prisma
#	pnpm-lock.yaml
#	src/app/(main)/websites/[websiteId]/WebsiteDetailsPage.tsx
#	src/app/(main)/websites/[websiteId]/compare/WebsiteComparePage.tsx
#	src/app/api/reports/route.ts
#	src/app/api/websites/[websiteId]/events/series/route.ts
#	src/app/api/websites/[websiteId]/metrics/route.ts
#	src/app/api/websites/[websiteId]/pageviews/route.ts
#	src/app/api/websites/[websiteId]/sessions/stats/route.ts
#	src/app/api/websites/[websiteId]/stats/route.ts
#	src/app/api/websites/[websiteId]/values/route.ts
#	src/components/hooks/useFields.ts
#	src/components/hooks/useFilterParams.ts
#	src/lang/vi-VN.json
#	src/lib/clickhouse.ts
#	src/lib/detect.ts
#	src/lib/prisma.ts
#	src/lib/request.ts
#	src/lib/schema.ts
#	src/lib/types.ts
#	src/queries/sql/events/getEventDataFields.ts
#	src/queries/sql/events/getEventDataProperties.ts
#	src/queries/sql/events/getEventDataStats.ts
#	src/queries/sql/events/getEventDataValues.ts
#	src/queries/sql/events/getEventMetrics.ts
#	src/queries/sql/events/getWebsiteEvents.ts
#	src/queries/sql/getChannelMetrics.ts
#	src/queries/sql/getRealtimeActivity.ts
#	src/queries/sql/getWebsiteStats.ts
#	src/queries/sql/pageviews/getPageviewMetrics.ts
#	src/queries/sql/pageviews/getPageviewStats.ts
#	src/queries/sql/reports/getBreakdown.ts
#	src/queries/sql/sessions/getSessionDataProperties.ts
#	src/queries/sql/sessions/getSessionDataValues.ts
#	src/queries/sql/sessions/getSessionMetrics.ts
#	src/queries/sql/sessions/getSessionStats.ts
#	src/queries/sql/sessions/getWebsiteSessionStats.ts
#	src/queries/sql/sessions/getWebsiteSessions.ts
2025-07-08 22:03:55 -07:00
Mike Cao cdf391d5c2 Refactor part 2: Electric Boogaloo. Standardize way of passing filter parameters. 2025-07-04 01:23:11 -07:00
Francis Cao e75d009df3 implement cohorts to clickhouse/pg library and all relevant queries 2025-07-03 12:06:49 -07:00
Mike Cao ee6c68d27c Refactor filter handling for queries. 2025-07-02 01:44:12 -07:00
Mike Cao 8b64029409 Made filters work for all reports. 2025-06-29 23:57:11 -07:00
Mike Cao 543674c7f2 Updated hooks. Changed url, host to path, hostname. 2025-06-20 22:35:02 -07:00
Mike Cao 3a737e7e25 Fixed bar chart rendering. 2025-06-18 21:31:42 -07:00
Francis Cao 12b8ac4272 app and db schema - region rename, hostname move 2025-04-24 22:42:33 -07:00
Francis Cao ab08fcb00f fix pageview metrics / channel metrics 2025-02-12 13:20:54 -08:00
Francis Cao 4b3b9f1ee1 change referrers table from views to visitors 2025-02-12 09:51:45 -08:00
Mike Cao 2df67fbad9 Fixed reports loading the wrong dates. 2025-02-11 11:27:13 -08:00
Mike Cao 9cc648e589 Fixed pageviews query. Closes #3162 2025-02-11 08:16:40 -08:00
Mike Cao 1d15a88370 Fixed search. Updated queries to not use domain. 2025-02-11 05:40:23 -08:00
Mike Cao 7a0575e33a Removed output parsing for clickhouse. 2025-02-08 20:08:36 -08:00
Mike Cao dcf0da7b14 Renamed folder. 2025-02-05 20:31:48 -08:00