Skip to Content
Menu

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.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

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

    No Hooks

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

    Override

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