Talk Arcades: Forum for Arcade Webmasters    

  Talk Arcades > Arcades > Revenue

Welcome to Talk Arcades, the premier forum for arcade webmasters.

You are currently viewing our boards as a guest. By joining our community you will be able to make posts, communicate privately with other arcade webmasters and participate in our Live Marketplace. Registration is easy, so please join us today!

Reply
 
LinkBack Thread Tools Display Modes
Old 12-08-2006, 04:14 PM   #1 (permalink)
nkiegrea
Preferred Member
 
nkiegrea's Avatar
 
Join Date: Nov 2006
Posts: 121
nkiegrea is on a distinguished road
Send a message via AIM to nkiegrea


Thumbs up How to Geo Target your YPN ads

Hello all, I just got my arcade and read that YPN (Yahoo) tends to band peoples accounts who show their ads to people who are outside of USA... I found a way to fix this problem on another forum and would like to share it with you all so you guys don't get banned! =)

I followed these directions and it worked perfectly!

Good luck!

================================================== ==

This is a simple way to geotarget YPN ads to US visitors only and to show Google Adsense ads to visitors from all other locations using MaxMind's GeoIP database.

Edit: A barebones implementation of this can be seen here http://www.fadplay.com/geoip.php

1. Download the GeoIP database to your server - "wget http://www.maxmind.com/download/geoi...e/GeoIP.dat.gz"

2. Unzip the above file which you just downloaded - "gunzip -d GeoIP.dat.gz"

3. Download the PHP API/include file provided by MaxMind - "wget http://www.maxmind.com/download/geoip/api/php/geoip.inc"

4. Include the following code in any PHP pages you want to show geotargeted ads

PHP Code:
<?php
include("geoip.inc");
$gi geoip_open("GeoIP.dat",GEOIP_STANDARD);
$country geoip_country_code_by_addr($gi$REMOTE_ADDR);
geoip_close($gi);
?>
5. Place the following code wherever you want to show ads

PHP Code:
<?php
if ($country == "US")
  echo 
'YOUR YPN AD CODE';
else
  echo 
'YOUR GOOGLE ADSENSE AD CODE';
?>
Done!

Hopefully it works for you guys as it did for me! =)

Regards,
Zack B

Last edited by ArcadeJunky : 12-08-2006 at 10:53 PM. Reason: width
nkiegrea is online now  
Digg this Post!
Reply With Quote
Old 12-08-2006, 04:17 PM   #2 (permalink)
RickyG
Moderator
Senior Member
 
RickyG's Avatar
 
Join Date: Dec 2006
Location: Under Your Mouse!
Posts: 1,208
RickyG is on a distinguished road
Send a message via ICQ to RickyG Send a message via AIM to RickyG Send a message via MSN to RickyG Send a message via Yahoo to RickyG


Default

thanks !!!
__________________

Arcade Banner Exchange, game packs, top site, arcade script and forum for all of your arcade needs http://www.mibbi.com
This site stinks!! www.farting.us

Coming soon MibbiJr!
RickyG is online now  
Digg this Post!
Reply With Quote
Old 12-08-2006, 11:41 PM   #3 (permalink)
ArcadeJunky
Administrator
Senior Member
 
ArcadeJunky's Avatar
 
Join Date: Aug 2006
Posts: 636
ArcadeJunky is on a distinguished road


Default

Good stuff, thanks for the guide. Stickied in Revenue forum for reference.
__________________
>> FunKlicks.com Banner Exchange { 100x100 and 125x125 arcade banners }

ArcadeJunky is online now  
Digg this Post!
Reply With Quote
Old 12-10-2006, 01:53 PM   #4 (permalink)
nkiegrea
Preferred Member
 
nkiegrea's Avatar
 
Join Date: Nov 2006
Posts: 121
nkiegrea is on a distinguished road
Send a message via AIM to nkiegrea


Default

I am trying to set it with cookies to save system resources but Im not having any luck.. if someone could help me out that would be awesome.
nkiegrea is online now  
Digg this Post!
Reply With Quote
Old 12-13-2006, 04:45 PM   #5 (permalink)
nkiegrea
Preferred Member
 
nkiegrea's Avatar
 
Join Date: Nov 2006
Posts: 121
nkiegrea is on a distinguished road
Send a message via AIM to nkiegrea


Default

Ok, with some help from some other arcade webmasters I found how to set up the cookies part of this Geo Targetting.

Put this into your functions.php page or a page that loads everytime in replace of step 4 mentioned above.

PHP Code:
//geo-targeting start

if (isset($_COOKIE["geo"])) {
    
$country  $_COOKIE['geo'];
    } else  {
    include(
"geoip.inc");
    
$gi =  geoip_open("GeoIP.dat",GEOIP_STANDARD);
    
$ip =  $_SERVER["REMOTE_ADDR"];
    
$country geoip_country_code_by_addr($gi,  $ip);
    
geoip_close($gi);
    
setcookie("geo"$country,  time()+15552000"/"".yourdomain.com"0); //6 month  cookie
  
}

//<-- geo-targeting finish 
if you visit BlitzGamer.com - Fast Free Online Flash Gaming - Join the BLITZ and Chat! and look at the cookies through firefox you should see a cookie named "geo" .

Oh, btw, if anyone is out of the united states, let me know if you are seeing adsense or yahoo ads please.

Regards,
Zack B
BlitzGamer.com
nkiegrea is online now  
Digg this Post!
Reply With Quote
Old 03-15-2007, 09:19 AM   #6 (permalink)
thinkarcade
Contributing Member
 
thinkarcade's Avatar
 
Join Date: Mar 2007
Posts: 27
thinkarcade is on a distinguished road


Default

Ok, I think thats my code. I was about to post the same thing
__________________
Arcade Webmaster Forums | PHPidiots
thinkarcade is offline  
Digg this Post!
Reply With Quote
Old 05-09-2007, 08:24 PM   #7 (permalink)
FusionHosting
Member
 
Join Date: Apr 2007
Posts: 16
FusionHosting is on a distinguished road


Default

I doubt it, the first part of the code I got off a php tutorial on hotscripts weeks ago.

I would recommend this as there are some issues with Phpadsnew/Openads. Code like this just keeps it simple and works.
FusionHosting is offline  
Digg this Post!
Reply With Quote
Old 06-22-2007, 07:54 PM   #8 (permalink)
NightLinks
Preferred Member
 
Join Date: Mar 2007
Location: Bronx, NY
Posts: 125
NightLinks is on a distinguished road
Send a message via AIM to NightLinks


Default

The link is dead on top. I can't download "GeoIP.dat.gz" file.
NightLinks is offline  
Digg this Post!
Reply With Quote
Old 06-25-2007, 11:53 AM   #9 (permalink)
nkiegrea
Preferred Member
 
nkiegrea's Avatar
 
Join Date: Nov 2006
Posts: 121
nkiegrea is on a distinguished road
Send a message via AIM to nkiegrea


Default

Links working for me. Just go to the domain and look for the file if its not working for you.
nkiegrea is online now  
Digg this Post!
Reply With Quote
Old 06-26-2007, 01:08 AM   #10 (permalink)
NightLinks
Preferred Member
 
Join Date: Mar 2007
Location: Bronx, NY
Posts: 125
NightLinks is on a distinguished road
Send a message via AIM to NightLinks


Default

Thank Nkiegrea,

The link is working for me now.
NightLinks is offline  
Digg this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 01:19 PM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6
© TalkArcades.com
Forum - Register - Calendar - Memberlist - FAQ - Search