mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21863] feat: add Umami analytics integration #65167
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21863
Author: @TeenBiscuits
Created: 2/25/2026
Status: 🔄 Open
Base:
dev← Head:dev📝 Commits (1)
3be1d43feat: add Umami analytics integration📊 Changes
13 files changed (+320 additions, -15 deletions)
View changed files
📝
.env.example(+7 -1)📝
backend/open_webui/env.py(+12 -7)📝
backend/open_webui/main.py(+16 -1)📝
src/app.d.ts(+10 -0)📝
src/lib/components/chat/Chat.svelte(+33 -0)📝
src/lib/components/chat/MessageInput.svelte(+28 -0)📝
src/lib/components/chat/ModelSelector/Selector.svelte(+19 -1)📝
src/lib/components/chat/ShareChatModal.svelte(+6 -0)📝
src/lib/components/layout/Navbar/Menu.svelte(+25 -0)📝
src/lib/components/layout/Sidebar/UserMenu.svelte(+7 -0)➕
src/lib/utils/umami.ts(+45 -0)📝
src/routes/+layout.svelte(+75 -0)📝
src/routes/auth/+page.svelte(+37 -5)📄 Description
Pull Request Checklist
This pull request addresses the feature request in the discussion on post #10203.
Target branch: Verify that the pull request targets the
devbranch. PRs targetingmainwill be immediately closed.Description: Provide a concise description of the changes made in this pull request down below.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Add docs in Open WebUI Docs Repository. Document user-facing behavior, environment variables, public APIs/interfaces, or deployment steps.
Dependencies: Are there any new or upgraded dependencies? If so, explain why, update the changelog/docs, and include any compatibility notes. Actually run the code/function that uses updated library to ensure it doesn't crash.
Testing: Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Include reproducible steps to demonstrate the issue before the fix. Test edge cases (URL encoding, HTML entities, types). Take this as an opportunity to make screenshots of the feature/fix and include them in the PR description.
Agentic AI Code: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review AND manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR.
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Design & Architecture: Prefer smart defaults over adding new settings; use local state for ephemeral UI logic. Open a Discussion for major architectural or UX changes.
Git Hygiene: Keep PRs atomic (one logical change). Clean up commits and rebase on
devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Title Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
feat: add Umami analytics integration with env-gated script and P1 event trackingDescription
This PR adds Umami analytics integration to Open WebUI with runtime backend configuration and frontend script injection controlled by environment variables. Tracking is enabled only when
UMAMI_WEBSITE_IDis set;UMAMI_DOMAINdefaults tohttps://cloud.umami.iswhen not provided. IfUMAMI_WEBSITE_IDis missing/empty, Umami is not loaded.The implementation includes:
/api/config) for Umami runtime values.umami.identify(user.id).flow,surface,trigger.Testing
Before fix
After fix (manual)
http://localhost:3000.user.id) and P1 events emit for auth/chat actions.Commands used
Changelog Entry
Description
user.id.Added
UMAMI_WEBSITE_ID(required to enable Umami)UMAMI_DOMAIN(optional, defaults tohttps://cloud.umami.is)/api/config.Changed
flowsurfacetriggerDeprecated
Removed
Fixed
UMAMI_WEBSITE_IDis not configured.user.id.Security
Breaking Changes
Additional Information
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.