Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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