---
title: Activate Adsense after consent
slug: pubtech-cmp/activate-adsense-after-consent
docTags: 
createdAt: 2021-08-25T12:14:15.000Z
---

If it is necessary to activate Google Adsense only following consent it is necessary to insert it in the tag  `<head>`, before any other Adsense script on the page, the following code:

```html
<script type="text/javascript">
(adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=1;
</script>
```

This is to pause the delivery of ads.

Subsequently, the following code must be inserted into the queue documented in the configurator:

```javascript
(adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=0;
```

Then resume serving, in this case the ads will be able to retrieve the consent string generated by the CMP.

Resources: [https://support.google.com/adsense/answer/9042142](https://support.google.com/adsense/answer/9042142)
