views:

138

answers:

2

I have a website developed in ASP.NET and VB.NET which has a place for a 160 x 600 google ad on the right hand side of the page.

It looks good when it shows on the page but I have discovered that when the google ad is blocked, like it is at my workplace, the page looks incomplete. There is no message that shows to say the ad is blocked, it just shows blank.

I don't want to find a way around the blocking, rather I would like to dsiplay something in its place (a graphic of my own for instance) if it is blocked.

Is there a way to do this?

A: 

Never tried it, but you could try to use css positioning and z-index to stick a transparent container for the google ads on top of some other content.

I really have no idea how well that would work, but that's what I'd try if I were in your shoes.

timdev
+1  A: 

Put it in a <div>...</div>, and right after it place a JavaScript to determine, by its height or by the value of document.frames.length, the presence of the AdSense. If it was not detected you change the div's innerHTML, or just document.write() something.

If there is AdSense, document.frames.length will be at last 1.

Make it simpliest as possible because they won't like seeing that your site is messing with their iframe, they can block your AdSense account.

Havenard
Might be necessary, though I'd try my method first, as it requires no scripting.
timdev
I have a better solution similar to yours: Just put there a DIV with a background. If no AdSense is shown, the background will be instead. No moving parts.
Havenard