For developers
Consent from one script tag
The tag loads asynchronously, keeps non-Google tags waiting where opt-in applies, and the JavaScript API fires events when consent changes. The tag also sends the Google Consent Mode v2 signals.
- No card to start
- One script tag to go live
- No sales call
Install
Copy your tag from the GrantCookie app
<script
src="https://cdn.grantcookie.com/gc.js"
data-site="YOUR_SITE_ID"
async></script>
Works with
Replace YOUR_SITE_ID with the ID of your site in the GrantCookie app.
What gets in the way
Consent gating written by hand
Gating tags on consent per market is code you did not plan to write.
Consent Mode signals
Google expects the banner to send four consent signals to its tags.
Script weight on the page
A consent script that blocks rendering costs you Time to Interactive.
Events your app can react to
- The JavaScript API fires events when consent changes, so your app can react.
- Works with React, Vue, Angular, Svelte, Next, Nuxt or plain HTML.
- Set-up guides for WordPress, Shopify and Wix. Any other site works through Google Tag Manager or the JavaScript API.
- Each choice is stored with the time in UTC, a consent ID, the categories allowed and the banner version the visitor saw.
Consent record
An example of one choice
| Field | Value |
|---|---|
| Time (UTC) | 2026-08-20 09:08:47 |
| Consent ID | c_44e0d5b2 |
| Choice | Partial |
| Categories | Analytics |
| Banner version | v4.2 |
Cookie blocking and Google Consent Mode
- Where opt-in applies, non-Google tags stay blocked until the visitor gives consent.
- Sends the four Google Consent Mode v2 signals from the visitor’s choice.
- When a visitor declines, Google’s tags stay loaded but switch to cookieless pings, so Google can still model conversions.
Google Consent Mode v2
The signals sent after each choice
| Signal | Accept all | Reject all |
|---|---|---|
ad_storage | granted | denied |
analytics_storage | granted | denied |
ad_user_data | granted | denied |
ad_personalization | granted | denied |
The consent rule for each market
- Select the privacy laws that apply to you, from the 16 the banner covers.
- Where opt-in applies, as under the GDPR, non-essential cookies wait until the visitor chooses.
- Where a US opt-out law applies, cookies can run until the visitor opts out, and a “Do Not Sell or Share My Personal Information” link appears on every page.
- Where the law works on notice, as in Singapore, the banner gives the notice and records the choice. Australia’s Privacy Act has no cookie-consent rule as such: the banner gives the notice and keeps a record where a cookie can identify someone.
- GDPR and CCPA templates come with every plan.
What the banner does
By consent model
| Model | What the banner does |
|---|---|
| Opt-in | Blocks non-essential cookies until the visitor chooses, with Reject all beside Accept all. |
| Opt-out | Lets cookies run until the visitor opts out, with a “Do Not Sell or Share My Personal Information” link and a preference centre. |
| Notice | Gives the notice and records the choice; in Australia, where a cookie can identify someone. |
Automatic cookie scanning
- Crawls your site and lists every cookie, tracker and pixel it finds, sorted into categories.
- Names the third parties that set them.
- Scans again on a schedule: monthly on Pro and weekly on Ultimate. On Free and Basic, scans run when you start them.


