You are here

piwik_stats.install in Piwik Statistic Integration 7

Same filename and directory in other branches
  1. 7.2 piwik_stats.install

Installation file of piwik statistic integration module.

File

piwik_stats.install
View source
<?php

/**
 * @file
 * Installation file of piwik statistic integration module.
 */

/**
 * Implements hook_schema().
 */
function piwik_stats_schema() {

  // Schema of table `module_codes`
  $schema['piwik_stats'] = array(
    'description' => 'Stores statistical piwik data.',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => FALSE,
        'description' => 'Refers to the node.',
      ),
      'nb_visits' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Unique pageviews.',
      ),
      'nb_hits' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Pageviews.',
      ),
      'entry_nb_visits' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Number of visits that started on a node.',
      ),
      'entry_nb_actions' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Number of page views for visits that started on that node.',
      ),
      'entry_sum_visit_length' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Time spent, in seconds, by visits that started on this node.',
      ),
      'entry_bounce_count' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Number of visits that started on this node and bounced (viewed only one page).',
      ),
      'exit_nb_visits' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Number of visits that finished on this node.',
      ),
      'sum_time_spent' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Total time spent on this node, in seconds.',
      ),
      'avg_time_on_page' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Average time spent on node (in seconds).',
      ),
      'bounce_rate' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Ratio of visitors leaving the website after landing on this node (in percent).',
      ),
      'exit_rate' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Ratio of visitors that do not view any other page after this node (in percent).',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'indexes' => array(
      'nb_visits' => array(
        'nb_visits',
      ),
      'nb_hits' => array(
        'nb_hits',
      ),
      'entry_nb_visits' => array(
        'entry_nb_visits',
      ),
      'entry_nb_actions' => array(
        'entry_nb_actions',
      ),
      'entry_sum_visit_length' => array(
        'entry_sum_visit_length',
      ),
      'entry_bounce_count' => array(
        'entry_bounce_count',
      ),
      'exit_nb_visits' => array(
        'exit_nb_visits',
      ),
      'sum_time_spent' => array(
        'sum_time_spent',
      ),
      'avg_time_on_page' => array(
        'avg_time_on_page',
      ),
      'bounce_rate' => array(
        'bounce_rate',
      ),
      'exit_rate' => array(
        'exit_rate',
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function piwik_stats_uninstall() {

  // Delete used variables.
  variable_del('piwik_stats_token_auth');
  variable_del('piwik_stats_period');
  variable_del('piwik_stats_cron');
}

Functions

Namesort descending Description
piwik_stats_schema Implements hook_schema().
piwik_stats_uninstall Implements hook_uninstall().