Hide adsense code from stumbleupon frames

imm088

Registered Member
Joined
Dec 26, 2012
Messages
88
Reaction score
27
Hello

I saw this site that had adsense ads turned off when site was iframed by stumbleupon

Any idea how to make it?
 
you want to hide an iframe?
I think you can do it with a bit of css
try style="visibility:hidden;display:none"
 
why would you want to hide adsense? also, you can put adsense on a div and remove the div with javascript if page is loaded within iframe.
 
why would you want to hide adsense? also, you can put adsense on a div and remove the div with javascript if page is loaded within iframe.

Javascript would be the easiest way of doing it. I still don't understand why you'd want it not to display, but that's beyond the point.

I'd probably do it server side though, display the div if the referrer wasn't stumblupon. You wouldn't need to worry about settings being enable\disabled, or bots detecting it for whatever may be a concern.
 
Sometimes Adsense itself doesn't show when in some situations, maybe the stumbleupon frame triggered that automatically.
 
why would you want to hide adsense? also, you can put adsense on a div and remove the div with javascript if page is loaded within iframe.

stumblers dont click ads and ctr drops.can you give a sample of the code?
 
stumblers dont click ads and ctr drops.can you give a sample of the code?

One way would be to Google "javascript referrer". You could probably do an onload function after you verified if it's not a stumbleupon referrer.

You can forge referrers though.

I'd use php since it's server side. It can still be forged, but it wouldn't be reliant on client side js settings.
 
Last edited:
One way would be to Google "javascript referrer". You could probably do an onload function after you verified if it's not a stumbleupon referrer.

You can forge referrers though.

I'd use php since it's server side. It can still be forged, but it wouldn't be reliant on client side js settings.

sounds good but i am not a programmer :P
any sample code?
 
Nope. I'm not a javascript coder either, so I'm not gonna look it up in Google to copy and paste a working script for you.

Maybe someone else is going to be more nice than the direction I've already given.
 
sounds good but i am not a programmer :P
any sample code?

Well hiding the code based of referrer works too, a sample PHP code online (I am too lazy to code myself sry ;D):
http://stackoverflow.com/questions/...elements-on-my-page-based-on-referral-traffic

The one I mentioned (JavaScript) is to hide the code if your page is loaded within an iFrame (such as stumbleupon). The downside is that it will hide in all iFrame, not just stumbleupon;
http://stackoverflow.com/questions/...ng-loaded-inside-an-iframe-or-directly-into-t
 
Back
Top