<?php
//$Id: googleanalytics.install,v 1.1 2006/06/05 00:19:47 budda Exp $

function googleanalytics_install() {
  $result = db_query('SELECT * FROM {role} ORDER BY name');

  while ($role = db_fetch_object($result)) {
    $ga_role = "googleanalytics_track_{$role->name}";

    //check if variable is not already set from a previous install
    if(strpos(variable_get($ga_role, 'new'), 'new') !== FALSE) {
      variable_set($ga_role, TRUE);
      drupal_set_message(t('Role %rolename is now being tracked by Google Analytics', array('%rolename' => $role->name)));
    }
  }
}