1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hide adsense code from stumbleupon frames

Discussion in 'White Hat SEO' started by imm088, Sep 27, 2013.

  1. imm088

    imm088 Registered Member

    Joined:
    Dec 26, 2012
    Messages:
    88
    Likes Received:
    27
    Hello

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

    Any idea how to make it?
     
  2. devde

    devde Registered Member

    Joined:
    Jan 5, 2013
    Messages:
    76
    Likes Received:
    23
    you want to hide an iframe?
    I think you can do it with a bit of css
    try style="visibility:hidden;display:none"
     
  3. imm088

    imm088 Registered Member

    Joined:
    Dec 26, 2012
    Messages:
    88
    Likes Received:
    27
    not even close
     
  4. devde

    devde Registered Member

    Joined:
    Jan 5, 2013
    Messages:
    76
    Likes Received:
    23
    and trying with widht=0 and height=0 ?
     
  5. cesarian

    cesarian Power Member

    Joined:
    Mar 4, 2008
    Messages:
    596
    Likes Received:
    255
    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.
     
  6. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    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.
     
  7. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    11,241
    Likes Received:
    10,039
    Occupation:
    FREE WEBSITE REPORTS
    Location:
    ⇓⇓⇓⇓⇓⇓⇓⇓⇓⇓⇓⇓⇓⇓
    Home Page:
    Sometimes Adsense itself doesn't show when in some situations, maybe the stumbleupon frame triggered that automatically.
     
  8. imm088

    imm088 Registered Member

    Joined:
    Dec 26, 2012
    Messages:
    88
    Likes Received:
    27
    stumblers dont click ads and ctr drops.can you give a sample of the code?
     
  9. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    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: Sep 28, 2013
  10. imm088

    imm088 Registered Member

    Joined:
    Dec 26, 2012
    Messages:
    88
    Likes Received:
    27
    sounds good but i am not a programmer :p
    any sample code?
     
  11. dinkish

    dinkish Power Member

    Joined:
    Apr 19, 2013
    Messages:
    689
    Likes Received:
    159
    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.
     
  12. cesarian

    cesarian Power Member

    Joined:
    Mar 4, 2008
    Messages:
    596
    Likes Received:
    255
    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
     
    • Thanks Thanks x 1