SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Adsense and popups on the same page using php!

    Hi,

    I have Adsense on my site. I also want popunders on my site to increase revenue but it is against Adsense's TOS.

    I would be displaying only 1 popunder per visitor for a 12 hour period.

    So I was wondering if I could produce a script in php so that when a visitor first visits a page on my site there is no Adsense ads on the page and it produces the popunder. Once he revisits the page or goes to another page he will never see a popunder again but he will now see adsense ads instead.

    Is there a way of doing this or is there a free script that can control your ads so that I can make the popunder code display in my website only once per visitor and then the next page the visitor goes to they will only see adsense ads an no popunders will appear untill he comes back to my site 12 hours later.

    Thanks!

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Set a cookie that lasts for 12 hours. When a user visits your site, check to see if the cookie is still there. If so, show adsense. If it's not, show the popunder.

    You'll miss users who do not allow cookies, but I don't know of any way at all to keep track of that without using a DB or txt file. You could track IP's but many internet users are assigned different IP's when they log on.

    Setting a cookie just seems to be the simplest method to me.

    Tim

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doing this shouldn't really break Adsense TOS should it because if Adsense robots check to see if I am using popups or popunders then they will only see the popunder code and there will be no adsense code on the page, but if they see adsense code then they will not see any popunder or popup code will they.

    Does anybody know what percentage of computers accrossed the world delete or not store their cookies.

    This is because if they don't allow cookies on their computer then I my site will just be having the popunder code in them and will not show any adsense ads at all and could then loose me some good money.

    I would prefer it the other way around.

    If there do not accept cookies then it will just display my Adsense code and not the popunder code.

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not too familiar with Google's TOS regarding AdSense. You may want to post that in the Advertising forum. I do know that you ARE allowed, for example, to put AdSense on one page, and then, Yahoo, for instance, on another. If you did your PHP code right, the bot wouldn't even know. But how would Google react if someone reported your site?

    I tried to do a quick search on cookie statistics but found nothing useful. I would tend to think if anything people have cookies enabled...they just restrict certain sites (or allow) from installing them. Depending on what your site is dealing with, they may not want you to put cookies on their site. It's just one of those deals where you enjoy being a programmer...there's never a simple solution...

    Tim

  5. #5
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's probably best if I ask Adsense about doing this then to see if it breaks their TOS or not as I don't want to break their TOS.

    I can't see how it is though as I will not be having a popunder on the same page as adsense. When a popunder happens there will be no Adsense on the page, when there is Adsense on the page then a popunder will not be spawned or you will not even see any popunder code within my source code.

  6. #6
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't ask Google. They might tell you it's not allowed (even if it is). Ask others who do similar if they've had problems. I always believe you get the best information from the customers, not the company!

    Tim

  7. #7
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are quite right. The only thing is that I don't think I would get an answer all that quick as I don't think many would do this or may have even thought about it.

    I will have to just see.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •