Skip to content

Collect a number#

Open Reports, Analytics. The list shows configured collectors. Available plugins are the measurements code has defined, including one entry per published entity type and bundle. Enable adds a collector. Cron records the day, then writes the closed week, month, and year from those days.

From a View#

Add view collector asks for a label and an aggregate field. The select lists only displays that already meet all of these:

  • Aggregation is turned on.
  • The display has exactly one field.
  • That field's aggregation is count, count distinct, sum, average, minimum, or maximum.

Build that View first, then come back to this form. Zero is stored. If the View returns any other number of rows, the sample is skipped and an error is logged.

Cron runs the View as user 1, with the View's cache turned off, so entity access does not hide rows from the anonymous cron user. The View's own filters still apply.

When it runs#

The settings tab sets the collection time and the first day of the week. The default is 12:00 and Monday. Record now stores today's value without waiting for that time.

A day that passes with no cron after the collection time is not filled in later. A published-entity count for that day is whatever is published at the time of the run. The week, month, and year copy the count stored on the last day of that period. If that day is missing, the period is left empty.