This post was most recently updated on January 3rd, 2024
Effective October 15, 2020 – Ad providers will support the TCF2.0 initiative and could stop bidding for EU users on sites where consent signals are not detected. Therefore, all publishers must be TCF2.0 compliant or expect a drop in ad revenues. Read Google’s help center article here.
Read our FAQ’s here:
https://www.monetizemore.com/blog/frequently-asked-questions-gdpr-and-eprivacy-directive/
If you have any hardcoded codes like AdSense, Ad Exchange, GAM header & body, or Google Analytics, EU users must explicitly give consent before any of these tags, that collect personal information, can serve.
If you work with MonetizeMore, here is a quick guide on how you can convert your onpage codes to be TCF2.0 compliant:
Anything ad-related goes into pg.atq function.
Google Analytics, Facebook Pixels or any user tracking code needs to go inside pg.acq function in all scenarios whether the publisher is running TC or not.
Check your source code if you still have this tag:
<script src=”https://cdn.pubguru.com/pg.js” />
If yes, disable or remove it! Then proceed below depending on which onpage codes you’re running:
<script async src=”https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– adsense_320x50 –>
<ins class=”adsbygoogle”
style=”display:inline-block;width:320px;height:50px”
data-ad-client=”ca-pub-9938478770366204″
data-ad-slot=”2095503816″></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Can go either in the Header or Body (will be provided to you by MonetizeMore):
<script src=”//c.pubguru.net/pg.xxxxxx.js” async> </script>
Body:
<ins class=”adsbygoogle”
style=”display:inline-block;width:320px;height:50px”
data-ad-client=”ca-pub-xxxxxxxxxxxxxxxx”
data-ad-slot=”xxxxxxxxxxx”></ins>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<script type=”text/javascript”>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client : “ca-pub-XXXXXXXXXXXXXXX”,
enable_page_level_ads : true
});
</script>
<script type=”text/javascript”>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: “ca-pub-XXXXXXXXXXXXXXXX”,
enable_page_level_ads: true
});
</script>
<script type=”text/javascript” async src=”//c.pubguru.net/pg.xxxxx.js”></script>
<script type=”text/javascript”>
google_ad_client = “ca-pub-7620071422727774”;
/* 123greetings.com_desktop_300X250 */
google_ad_slot = “2935917685”;
google_ad_width = 300;
google_ad_height = 250;
</script>
<script type=”text/javascript” src=”//pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
Can go either in the Header or Body (will be provided to you by MonetizeMore):
<script type=”text/javascript” async src=”//c.pubguru.net/pg.xxxxxxxx.js”></script>
Body:
<ins class=”adsbygoogle”
style=”display:inline-block;width:300px;height:250px”
data-ad-client=”ca-pub-XXXXXXXXXXXXXXXXX”
data-ad-slot=”XXXXXXXX”></ins>
Head:
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.defineSlot(‘/55555/sample1’, [[728, 90], [300, 250]], ‘div-gpt-ad-22222-0’).addService(googletag.pubads());
googletag.defineSlot(‘/55555/sample2’, [[300, 250], [728, 90]], ‘div-gpt-ad-33333-0′).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
Body:
<div id=’div-gpt-ad-22222-0’>
<script>
googletag.cmd.push(function() { googletag.display(‘div-gpt-ad-22222-0′); });
</script>
</div>
<div id=’div-gpt-ad-33333-0’>
<script>
googletag.cmd.push(function() { googletag.display(‘div-gpt-ad-33333-0’); });
</script>
</div>
TCF2.0 compliant code:
Head:
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
window.pg=window.pg||{};pg.atq=pg.atq||[]; // build consent queue
pg.atq.push(function() {
//GAM Tag
googletag.cmd.push(function () {
googletag.defineSlot(‘/XXXXXXX/XXXXXXX’, [[XXX, XXX], [XXX, XXX]], ‘div-gpt-ad-XXXXXXXXXX-0’).addService(googletag.pubads());
googletag.defineSlot(‘/XXXXXX/XXXXXXX’, [[XXXX, XXX], [XXX, XX]], ‘div-gpt-ad-XXXXXXXX-0′).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
});
</script>
<script type=”text/javascript” async src=”//c.pubguru.net/pg.XXXXXX.js”></script>
Body:
<div id=’div-gpt-ad-XXXXXX-0’>
<script>
pg.atq.push(function() {window.googletag.cmd.push(function() {googletag.display(‘div-gpt-ad-XXXXXXX-0′);})});
</script>
</div>
<div id=’div-gpt-ad-XXXXXXX-0’>
<script>
pg.atq.push(function() {window.googletag.cmd.push(function() {googletag.display(‘div-gpt-ad-XXXXXXXX-0’);})});
</script>
</div>
<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-147580335-1″</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-147580335-1’);
</script>
<script type=”text/javascript”>
window.pg = window.pg || {};
pg.acq = pg.acq || [];
pg.acq.push(function() {
// Global site tag (gtag.js)
pg.loadJS(“https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X”);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-XXXXXXXX-X’);
});
</script>
Head:
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
window.pg=window.pg||[];pg.acq=pg.acq||[];
pg.acq.push(function() {
//GAM Tag
googletag.cmd.push(function () {
googletag.defineSlot(‘/55555/sample_ad1’, [[728, 90], [300, 250]], ‘div-gpt-ad-22222-0’).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
//Google Analytics
pg.loadJS(“https://www.googletagmanager.com/gtag/js?id=UA-147580335-1″); window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-147580335-1’);
});
</script>
<script type=”text/javascript” async src=”//c.pubguru.net/pg.domain.js”></script>
Body:
<div id=’div-gpt-ad-22222-0′>
<script>
pg.acq.push(function() {window.googletag.cmd.push(function() {googletag.display(‘div-gpt-ad-22222-0’);})});
</script>
<div>
Kean Graham is the CEO and founder of MonetizeMore & a pioneer in the Adtech Industry. He is the resident expert in Ad Optimization, covering areas like Adsense Optimization,GAM Management, and third-party ad network partnerships. Kean believes in the supremacy of direct publisher deals and holistic optimization as keys to effective and consistent ad revenue increases.
10X your ad revenue with our award-winning solutions.