Statistics

This package contains all views related to statistics

Statistics Actions

This module contains view actions related to pages.

integreat_cms.cms.views.statistics.statistics_actions.get_total_visits_ajax(request: HttpRequest, region_slug: str) JsonResponse[source]

Aggregates the total API hits of the last 14 days and renders a Widget for the Dashboard.

Parameters:
  • request (HttpRequest) – The current request

  • region_slug (str) – The slug of the current region

Returns:

A JSON with all API-Hits of the last 2 weeks

Return type:

JsonResponse

integreat_cms.cms.views.statistics.statistics_actions.get_visits_per_language_ajax(request: HttpRequest, region_slug: str) JsonResponse[source]

Ajax method to request the app hits for a certain timerange distinguished by languages.

Parameters:
  • request (HttpRequest) – The current request

  • region_slug (str) – The slug of the current region

Returns:

A JSON with all API-Hits of the requested time period

Return type:

JsonResponse

Statistics View

Views related to the statistics module

class integreat_cms.cms.views.statistics.statistics_view.AnalyticsView(**kwargs)[source]

Bases: TemplateView

View for the statistics overview.

extra_context = {'current_menu_item': 'statistics'}[source]

The context dict passed to the template (see ContextMixin)

get(request: HttpRequest, *args: Any, **kwargs: Any) HttpResponseRedirect[source]

Render statistics of access numbers tracked by Matomo

Parameters:
  • request (HttpRequest) – The current request

  • *args (Any) – The supplied arguments

  • **kwargs (Any) – The supplied keyword arguments

Returns:

The rendered template response

Return type:

HttpResponseRedirect

template_name = 'statistics/statistics_overview.html'[source]

The template to render (see TemplateResponseMixin)