Skip to content

Instantly share code, notes, and snippets.

@tarranjones
Created November 10, 2016 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarranjones/2d2dc8c54e922393639d04eff3a06304 to your computer and use it in GitHub Desktop.
Save tarranjones/2d2dc8c54e922393639d04eff3a06304 to your computer and use it in GitHub Desktop.
response header for DNT (tracking-status-values)
/*
* @info https://www.w3.org/TR/tracking-dnt/#tracking-status-value
*/
function getRequestTrackingStatusValue(){
return "N";
/*
TSV = %x21 ; "!" — under construction
/ %x3F ; "?" — dynamic
/ %x47 ; "G" — gateway to multiple parties
/ %x4E ; "N" — not tracking
/ %x54 ; "T" — tracking
/ %x43 ; "C" — tracking with consent
/ %x50 ; "P" — tracking only if consented
/ %x44 ; "D" — disregarding DNT
/ %x55 ; "U" — updated
*/
}
if(isset($_SERVER['HTTP_DNT']) && $_SERVER['HTTP_DNT'] == 1){
header("Tk: " . getRequestTrackingStatusValue());
} else {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment