> For the complete documentation index, see [llms.txt](https://help.littledata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.littledata.io/advanced/developer/how-to-check-whether-google-consent-mode-v2-is-properly-working.md).

# How to check Google Consent Mode V2 is working

## How to check Google Consent Mode v2 is working

This guide shows you how to check that your consent banner works with [Google Consent Mode v2](https://help.littledata.io/integrations/shopify-to-google-analytics/using-google-consent-modev2). You'll use Google Tag Assistant to see which consent states your site sends to Google, and learn how to read them.

Consent Mode v2 lets your Google tags change how they behave based on each visitor's consent. If you have visitors in the European Economic Area (EEA), you need it to meet privacy rules such as GDPR.

{% hint style="success" %}
Using Shopify? [Here's how to implement Google Consent Mode v2](https://help.littledata.io/integrations/shopify-to-google-analytics/using-google-consent-modev2) on your Shopify store.
{% endhint %}

### Connect Tag Assistant to your site

In this example we test the Cookiebot website, which uses the Cookiebot consent banner. Use your own store's address instead.

{% stepper %}
{% step %}
**Open Tag Assistant**

Go to [Google Tag Assistant](https://tagassistant.google.com/) and click **Add domain**.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2Fgit-blob-d77ca62610dac6f5a29f85a2ff6aab3b010afea1%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Enter your site's URL**

Type your full website address, including `https://`, and click **Connect**.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FagyhiDQNxwQpKzmfkWfw%2Fimage.png?alt=media&amp;token=1c222845-4182-4312-b310-b277b2b9f7c9" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Don't answer the banner yet**

Your site opens in a new tab with Tag Assistant connected. Leave the consent banner open for now.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FRAEeum3ua1Wd2ZmVjUCc%2Fimage.png?alt=media&amp;token=a8aae1d6-81cd-45a5-9a52-8c116df10e83" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Open the page view hit**

Go back to the Tag Assistant tab. Open your GA4 tag and click the **Page view** hit.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FptYiM2ZN0gLioZNg3JgC%2Fimage.png?alt=media&amp;token=92edba22-9d70-4dc3-9e04-d9c05397a7c7" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Read the consent parameters

In the hit details, look at two parameters: **Cookie consent state** (`gcs`) and `gcd`.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FX8BLgebdoj7CSoklZay6%2Fimage.png?alt=media&amp;token=bd628b94-61b0-481d-99a7-1624e2a9d25e" alt=""><figcaption></figcaption></figure>

#### The gcs parameter

`gcs` shows the basic consent state. Before any choice on the banner, it's `G100`:

* `G1` is always there.
* The first digit after it is `ad_storage`. `0` means denied: the visit can't be used for ad retargeting.
* The second digit is `analytics_storage`. `0` means denied: the visit can't be used to measure traffic, behavior or conversions.

#### The gcd parameter

`gcd` holds the Consent Mode v2 details. In this example it's `13p3p3p3p5l1`. The letters show the consent state for, in order:

1. Ad storage
2. Analytics storage
3. Ad user data
4. Ad personalization
5. Ad data redaction (not officially documented)

Each letter shows both the default state and the updated state:

| Default \ Updated | Missing | Denied | Granted |
| ----------------- | ------- | ------ | ------- |
| Missing           | `l`     | `m`    | `n`     |
| Denied            | `p`     | `q`    | `r`     |
| Granted           | `t`     | `u`    | `v`     |

So `13p3p3p3p5l1` means ad storage, analytics storage, ad user data and ad personalization are all denied by default, with no update yet (`p`). Ad data redaction is `l`, so it doesn't even have a default state.

The last number in `gcd` may show the GA4 ads signals setting. We can't confirm this, but some sources say so:

| Consent \ Ads signals | Missing | True | False |
| --------------------- | ------- | ---- | ----- |
| Default               | `1`     | `2`  | `3`   |
| Updated               | `4`     | `5`  | `6`   |

{% hint style="warning" %}
Google doesn't document the `gcd` format. These tables come from testing and may change.
{% endhint %}

### Test different consent choices

{% stepper %}
{% step %}
**Allow all**

On your site, click **Allow all** on the banner. A new page view is sent. Now `gcs` is `G111` and `gcd` is `13r3r3r3r5l1`. Every `p` turned into `r`: denied by default, granted after the update.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FtuoRZAZBe9unLNjX7xNK%2Fimage.png?alt=media&amp;token=569349d2-7657-4ede-9309-255a6d0e7f82" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Clear your cookies**

To test another choice, clear the site's cookies so the banner shows again. In Chrome, open DevTools, go to **Application** > **Storage** > **Cookies**, right-click your site and choose **Clear**. Then reload the page.
{% endstep %}

{% step %}
**Allow analytics only**

This time, customize your consent: allow statistics but deny marketing.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FIZUtVUnawh3cZGksYztr%2Fimage.png?alt=media&amp;token=f0e75cc1-0d66-409d-a834-4911f6959ca3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Check the result**

Now `gcs` is `G101` and `gcd` is `13q3r3q3q5l1`. Everything is `q` (denied by default and after the update) except analytics storage, which is `r` (denied by default, granted after the update).

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FKSdwwtyvs6RDhhNuit2R%2Fimage.png?alt=media&amp;token=623a8434-0027-4dbe-b5af-ebf395023c50" alt=""><figcaption></figcaption></figure>

Visit another page. The **Client ID** (`cid`) stays the same from page to page, because analytics storage is now granted.

<figure><img src="https://3956158252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QhTbrMraNWciQeDvu1b%2Fuploads%2FBPr9Q9KoJroQuTpoylZU%2Fimage.png?alt=media&amp;token=5b6929e0-9318-4b4a-bf23-2f35b041b1ff" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

Try other combinations of consent choices to see how your setup behaves. If the values don't change after a choice on the banner, your banner isn't updating Consent Mode correctly.

### Related articles

* [Using Google Consent Mode v2 with Shopify](https://help.littledata.io/integrations/shopify-to-google-analytics/using-google-consent-modev2)
* [Using cookie consent banners for GDPR compliance](https://help.littledata.io/partner-recipes/cookie-consent-integrations/shopify-customer-consent-api)
* [How consent banner design affects Google Analytics](https://help.littledata.io/advanced/troubleshooting/consent-banner-design-ga4)
