Avoid penalties by implementing a consent popup for GDPR compliance. Transparency and Consent Framework 2.0 (TCF2.0) Compliance guide for MonetizeMore Publishers

GDPR
Last updated: January 3, 2024 | by Kean Graham
TCF compliance guide for MonetizeMore publishers

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:

AdSense

 

Sample raw code (non-TCF2.0 compliant):

<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>

TCF2.0 compliant code:

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>

What changed in the code to make it compliant?

Avoid penalties by implementing a consent popup for GDPR compliance. Transparency and Consent Framework 2.0 (TCF2.0) Compliance guide for MonetizeMore Publishers MonitizeMore

AdSense Auto-Ads

Sample raw code (non-TCF2.0 compliant):

<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>

TCF2.0 compliant code:

<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>

What changed in the code to make it compliant?

Avoid penalties by implementing a consent popup for GDPR compliance. Transparency and Consent Framework 2.0 (TCF2.0) Compliance guide for MonetizeMore Publishers MonitizeMore

Ad Exchange

 

Sample raw code (non-TCF2.0 compliant):

<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>

TCF2.0 compliant code:

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>

What changed in the code to make it compliant?

Avoid penalties by implementing a consent popup for GDPR compliance. Transparency and Consent Framework 2.0 (TCF2.0) Compliance guide for MonetizeMore Publishers MonitizeMore

 

Google Ad Manager

 

Sample raw code (non-TCF2.0 compliant):

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>

What changed in the code to make it compliant?

Avoid penalties by implementing a consent popup for GDPR compliance. Transparency and Consent Framework 2.0 (TCF2.0) Compliance guide for MonetizeMore Publishers MonitizeMore

 

Google Analytics

Sample raw code (non-TCF2.0 compliant):

<!– 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>

TCF2.0 compliant code:

<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>

What changed in the code to make it compliant?

Avoid penalties by implementing a consent popup for GDPR compliance. Transparency and Consent Framework 2.0 (TCF2.0) Compliance guide for MonetizeMore Publishers MonitizeMore

GAM + Google Analytics

TCF2.0 compliant code:

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>

A+++++ Easily one of the best ad partners

  • Communication 10/10
  • Payments 10/10
  • Profesionality 10/10
  • Technicals 10/10
  • Dedication 10/10

$100M+

Paid to Publishers

3B+

Ad Requests Monthly

1500+

Happy Publishers

Recommended Reading

blog-monitoring
Blog
May 21, 2024

Blog Monitoring & Invalid Traffic Detection: Making it Work!

Read More
google-io-2024- AI Overviews
Blog
Last updated: May 20, 2024

Google’s AI Overviews’ Scary Impact on Publishers

Read More
Blog
May 15, 2024

What’s the Highest Paying Ad Network for Site & App Monetization?

Read More

Trusted by 1,500+ publishers worldwide

10X your ad revenue with our award-winning solutions.

Let's Talk

Close

Ready to 10X your ad revenue with the #1 ad management partner?

Start Now