View Full Version: PubMatic Frame Name

Pages :[ 1 ]

Gene Sawyer
16 February 2008, 08:21
Hi. I am new to the PubMatic community and had a question regarding how it renders the ads served and the naming of objects behind the scenes. I currently use an embedded javascript to redirect users with ad blockers (e.g. AdBlock Plus) to an alternate site. I have the code working for Google Ad Sense but am slowly moving all of my ads to PubMatic and would like to alter my code to work for PubMatic.

For Google Ad Sense, I use:

name == "google_ads_frame"

Could someone with knowledge of the PubMatic system write me back and let me know the static frame name PubMatic uses?

Thanks! Great company BTW.

Gene Sawyer
16 February 2008, 09:49
Here you go, I got it working! Pubmatic may want to just start tagging this onto their ads:

<script>
function dieAdBlockPlusDie()
{
var gdiv = document.getElementsByTagName("div");
var blocked=1;
for (var i = 0; i < gdiv.length; i++)
{
var name = gdiv[i].getAttribute("id");
if(name == "pubmaticMessageDiv")
{
var blocked=0;
}
}
if(blocked){window.location = 'http://someredirecturl.com';}
}
setTimeout('dieAdBlockPlusDie()', 2000);
</script>