How to add a Cache-Buster to a Standard GPT Passback

cache bust gpt passback

If you use DFP for Small Business (Google Ad Manager) for your blog, website or for your network, you are aware of the different types of available ad tags.

The most simplest ad tag to use is a passback in a Standard GPT Syntax. However, the tag its self lacks a cache buster so if you pass it to a publisher or it gets implemented in a non GAM ad server, the tag won’t be able to cache-bust and it will result in impression discrepancies which affects revenue.

Below is your standard GAM Standard GPT Syntax passback ad tag for a 728×90 placement:


<script src='https://www.googletagservices.com/tag/js/gpt.js'>
 googletag.pubads().definePassback('/123456789/dfp', [728, 90]).setClickUrl('ENTER_CLICK_MACRO').display();
</script>

Below is the updated GAM Standard GPT Syntax passback ad tag with a GAM cache buster and additional code displayed in red to have it functioning properly:


<script type='text/javascript' src='https://www.googletagservices.com/tag/js/gpt.js';>
var imp_hash = ((new Date()).getTime() + "-" + Math.floor(Math.random() * 1000000) +""+ Math.floor(Math.random() * 1000000)).substr(0,24);
googletag.pubads().definePassback('/123456789/dfp', [[728, 90]]).setTargeting('imp_hash', [''+imp_hash]).setClickUrl('ENTER_CLICK_MACRO').display();
</script>

The tag is now ready to be inserted into any ad server other than GAM or placed directly on a website and will cache bust impressions accordingly.

LEAVE A REPLY

Please enter your comment!
Please enter your name here