Skip to Content
ModulesTools

Analytics

The Analytics module: visitors, sources, pages, a click map and individual visits on the site itself, with no third-party counter.

The module counts visits on its own: where visitors came from, which pages they open, what they click and how each visit goes. The data stays in the site's database, so you don't need a third-party counter. Reports live in the admin under the "Visitor behaviour" row, and visit charts are added to the admin home and to "All analytics".

The Visitor behaviour screen, Pages tab, with a 7-day summary
DependenciesGamesPermissionsStudio blocksBot commandsCron tasks
Flute 2.0anyadmin.analytics, admin.analytics.view, admin.analytics.visits.viewnone, there is a visitors data sourcenonethree, below

Install and first setup

Install the module from the marketplace. The counter starts right away: it goes on every page of the site except the admin panel. Staff are not counted by default, so your own visits stay out of the reports.

If "Show cookie banner" is on, a visit is recorded only after the visitor allows analytics. Until then the reports are empty, and the table says "Visits appear once visitors allow analytics in the cookie banner; daily totals are recomputed every 10 minutes.". The banner is set up in Documents and cookies.

Start the queue worker

Visits are written through the queue. Without a running worker the scheduler takes 25 jobs a minute, and on a busy site clicks start to get lost. Until a worker runs, the admin home shows the "Start the queue worker" step. How to run php flute queue:work is covered in Scheduler.

Open the report

AdminVisitor behaviourPages. The first numbers show up within 10 minutes, which is how often the "Analytics: daily totals" task recomputes the summary.

What the reports show

Every tab has a "Period" picker: "Day", "7 days", "30 days" or "90 days". The summary on top compares it with the previous period of the same length: "Pageviews", "Visitors", "Average visit", "Bounce rate".

TabWhat it holds
"Pages"a table of pages: pageviews, visitors, average time, scroll depth, entries and exits. A page opens with "Where visitors come from" and "Where they go next"
"Clicks""What visitors click": "In vain", "Left for another site", "Forms sent", "Ordinary clicks", and for each page a "Click map" and "How far they read"
"Visits"the list of visits: who, when, how many pages, device, source and "Risk". A visit opens with "Course of the visit" and "The account meanwhile"
The Clicks tab with a page's click map

Only holders of admin.analytics.visits.view see the "Visits" tab. Visits of staff accounts are shown there to the owner only. Each visit has "Delete the visit", and the "Visits" tab of the player card has "Delete every visit of the account".

A visit: the course through the pages and the account's actions

A click in vain is a click after which nothing happened on the page.

Suspicious visits

Every 10 minutes the "Analytics: suspicion of visits" task checks new visits and gives them a "Risk". The reasons are shown on the visit:

  • "Clicks without a single mouse move or touch"
  • "Clicks faster than a person clicks"
  • "The browser is driven by a program"
  • "Many visits from one address within an hour"
  • "The address changed during the visit"

The "Suspicious only" filter on the "Visits" tab leaves just those. The module blocks nobody, it only marks visits.

Goals and funnel

A goal in "Goals" is an address (/shop: the visit opened that page or one under it) or the name of a marked element. A button or form with data-analytics-goal="buy" is the goal buy:

<button data-analytics-goal="buy">Buy</button>

The "Funnel" is a list of steps in order, written like goals, for example /, /shop, buy. Each step counts the visits that reached it after the one before. The results are on the "Goals: visits that reached the address" and "Funnel: visits at each step" charts.

Where the module shows up

PlaceWhat is there
AdminVisitor behaviourthe "Pages", "Clicks", "Visits" and "Settings" tabs
Admin homethe "Visitors today" tile
"All analytics" (/admin/analytics)the "Visits" chart group: visitors, visits, sources, devices, countries, UTM campaigns and more, see Admin home
Player card in the adminthe "Visits" tab with the account's visits
Studiothe visitors data source for your own components: today, online, pageviews_today, week

Settings

AdminVisitor behaviourSettings. The fields are grouped into "Collection", "Retention", "Limits" and "Suspicion". Changing them needs admin.analytics.

Analytics module settings, Collection group
FieldWhat it changesDefault
Count visitsoff: the counter is not put on pages and whatever arrives is droppedon
Count signed-in visitorsoff: only guests are countedon
Count the staffaccounts with access to the admin panel; the panel itself is never countedoff
Do not count botssearch crawlers, link previews and headless browsers, by User-Agenton
Share of visits whose clicks are written, %the rest count pages only, at 0 no clicks are written100
Addresses not countedthe start of a path, such as /rules, up to 50empty
A visit ends after quiet of, minthe next page after such a pause starts a new visit, 5 to 72030
Header with the visitor's countrythe header a CDN or proxy sets, such as CF-IPCountry on Cloudflareempty, no country
Goalsup to 20 goalsempty
Funnelup to 8 stepsempty
Keep clicks, daysclicks and other events of a visit30
Keep visits, daysvisits and their pages; daily totals stay90
Keep daily totals, days0 keeps them for good0

Permissions

PermissionWhat it gives
admin.analytics"Analytics: delete visits and settings", includes the two below
admin.analytics.view"Analytics: summary, pages and clicks"
admin.analytics.visits.view"Analytics: visits of individual visitors"

Background tasks

The tasks are listed in AdminScheduler.

TaskHow often
Analytics: daily totalsevery 10 minutes
Analytics: suspicion of visitsevery 10 minutes
Analytics: removal of old visits and eventsdaily at 04:00

For developers

With the analytics:read scope the API gives daily totals (GET /api/v1/analytics) and period summaries: GET /api/v1/analytics/report/overview, /report/pages, /report/sources. Individual visits are never given out through the API. Keys are issued in API access.

With Flute AI installed, the assistant answers questions about traffic: this week against the last, the page table, clicks in vain, the collection settings.

How the core side works: API keys and the REST API, Module REST API.

Troubleshooting

For any other message, use the error lookup.

Clicks are not being recorded

Data comes in faster than the site can save it, and the queue is full. Start php flute queue:work and check that the scheduler runs: the "Open the scheduler" button leads straight there.

Collection is turned off

"Count visits" is off in the settings. New visits are not recorded, the reports show older data only. Click "Turn on collection".

If the chosen period is empty but there was data before, the screen says "No visits in this period" with the date of the latest visit and a button to show a wider period. If it is always empty, check the cookie banner and "Addresses not counted".

Next

On this page