You are here

function _statcounter_visibility_header in StatCounter 7.2

Based on headers send by clients this function returns TRUE if Statcounter code should be added to the current page and otherwise FALSE.

1 call to _statcounter_visibility_header()
_statcounter_visibility_user in ./statcounter.module
Tracking visibility check for an user object.

File

./statcounter.module, line 372
Drupal Module: Statcounter Adds the required Javascript to the bottom of all your Drupal pages to allow tracking by the Statcounter statistics service.

Code

function _statcounter_visibility_header($account) {
  if (($account->uid || variable_get('cache', 0) == 0) && variable_get('statcounter_privacy_donottrack', 1) && !empty($_SERVER['HTTP_DNT'])) {

    // Disable tracking if caching is disabled or a visitors is logged in and
    // have opted out from tracking via DNT (Do-Not-Track) header.
    return FALSE;
  }
  return TRUE;
}