PHP Class Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker

- X-Do-Not-Track header (used by AdBlockPlus and NoScript) - DNT header (used by Mozilla)
Show file Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
__construct ( Piwik\Plugins\PrivacyManager\Config $config = null )
activate ( ) Activates DoNotTrack header checking. This function will not be called by the Tracker.
checkHeaderInTracker ( &$exclude ) Checks for DoNotTrack headers and if found, sets $exclude to true.
deactivate ( ) Deactivates DoNotTrack header checking. This function will not be called by the Tracker.
isActive ( ) : boolean Returns true if server side DoNotTrack support is enabled, false if otherwise.
isDoNotTrackFound ( ) : boolean

Protected Methods

Method Description
getBrowsersWithDNTAlwaysEnabled ( ) : array Some browsers have DNT enabled by default. For those we will ignore DNT and always track those users.
isHeaderDntFound ( ) : boolean
isUserAgentWithDoNotTrackAlwaysEnabled ( $userAgent ) : boolean

Method Details

__construct() public method

public __construct ( Piwik\Plugins\PrivacyManager\Config $config = null )
$config Piwik\Plugins\PrivacyManager\Config

activate() public method

Activates DoNotTrack header checking. This function will not be called by the Tracker.
public activate ( )

checkHeaderInTracker() public method

Checks for DoNotTrack headers and if found, sets $exclude to true.
public checkHeaderInTracker ( &$exclude )

deactivate() public method

Deactivates DoNotTrack header checking. This function will not be called by the Tracker.
public deactivate ( )

getBrowsersWithDNTAlwaysEnabled() protected method

Some browsers have DNT enabled by default. For those we will ignore DNT and always track those users.

isActive() public method

Returns true if server side DoNotTrack support is enabled, false if otherwise.
public isActive ( ) : boolean
return boolean

isDoNotTrackFound() public method

public isDoNotTrackFound ( ) : boolean
return boolean

isHeaderDntFound() protected method

protected isHeaderDntFound ( ) : boolean
return boolean

isUserAgentWithDoNotTrackAlwaysEnabled() protected method

protected isUserAgentWithDoNotTrackAlwaysEnabled ( $userAgent ) : boolean
$userAgent
return boolean