Embed analytics in your app
Embed Umami analytics in your own application with an iframe share URL, direct calls to the Umami API, or the Umami API client.
Use Umami's share URLs and API to embed analytics dashboards or data directly into your own application, internal tools, or client portals.
Option 1: Embed a share URL in an iframe#
The simplest approach is to create a share URL and embed it in an iframe.
Create a share URL#
- Navigate to your website in Umami.
- Click Edit on the website.
- Go to the Share URL section and create a new share.
- Copy the generated URL.
Embed in your app#
For this to work, you may need to configure the ALLOWED_FRAME_URLS environment variable on your Umami instance to allow your app's domain:
ALLOWED_FRAME_URLS is a build-time variable, so you need to rebuild Umami after setting it. See Environment variables.
Option 2: Use the API to build custom dashboards#
For full control over the presentation, use the Umami API to fetch data and render it in your own UI.
Authentication#
For self-hosted instances, get a token:
Use the token in the Authorization header:
For Umami Cloud, use your API key as the Bearer credential instead:
Fetch website stats#
Fetch page view time series#
Render with any charting library#
Use the returned data with Chart.js, Recharts, D3, or any visualization library:
Option 3: Use the API client#
The Umami API client simplifies authentication and provides typed methods:
See the API reference for all available endpoints.