title: How to display or block personalized Adsense ads based on consent for IAB TCF v2.0 with Quantcast Choice?
body: <p>I've chosen Quantcast Choice as the consent management platform for my website. However with their basic solution Google Adsense ads are still served to visitors before they give their consent for the related vendor (Google). Since 2 days there's a notice in Adsense confirming this issue and after a grace period of 90 days no ads will be served anymore. The error message: &quot;<em>2.1a: the Tag or SDK isn’t receiving a TC string due to CMP status being stub, loading, or error.</em>&quot;</p>
  <p>I'm not familiar at all with scripts, but it seems I have to use some to make Quantcast Choice actually work.
  Basically I need to know how to:</p>
  <ul>
  <li>not serve any Google ads before a visitor consent to Google</li>
  <li>serve personalized ads after consent</li>
  <li>serve non-personalized ads after no consent</li>
  </ul>
  <p><strong>What I've learned so far:</strong></p>
  <p>Before a visitor's consent, I can add this script to my Google Adsense code to not show any ads:</p>
  <pre><code>&lt;script&gt;(adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=1;&lt;/script&gt;
  </code></pre>
  <p>No problem so far. However then I should be able to know if a visitor has given consent for the vendor Google. Google's vendor ID in the TCF v2.0 is 755. I found the following mixture of code and text on one of the Quantcast pages, but I don't know how to use this. Should I put this on my webpages within the Quantcast Choice script or ...? (source linked below)</p>
  <pre><code>{{QC - __cmpConsents.iabVendorConsentIds}} matches the regular expression (^|,)755(,|$).
  </code></pre>
  <p>So if ID 755 is found, I should call:</p>
  <pre><code>(adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=0
  </code></pre>
  <p>and if ID 755 is not found, I should call:</p>
  <pre><code>(adsbygoogle=window.adsbygoogle||[]).requestNonPersonalizedAds=1
  (adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=0
  </code></pre>
  <p>But how do I do these &quot;calls&quot;?</p>
  <p>So I think I understand the steps to follow, it's just that I don't know how to implement these steps and connect the dots. Any help would be much appreciated!</p>
  <p>Sources I've used:</p>
  <ul>
  <li><a href="https://support.google.com/adsense/answer/9042142" rel="noreferrer">https://support.google.com/adsense/answer/9042142</a></li>
  <li><a href="https://help.quantcast.com/hc/en-us/articles/360051794434" rel="noreferrer">https://help.quantcast.com/hc/en-us/articles/360051794434</a></li>
  </ul>
  <p>Example of a website that seems to do what I want to achieve: carscoops.com</p>