Global Privacy Control Script Gate (JavaScript Generator)

Generates a small script that loads your listed third-party scripts only if GPC is not set and (optionally) consent exists.

Use the tool

Why this tool exists

Global Privacy Control is a browser setting that tells sites not to sell or share a visitor's data. Some US state laws, California for example, treat it as a valid opt-out request.

This tool builds a script that checks navigator.globalPrivacyControl before it adds your tracker scripts to the page, and gives the matching server-side check for the Sec-GPC header. In the EU the signal does not replace consent, so the script can also require a consent check function.

How to use it

  1. List your scripts, one per line as name | https://url.
  2. Choose whether to also honour Do Not Track and whether to require consent.
  3. Copy the script into your page and call loadGatedScripts from your consent code.
  4. Add the server check where you render tags on the server.

Frequently asked questions

Is GPC legally binding?

Under some US state laws it must be honoured as an opt-out. Whether it applies to you depends on where your visitors are and your business size.

Why include Do Not Track?

It is optional. DNT is a legacy signal that most sites ignore. Honouring it is harmless.

Can I test the signal?

Yes. Use the Global Privacy Control Signal Tester to see if your browser sends it.