@kamilanwar1 I am seeing an ad on the left hand side before I give consent.
If you are manually adding your adsense codes I think you need to do something like this:
<html>
<head>
<title>Your site title</title>
</head>
<body>
<script>
( function() {
var insertAdsByGoogleJs = function() {
var element = document.createElement('script');
var firstScript = document.getElementsByTagName('script')[0];
var url = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
element.async = true;
element.type = 'text/javascript';
element.src = url;
firstScript.parentNode.insertBefore(element, firstScript);
};
// Run this in an interval (every 0.1s) just in case we are still waiting for consent
var cnt = 0;
var consentSetInterval = setInterval(function(){
cnt += 1;
// Bail if we have not gotten a consent response after 60 seconds.
if( cnt === 600 )
clearInterval(consentSetInterval);
if( typeof window.__tcfapi !== 'undefined' ) { // Check if window.__tcfapi has been set
clearInterval( consentSetInterval );
window.__tcfapi( 'addEventListener', 2, function( tcData,listenerSuccess ) {
if ( listenerSuccess ) {
if( tcData.eventStatus === 'tcloaded' || tcData.eventStatus === 'useractioncomplete' ) {
if ( ! tcData.gdprApplies ) {
// GDPR DOES NOT APPLY
// Insert adsbygoogle.js onto the page.
insertAdsByGoogleJs();
}
else {
// GDPR DOES APPLY
// Purpose 1 refers to the storage and/or access of information on a device.
var hasDeviceStorageAndAccessConsent = tcdata.purpose.consents[1] || false;
// Google Requires Consent for Purpose 1
if (hasDeviceStorageAndAccessConsent) {
// GLOBAL VENDOR LIST - https://iabeurope.eu/vendor-list-tcf-v2-0/
// CHECK FOR GOOGLE ADVERTISING PRODUCTS CONSENT. (IAB Vendor ID 755)
var hasGoogleAdvertisingProductsConsent = tcData.vendor.consents[755] || false;
// Check if the user gave Google Advertising Products consent (iab vendor 755)
if(hasGoogleAdvertisingProductsConsent) {
// Insert adsbygoogle.js onto the page.
insertAdsByGoogleJs();
}
}
}
}
}
} );
}
cnt++;
}, 100);
})();
</script>
<!-- One test unit for GDPR -->
<ins class="adsbygoogle"
style="display:inline-block;width:970px;height:250px"
data-ad-client="ca-pubxxx"
data-ad-slot="slot_id">
</ins>
<!-- Another test unit for GDPR -->
<ins class="adsbygoogle"
style="display:inline-block;width:250px;height:250px"
data-ad-client="ca-pubxxx"
data-ad-slot="slot_id">
</ins>
<script>
// This will trigger the ad request if ads were unpaused in the CMP consent check above.
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body>
</html>
For customizations, we have options listed in help center here https://help.quantcast.com/hc/en-us/sections/360006841354-Setup