I have Google AdSense ads on my site and AdBlock blocks them, which is normal. When they are blocked, I would like to display alternative content. The problem is that when an ad is blocked, two things can happen:
1) The ad is completely blocked by AdBlock, the height and width of the AdSense ad are 0, and most of the AdSense code is not generated.
2) The content of AdSense ads is blocked, but the height and width are set, and the AdSense code is generated.
Option 1 is ideal because it allows me to check the height of the container or tags that AdSense displays and display my alternate content if the height is 0 or if a specific AdSense tag does not exist. However, when option 2 appears, I donโt know what I can do to display my alternative content, and the AdSense ads occupy the height and width they need, but they donโt display the content, which makes my site look corrupted.
Has anyone else had experience with this problem? My site is in.net 4.0, and so far I have only tested AdBlock in Chrome v12.
StronglyTyped
source share