Skip to content

Works anywhere

Works wherever your site lives

Trusted Cookie works on any website where you can add a script tag to the page's <head>: WordPress, Shopify, Webflow, Wix, Next.js, other React apps and plain HTML. WordPress has its own plugin. The script is about 8 KB compressed.

  • One line of code
  • WordPress plugin
  • JavaScript API
  • About 8 KB compressed

One line at the top of your page

Copy your install tag from the dashboard and paste it as the first tag inside <head>, before any analytics, ads or chat scripts:

<script id="pgcmp" src="https://cdn.trustedcookie.io/c/YOUR_SITE_KEY/script.js"></script>

Load it normally, without async or defer: it has to run before other scripts so it can hold them back. Your settings are built into this one file, so there is nothing else to load.

Notes for common platforms

PlatformWhere the tag goes
WordPressUse the Trusted Cookie plugin: paste your code in its settings page
Next.jsIn pages/_document.tsx inside <Head> as a plain <script>, not next/script
Google Tag ManagerDirectly in the page, not inside Tag Manager
Shopify, Webflow, Wix, HTMLIn the site's custom code or head section, as high as it allows

A JavaScript API for developers

PGConsent.get()            // the visitor's choice, or null
PGConsent.has("analytics") // true or false
PGConsent.open()           // open the preferences panel
PGConsent.onChange(fn)     // run fn after every choice

Add a cookie settings link to your footer with PGConsent.open(), so visitors can change their mind at any time.

Questions

Will it slow my site down?

The script is about 8 KB compressed, comes as one file with your settings built in, and is cached by the browser.

What if I change the banner later?

Change it in the dashboard. The script picks up your new settings, so you never edit your site's code again.

Add your cookie banner today.

Free for your first 10,000 page views. No card needed.