You are here

function matomo_install in Matomo Analytics 7.2

Same name and namespace in other branches
  1. 8 matomo.install \matomo_install()

@file Installation file for Matomo Analytics module.

File

./matomo.install, line 8
Installation file for Matomo Analytics module.

Code

function matomo_install() {

  // Remove tracking from all administrative pages, see https://drupal.org/node/34970.
  variable_set('matomo_visibility_roles', 0);
  variable_set('matomo_visibility_pages', 0);
  $pages = array(
    'admin',
    'admin/*',
    'batch',
    'node/add*',
    'node/*/*',
    'user/*/*',
  );
  variable_set('matomo_pages', implode("\n", $pages));

  // Make the default install more user and GDPR friendly.
  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array(
    'opt-in or out of matomo tracking',
  ));
  drupal_set_message(t('Module %module granted %permission permission to authenticated users.', array(
    '%module' => 'Matomo Analytics',
    '%permission' => t('Opt-in or out of tracking'),
  )), 'status');
}