Navigator: globalPrivacyControl property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The Navigator.globalPrivacyControl property returns the user's Global Privacy Control setting. This setting indicates whether the user consents to a website or service selling or sharing their personal information with third parties.

The value of the property reflects that of the Sec-GPC HTTP header.

Sec-GPC Value Meaning
1 User does not provide consent to sell or share their data.
0 User does provide consent to sell or share their data.
unspecified User has not yet provided consent with regard to their data.

Example

js

console.log(navigator.globalPrivacyControl);
// prints "1" indicating user does not want their data shared or sold.
// prints "0" if the user consents to their data being shared or sold.
// prints "unspecified" if Sec-GPC header is not present.

Specifications

No specification found

No specification data found for api.Navigator.globalPrivacyControl.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility

BCD tables only load in the browser

See also