Skip to Content

is_do_not_track()

Determine if the “Do Not Track” request header is present from the browser.

PHP July 24, 2018

Usage

PHP
nebula()->is_do_not_track()

Parameters

This function does not accept any parameters. Is this incorrect?

Additional Notes

This looks for the HTTP header “HTTP_DNT” which may not be present in Microsoft Edge even when DNT is enabled. This feature, while technically supported in all browsers, is not consistently implemented across them yet.

Remember: A return of “false” means the browser is allowing tracking. A return of “true” means the user has requested not to be tracked.

Source File

Located in /libs/Utilities/Analytics.php on line 43.

No Hooks

This function does not have any filters or actions available. Request one?
PHP
        public function is_do_not_track(){
            if ( isset($_SERVER['HTTP_DNT']) && $_SERVER['HTTP_DNT'] == 1 ){
                return true;
            }

            return false;
        }

Override

This function can not be short-circuited with an override filter. Request one?