You are here

function piwik_stats_definitions in Piwik Statistic Integration 7.2

Definitions of all requested statistical data.

Note that if definitions are added or removed here, they have to be added/removed properly in the schema.

Return value

array Associative array, keyed by piwik API machine names. Each one holds the following information as assoc array:

  • title: A short title.
  • description: A sentence describing the value.
  • format: How the value is formatted. Supported formats are

    • 'number': Simple numbers.
    • 'seconds': Number of seconds.
    • 'percent': Percentual value.
7 calls to piwik_stats_definitions()
piwik_stats_field_formatter_info in ./piwik_stats.module
Implements hook_field_formatter_info().
piwik_stats_field_formatter_settings_form in ./piwik_stats.module
Implements hook_field_formatter_settings_form().
piwik_stats_field_formatter_settings_summary in ./piwik_stats.module
Implements hook_field_formatter_settings_summary().
piwik_stats_field_formatter_view in ./piwik_stats.module
Implements hook_field_formatter_view().
piwik_stats_field_views_data in ./piwik_stats.views.inc
Implements hook_field_views_data().

... See full list

File

./piwik_stats.module, line 24
Integrates piwik statistics as entity fields.

Code

function piwik_stats_definitions() {
  return array(
    'nb_visits' => array(
      'title' => t('Visits'),
      'description' => t('Unique pageviews.'),
      'format' => 'number',
    ),
    'nb_hits' => array(
      'title' => t('Hits'),
      'description' => t('Overall pageviews.'),
      'format' => 'number',
    ),
    'entry_nb_visits' => array(
      'title' => t('Entry visits'),
      'description' => t('Number of visits that started on a node.'),
      'format' => 'number',
    ),
    'entry_nb_actions' => array(
      'title' => t('Entry hits'),
      'description' => t('Number of page views for visits that started on that node.'),
      'format' => 'number',
    ),
    'entry_sum_visit_length' => array(
      'title' => t('Visit length'),
      'description' => t('Time spent, in seconds, by visits that started on this node.'),
      'format' => 'seconds',
    ),
    'entry_bounce_count' => array(
      'title' => t('Bounce count'),
      'description' => t('Number of visits that started on this node and bounced (viewed only one page).'),
      'format' => 'number',
    ),
    'exit_nb_visits' => array(
      'title' => t('Exiting visits'),
      'description' => t('Number of visits that finished on this node.'),
      'format' => 'number',
    ),
    'sum_time_spent' => array(
      'title' => t('Time spend'),
      'description' => t('Total time spent on this node, in seconds.'),
      'format' => 'seconds',
    ),
    'bounce_rate' => array(
      'title' => t('Bounce rate'),
      'description' => t('Ratio of visitors leaving the website after landing on this node (in percent).'),
      'format' => 'percent',
    ),
    'exit_rate' => array(
      'title' => t('Exit rate'),
      'description' => t('Ratio of visitors that do not view any other page after this node (in percent).'),
      'format' => 'percent',
    ),
  );
}