AdSense cookie consent

Please note that this is no longer being updated. Kindly visit the new Cookiebot support area (https://support.cookiebot.com/hc/en-us) for updated guides, articles and FAQs. If you do not find the answer to your question there, you are welcome to post it in the Cookiebot community (https://support.cookiebot.com/hc/en-us/community/topics).

To enable prior consent on ads served by Google AdSense/DoubleClick, add the following attributes (in bold text) to the existing AdSense script:

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" type="text/plain" data-cookieconsent="marketing"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-2028730546517203"
     data-ad-slot="2819293335"
     data-ad-format="auto"></ins>
<script type="text/plain" data-cookieconsent="marketing">
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

With AdSense there is no option to opt out of cookies on a session level to display ads without serving cookies. Therefor it is not possible to display ads from AdSense if the user opts out of marketing cookies.

Feedback and Knowledge Base