I'm trying some cookie consent frameworks like https://www.cookieconsent.com in order to improve the privacy settings at my website. In general those frameworks work in the same way: All script
tags get a type="text/plain"
and if the visitor accepts cookie, they change the type to type="text/javascript"
and execute the code.
However, it doesn't work for Google Adsense tags like
<script type="text/plain" cookie-consent="targeting" data-ad-client="XXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
In the Chrome and Safari consoles I can see that the type is type="text/javascript"
but I don't see ads. It works perfectly for everything else (e.g Google Analytics). What's wrong with the Google Adsense code and how can I show it only to people who like cookies?