Google Publisher Tags Implemented Outside the atq Function

Incorrectly implementing Google Publisher Tags while using Traffic Cop on Block Mode will hinder Traffic Cop from being able to effectively suppress ad serving to suspect and invalid traffic.

Traffic Cop stops ad requests from firing when invalid traffic is detected so ads are not served to these users, thereby preventing ad fraud from taking place.

If you are using PubGuru tags from MonetizeMore, these conversions are no longer necessary as these types of tags are automatically configured to work with Traffic Cop. The following instructions only apply to publishers using hardcoded Google Publisher tags on the site.

If ads trafficked via Google Ad Manager (GAM) are not properly deployed on the site while Traffic Cop is active, then it will not be able to perform its function. Essentially, GAM tags are supposed to be wrapped inside the atq function. Here’s an example of a raw Google Publisher Tag and how it should look like when wrapped in the atq function for Traffic Cop compatibility:

From:

Head:

<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<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>

To:

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('/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>
<<script type="text/javascript" async src="//c.pubguru.net/pubdomain.js"></script>


Body:
<div id='div-gpt-ad-22222-0'>
<script>
pg.atq.push(function() {window.googletag.cmd.push(function() {googletag.display('div-gpt-ad-22222-0');})});
</script>
</div>

<div id='div-gpt-ad-33333-0'>
<script>
pg.atq.push(function() {window.googletag.cmd.push(function() {googletag.display('div-gpt-ad-33333-0');})});
</script>
</div>

Your Traffic Cop experts at MonetizeMore can help with these tag conversions and the converted tag sample above can be used as a template of how the tags should be configured. Just make sure to update the details in the tag to match your own raw tags. For example, the network IDs and each individual ad IDs must be customized to match your own.

Once the tags are correctly wrapped in the atq function, ad requests will be delayed from getting sent out until any suspect user is able to solve the captcha that appears on the page whenever suspicious or invalid traffic is detected.

Stop letting RPM drops stress you out

Let our AdOps Experts do the hard work. Sign up today and unlock your revenue potential.

Maximize my Ad Revenue

It’s your turn to take the ad monetization game to the next level

  • No credit card required
  • No DNS transfer
  • Cancel any time

Get started