Events: what visitors do on the site, and the live feed
Describes Web Analytics 0.9.0.
Events shows what visitors do once they are on a page: the buttons they click and forms they send, events your site reports itself, such as an order placed, and a feed of every hit as it arrives.
Where to find it
Web Analytics → Events (/admin/web-analytics/events). You need the Owner role or the Web Analytics permission. The page starts with the shared filter bar (period, site, Own traffic, Bots).
Events: clicks, form submits and custom events.
What visitors do
Buttons clicked and forms sent on LiveView pages, by the name the page gives them, up to 25. With the client script on, outbound links, downloads and contact links show here too, as Outbound link, Download and Contact link. Visitors is daily unique visitors who did it, added across the period; Times is how often it was done.
What is recorded is set in Settings under What visitors do: Record LiveView interactions, Events not to record and Event values to keep. Form typing and form contents are never recorded.
Custom events
Events the site reports itself, with a name of its choosing, up to 25. A developer sends them from the app or from the browser (see below). Same columns as above. Until there are any, the card says No custom events recorded in this period.
Live feed
Every hit as it arrives, newest first, updated every 10 seconds. The menu on the card picks All hits, Page views, Interactions, Exits or Custom events. Columns:
- Time: when it arrived.
- What: the hit in words, for example Viewed page or how long a visitor stayed before leaving.
- Page, and Source for page views.
- Client: browser and system.
- Visit: the end of the visit’s ID. Click it to open the whole visit.
The feed lists the 50 newest hits.
What it doesn’t do
- Pages without a LiveView report no clicks unless the client script is on (Accept the client script in Settings).
- An interaction keeps only its name and the short values of the parameters listed in Event values to keep.
For developers
Send a custom event from server code with PhoenixKitWebAnalytics.track_event("order.placed", %{conn: conn, path: "/checkout"}), or from the browser with the client script on: phoenixKitAnalytics('signup', {plan: 'pro'}). Any element can be named for click tracking with data-analytics="name".