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. Therefore it is not possible to display ads from AdSense if the user opts out of marketing cookies.
Last updated: 2 May 2018
Comments
0 comments
Article is closed for comments.