Skip to content

The Web Analytics overview: your site's traffic at a glance

Describes Web Analytics 0.10.0. On an older release? The version menu above has this guide as it was then.

The Overview is the first page of Web Analytics. It shows how many people came to the site in a period, what they opened, where they came from and where they left. Everything is recorded by your own server and stored in your own database, with no cookies.

Where to find it

In the admin sidebar, open Web Analytics; its first page is Overview (/admin/web-analytics). The sub-pages Right now, Visits, Pages, Acquisition, Technology, Events, Bots, Rate limits and Settings appear under it while you are in the module.

You need the Owner role, or a role with the Web Analytics permission. The module has to be enabled on the admin Modules page. If tracking is off, the Overview shows Tracking is off — no new hits are being recorded. with an Open settings link; reports still show what was stored before.

The Web Analytics overview: period, own traffic and bots filters, a notice listing pages that don't run the analytics hook, and empty visitor, page view and visit totals The Web Analytics overview: period, own traffic and bots filters, a notice listing pages that don't run the analytics hook, and empty visitor, page view and visit totals

The analytics overview, before any traffic.

The filter bar

Every report page (Overview, Visits, Pages, Acquisition, Technology, Events) starts with the same bar, and the choice is kept in the address, so a filtered view can be bookmarked or shared.

  • Period: Today, Yesterday, Last 7 days (the default), Last 30 days, Last 90 days, Last 12 months or All time.
  • All sites: a site menu, shown only when more than one site has traffic in the period.
  • Own traffic: also count the visits Settings leave out, that is the site’s own people and their networks.
  • Bots: also count bot traffic. Bots are only there if Settings record them.
  • A page filter badge: when you open the Overview from a page on the Pages report, the bar shows that path. Click it to remove the filter.

With Own traffic or Bots ticked, a note says the report is Read from raw events: days older than the raw-event retention then show no data rather than zero visits.

On the right, the green online badge counts the people on the site now and opens Right now. It refreshes every 30 seconds.

The numbers

Six tiles, each with the change against the previous period of the same length. The (i) button next to each explains it.

  • Visitors: daily unique visitors added across the period. Someone who comes on three days counts three times.
  • Page views: every page opening, moves to another page and reloads included.
  • Visits: everything a person does in one go. A gap longer than the visit timeout (30 minutes unless changed in Settings) starts a new visit.
  • Bounce rate: the share of visits that saw only one page. Lower is shown as the good direction.
  • Avg. visit: from the first page opening to leaving the last page.
  • Time on page: how long a page stays open on average. It is measured when a page is left, so it covers LiveView pages, and every page once the client script is on.

The chart and the cards

Page views is a bar chart over the period, hourly for Today and Yesterday, otherwise daily or monthly.

Below it, six cards list the leaders, each with a View all link to the full report:

  • Top pages: the pages opened most often.
  • Top referrers: the sites visitors came from. Direct visits (typed in, a bookmark, an app) are not listed.
  • Channels: visits grouped as Search, Social, Email, Paid, Referral or Direct.
  • Devices: Desktop, Mobile or Tablet.
  • What visitors do: buttons clicked and forms sent on LiveView pages, by the name the page gives them, with Times done.
  • Exit pages: the pages visits ended on. Its link is Visits.

Visitors and Views columns follow the same rule as the tiles: visitors are daily unique visitors added across the period, views count every opening.

Warnings you may see

If some LiveView pages of the site don’t run the analytics hook, a yellow box names them: Some LiveView pages don’t run the analytics hook. On those pages live navigation, clicks and exits aren’t recorded. The box lists what a developer has to add; pages that shouldn’t be tracked can instead go into Excluded paths in Settings.

What it doesn’t do

  • Only the online badge refreshes by itself. The rest of the page is a snapshot; reload or change the filter to update it.
  • Traffic from the site’s own people and from bots is left out unless you tick Own traffic or Bots.
  • The admin panel is not tracked: /admin* is in the default excluded paths.

For developers

Tracking needs plug PhoenixKitWebAnalytics.Plug in the browser pipeline after :fetch_session, {PhoenixKitWebAnalytics.LiveHook, :track_navigation} in each public live_session’s on_mount, and connect_info: [:peer_data, :x_headers, :user_agent, session: @session_options] on both LiveView socket transports. Run mix phoenix_kit.update to create the tables. The Installation section of Settings repeats these steps.