# controller\_admin\_analytics

Source: https://zotonic.com/docs/3151/controller_admin_analytics

URI: https://zotonic.com/id/3151

Language: en



Serve the Site Analytics dashboard and its separate recording configuration page. Responses disable caching and search-engine indexing.

The `admin_analytics` dispatch renders `admin_analytics.tpl`, requires `use mod_analytics`, and shows all non-paused recordings in saved order. The query argument `period` selects the reporting window; its default `day` means six hours. Other supported values are `hour`, `24hours`, `week`, `month`, `year` and `years`; unknown values also use six hours.

The dispatch option `{is_config, true}` instead requires `use mod_admin_config` and renders `admin_analytics_config.tpl`. Configuration is independent of permission to view reports. The selected model result is passed to the template as `analytics`.

```erlang
{admin_analytics_config, ["admin", "analytics", "config"],
    controller_admin_analytics, [{is_config, true}]}
```

Recording mutations are handled by `mod_analytics` events and the `m_analytics` APIs, which check permissions separately. This controller only renders the pages.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/3151?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/3151?language=en>)
