Records page views, LiveView interactions, exits and time on page on your own server through a plug and a LiveView hook, with no cookies and no client JavaScript required. Visitors are identified by a salted hash of IP, User-Agent and date, and by default no IP or raw User-Agent is stored. Data lives in five tables: events, daily stats, daily dimensions, recordings and visitor profiles.
Use it when
- You want traffic analytics without a third-party script or cookie banner
- You need to see what visitors do in your LiveView pages, including who is online now
What it gives you
- Overview, Right now, Sessions, Pages, Acquisition, Technology, Events and Bots pages
- Plug for page views and LiveView hook for navigation, events and exits
- Optional client script for outbound clicks, scroll depth and custom events
- Bot scoring and grouping
- Optional session recordings (pointer and scroll only) and device measurements, off by default
- Alerts and data retention settings
Example
pipeline :browser do
# … existing plugs, after :fetch_session …
plug PhoenixKitWebAnalytics.Plug
end
Web Analytics news
-
Web Analytics 0.10.0: Rate limits for public routes, API request tracking and a proxy check
PhoenixKit Web Analytics 0.10.0: opt-in rate limits per visitor and network, a Rate limits page, API requests on the Events page and a client-address check.
-
Web Analytics 0.9.0: Works with PhoenixKit 3
Web Analytics 0.9.0 widens its PhoenixKit requirement so the cookieless visitor analytics install next to PhoenixKit 3.x. No change to tracking or reports.
-
Web Analytics 0.8.0: Internal networks in Settings, more bots caught and localized admin pages left out
Web Analytics 0.8.0 lists office and VPN networks in Settings, spots bots with outdated browsers, warns about untracked LiveView pages and adds Ukrainian.
-
Web Analytics 0.7.0: Visitor profiles, a Bots page and consent rules
Web Analytics 0.7.0 adds opt-in visitor profiles, a bot score with reasons on a new Bots page, longer visitor IDs and consent rules for each kind of data.
-
Web Analytics 0.6.1: Chrome prefetches no longer count as visits
Web Analytics 0.6.1 stops counting Chrome's speculative prefetches as visits and counts the LiveView pages Chrome then serves from its prefetch cache.
Install
1
Add to mix.exs
{:phoenix_kit_web_analytics, "~> 0.10"}
2 Fetch it and run its migrations
$ mix deps.get && mix phoenix_kit.update
3
Switch it on in /admin/modules
- Package
- phoenix_kit_web_analytics
- Releases
-
- 0.10.1
- 0.10.0
- 0.9.0
- Admin
-
/admin/web-analytics - Links
- HexDocs ↗ GitHub ↗ Changelog ↗
Related modules
What it needs, what builds on it, and its neighbours in Platform & tools.
Dashboards
Build admin dashboard pages from widgets that any module exposes
No other modules needed
Database Explorer
Browse Postgres tables and watch row changes live from the admin
No other modules needed
Hello World
A demo module to copy when building your own PhoenixKit module
No other modules needed
Legal
Generated legal pages, cookie consent banner and consent logging
Needs Publishing
Stats
Collect and chart time-series metrics from external sources over Graphite
No other modules needed
Sync
Pull data between PhoenixKit sites over token-based connections
No other modules needed