0

Does Google Analytics module tracks superuser 1 out of the box?

UPDATE: Found this in the .install file of the module. What does it basically say about user 1? Can anybody explain them to me? Does it track uid 1? Thanks.

variable_set('googleanalytics_roles', $roles);

// Upgrade disabled tracking of "user 1" to new logic.
if (!$track_user1 = variable_get('googleanalytics_track__user1', 1)) {
  variable_set('googleanalytics_custom', 1);

  // Load user 1 object, set appropriate value and save new user settings back.
  $account = user_load(1);
  $account = user_save($account, array('data' => array('googleanalytics' => array('custom' => 0))), 'account');
  $messages[] = t('Disabled user specific page tracking for site administrator.');
}

// Delete outdated tracking settings.
db_delete('variable')
 ->condition('name', db_like('googleanalytics_track_') . '%', 'LIKE')
 ->execute();

// ...

1 Answer 1

1

Does Google Analytics module tracks superuser 1 out of the box?

Yes, it does. In fact, the default value for the Drupal variable googleanalytics_track__user1 is 1, which means the control statement is executed by default.

if (!$track_user1 = variable_get('googleanalytics_track__user1', 1)) {
  // ...
}

What the code does is to save in $user->data the module settings, and delete the old settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.