Arthur Sepiol
a902a87c08
feat: implement identity stitching for session linking ( #3820 )
...
Adds automatic session linking/identity stitching to link anonymous
browsing sessions with authenticated user sessions.
## Changes
### Database Schema
- Add `identity_link` table (PostgreSQL + ClickHouse) to store mappings
between visitor IDs and authenticated user IDs
- Add `visitor_id` field to `Session` model
- Add `visitor_id` column to ClickHouse `website_event` table
### Client Tracker
- Generate and persist `visitor_id` in localStorage
- Include `vid` in all tracking payloads
- Support opt-out via `data-identity-stitching="false"` attribute
### API
- Accept `vid` parameter in `/api/send` endpoint
- Auto-create identity links when `identify()` is called with both
visitor_id and distinct_id
- Store visitor_id in sessions and events
### Query Updates
- Update `getWebsiteStats` to deduplicate visitors by resolved identity
- Visitors who browse anonymously then log in are now counted as one user
## Usage
When a user logs in, call `umami.identify(userId)`. If identity stitching
is enabled (default), the tracker automatically links the anonymous
visitor_id to the authenticated userId. Stats queries then resolve
linked identities to accurately count unique visitors.
Resolves #3820
2025-12-03 16:06:54 +03:00
Francis Cao
16451dd5cd
update CH view to account for new event types
Create docker images / Build, push, and deploy (push) Waiting to run
Node.js CI / build (postgresql, 18.18, 10) (push) Waiting to run
2025-10-02 10:18:13 -07:00
Francis Cao
822ddee9ae
update ch schema for custom data numbers
2025-08-12 09:15:42 -07:00
Francis Cao
38f251ead5
finish expanded queries and ui.
2025-08-07 09:47:18 -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
b2a6e3f842
Merge pull request #3505 from eoussama/master
...
Added optional website ID for creation
2025-07-07 22:58:16 -07:00
Matt Harrington
19ccfa0745
fixing the clickhouse schema file
2025-06-13 12:17:18 -07:00
Francis Cao
9a437dcfa2
convert attribution report
2025-06-07 07:43:36 -07:00
Francis Cao
a16846f4ce
add website_revenue table and view. update revenue report to use view
2025-06-06 08:47:52 -07:00
Francis Cao
c5efc27c07
distinct_id schema changes and search on sessions page
2025-04-29 08:57:58 -07:00
Francis Cao
12b8ac4272
app and db schema - region rename, hostname move
2025-04-24 22:42:33 -07:00
Francis Cao
e51ec70093
fix ch migration script
2025-04-13 18:46:53 -07:00
Francis Cao
b9a2145766
ch attribution report, schema changes, and migration
2025-04-13 18:12:03 -07:00
Francis Cao
203e782530
Create attribution report template and parameters
2025-03-18 10:00:23 -07:00
Francis Cao
a708e6c350
add tags to ch schema file
2024-10-17 09:53:07 -07:00
Francis Cao
8759ba9916
add tags table and filters logic
2024-10-15 16:46:57 -07:00
Francis Cao
bffb98cd51
add tag migrations and update send / saveEvent
2024-10-15 11:29:27 -07:00
Francis Cao
c79720ae1d
update session data schema
2024-08-15 09:28:39 -07:00
Francis Cao
3207b0ce06
revert AggregatingMergeTree order by
2024-08-01 16:40:48 -07:00
Francis Cao
57a23bab2d
fix hourly order by
2024-08-01 16:16:18 -07:00
Francis Cao
61dfa1391e
add projection code
2024-08-01 15:34:35 -07:00
Francis Cao
cb4368e12c
template multiple queries for filtering
2024-07-31 09:35:29 -07:00
Francis Cao
161da582ba
reorder CH stats index
2024-07-24 16:57:23 -07:00
Francis Cao
174b9e4376
only use hourly table, remove daily table logic, fix updatechart undefined
2024-07-23 22:35:11 -07:00
Francis Cao
038ecdb592
fix pkey for stats tables
2024-07-23 15:34:25 -07:00
Francis Cao
5299e9f579
resolve entry / exit queries
2024-07-22 21:30:06 -07:00
Francis Cao
7381254cc2
add relational migrations. update event_key references to data_key
2024-04-08 20:24:15 -07:00
Francis Cao
cc834083d9
update CH schema/migration to include session_data
2024-04-08 16:36:31 -07:00
Francis Cao
ab58c76b6a
change views back to pageviews
2024-03-27 11:17:00 -07:00
Francis Cao
c033b0582d
create join table and remove subquery from insert
2024-03-25 19:13:54 -07:00
Francis Cao
d36bf4396a
remove order by in insert select
2024-03-25 18:47:02 -07:00
Francis Cao
7c7fd577c3
remove test schema from CH migration script
2024-03-25 18:33:30 -07:00
Francis Cao
d3ca856521
check in clickhouse migration script
2024-03-25 16:29:29 -07:00
Francis Cao
cbeefe733f
add psql migration
2024-03-21 09:30:42 -07:00
Francis Cao
1cf5bd488c
remove kafka engine tables
2023-12-27 09:22:32 -08:00
Brian Cao
7b97209d56
Fix CH script.
2023-09-13 13:27:07 -07:00
Mike Cao
e4bd314bd6
Updates to insights, event data, telemetry.
2023-07-23 13:18:01 -07:00
Francis Cao
74bd4d5366
add missing semi-colons
2023-07-13 16:30:10 -07:00
Brian Cao
1a793572e8
update backfill script.
2023-07-10 22:29:38 -07:00
Brian Cao
3749e2a70d
update to isoutc string value.
2023-07-10 16:54:42 -07:00
Brian Cao
0a3ee2277a
Fix numeric to number.
2023-07-06 21:02:56 -07:00
Brian Cao
be433cd0fd
update CH migration.
2023-07-05 21:09:16 -07:00
Francis Cao
c901358222
rename to job_id
2023-06-26 10:32:23 -07:00
Francis Cao
a5582416b3
update CH schema with upload_id
2023-06-26 08:19:52 -07:00
Brian Cao
b484286523
Feat/um 305 unique session ch ( #2065 )
...
* Add session_data / session redis to CH.
* Add mysql migration.
2023-05-31 21:46:49 -07:00
Francis Cao
d827bf1417
update CH kafka engine tables for error handling
2023-05-07 23:13:40 -07:00
Francis Cao
95ed8a09aa
update CH event to website_event
2023-03-29 11:06:12 -07:00
Francis Cao
077fad20ea
update skip_broken_messages
2023-03-27 12:44:59 -07:00
Francis Cao
14e4a090bb
update schema and queries to implement reset_at
2023-03-27 11:25:16 -07:00
Brian Cao
be2fc0de8d
Fix ch schema.
2023-03-23 14:17:32 -07:00