# Google Consent Mode

> Learn how to pipe consent signals from the Ours Privacy CMP into Google Consent Mode for GTM and GA4.

Source: https://docs.oursprivacy.com/docs/cookie-consent/google-consent-mode

If you are using the Ours Privacy CDP, consent is already managed server-side and you typically do not need to set up Google Consent Mode separately.

If your setup requires Google Consent Mode, authenticated customers can use the in-app CMP JavaScript SDK reference to listen for consent events and pipe them into Google Consent Mode.

Below is a minimal example:

```html
<!-- Load GTM container as usual -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() {
    dataLayer.push(arguments);
  }

  // 1. Default: Set denied for analytics/ad storage
  gtag('consent', 'default', {
    ad_storage: 'denied',
    analytics_storage: 'denied',
  });

  // 2. Normal gtag config
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX');
</script>
```

Then, when the user consents via the Ours Privacy CMP, update Google Consent Mode:

```javascript
// On user acceptance
gtag('consent', 'update', {
  ad_storage: 'granted',
  analytics_storage: 'granted',
});
```

***

## Next Steps

* **[Script Blocking](https://docs.oursprivacy.com/docs/cookie-consent/script-blocking)**: Learn about automatic script blocking
* **[General Settings](https://docs.oursprivacy.com/docs/cookie-consent/general-settings)**: Configure categories and vendors
