Digital Point Forums
Wester Union

Go Back   Digital Point Forums > Search Engines > Yahoo > Publisher Network
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #21  
Old Feb 4th 2006, 8:59 am
jeremy860 jeremy860 is offline
Twilight Vanquisher
 
Join Date: Jun 2005
Location: North Dakota
Posts: 913
jeremy860 is on a distinguished road
I am a total newbie to php so if you could like post the exact code with example ypn and adsense codes in it, that would be great, then i could just copy and paste over the example ad codes
Reply With Quote
  #22  
Old Feb 4th 2006, 9:54 am
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
I couldn't do that because I don't exactly know what you want and how you want your ads to be shown. You're the only one to know that. You'll probably need changes even after everything's done, so you'd better get a grip on php.net and have a read, it's not that difficult Anyhow, if you need some php programming done you can PM me if you care to negotiate
__________________
| | |
Reply With Quote
  #23  
Old Feb 4th 2006, 10:25 am
jeremy860 jeremy860 is offline
Twilight Vanquisher
 
Join Date: Jun 2005
Location: North Dakota
Posts: 913
jeremy860 is on a distinguished road
alright well I guess i'll just continue to wait for someone to post some code that actually works for us newbies. peace
Reply With Quote
  #24  
Old Feb 4th 2006, 11:40 am
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
It's way too clear (the code above) so you could do it yourself without much trouble. In case you need something more difficult than simply copy/pasting the bits of code above, please do ask, but don't just expect for that code to simply jump into your php files... You're just being lazy!
__________________
| | |
Reply With Quote
  #25  
Old Feb 4th 2006, 12:51 pm
Tranix's Avatar
Tranix Tranix is offline
Champion of the Naaru
 
Join Date: Aug 2005
Location: Tranix.net
Posts: 215
Tranix is on a distinguished road
Quote:
Originally Posted by mihaidamianov
php Code:
<?
include("geoip.inc");

$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);

$visitor_country_code=geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
$visitor_country_name=geoip_country_name_by_addr($gi, $_SERVER['REMOTE_ADDR']);

?>
People recommended me to leave the YPN Ads on by using geotargetting so I'd like to give it a shot and see how is it going .

All we need to do is uploading geoip.inc and GeoIP.dat files to directory right? Then replace $visitor_country_code with the code below? If possible can you implement these two strings code for me please

Quote:
<?
switch ($visitor_country_code) {
case "US": {
switch ($vrand=rand(1,2)) {
case 1: {
//Display YPN ads for US visitors only

?> Insert YPN Ads code here <?

}
?>
Very much appreciated,
Tranix
Reply With Quote
  #26  
Old Feb 4th 2006, 12:58 pm
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
Could you be more specific with the question, 'coz I don't get what you want. You've already done most of the work.
__________________
| | |
Reply With Quote
  #27  
Old Feb 4th 2006, 1:37 pm
Tranix's Avatar
Tranix Tranix is offline
Champion of the Naaru
 
Join Date: Aug 2005
Location: Tranix.net
Posts: 215
Tranix is on a distinguished road
The code looks like this right?

<?include("geoip.inc"); $gi = geoip_open("GeoIP.dat",GEOIP_STANDARD); $visitor_country_code=<?
switch ($visitor_country_code) {
case "US": {
switch ($vrand=rand(1,2)) {
case 1: {
//Display YPN ads for US visitors only

?> Insert YPN Ads code here <?
}
?> ($gi, $_SERVER['REMOTE_ADDR']);$visitor_country_name=geoip_country_name_by_addr($gi, $_SERVER['REMOTE_ADDR']); ?>


Last edited by Tranix; Feb 4th 2006 at 1:47 pm.
Reply With Quote
  #28  
Old Feb 4th 2006, 2:50 pm
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
Erm... no.. That is just a big mess... I'll post a bit later the code, I'm busy now.. Hold on to your seats until then
__________________
| | |
Reply With Quote
  #29  
Old Feb 4th 2006, 4:50 pm
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
Exclamation My last answer to this

Step by step:

1. Download these files:
- GeoIP.dat from http://www.maxmind.com/app/geoip_country
- geoip.inc from http://www.maxmind.com/download/geoip/api/php/
and put them where your php banner script will be.

2. The php banner script

Code:
<?
// This part gets the ip of the visitor and matches it to a country name/code

include("geoip.inc");
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);

$visitor_country_code=geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
$visitor_country_name=geoip_country_name_by_addr($gi, $_SERVER['REMOTE_ADDR']);

//This part shows banners/codes that YOU decide for each country

switch ($visitor_country_name) {
case "Australia": { ?>

<-- GOOGLE ADSENSE OR WHATEVER CODE SUITABLE FOR AUSTRALIA GOES HERE -->

<? }
    break;
case "Belgium": { ?>

<-- GOOGLE ADSENSE OR WHATEVER CODE SUITABLE FOR BELGIUM GOES HERE -->

<? }
    break;

// AND SO ON, YOU CAN ADD MORE COUNTRIES HERE JUST LIKE ABOVE

default: { // THIS WILL EXECUTE FOR ALL OTHER DESTINATIONS NOT MENTIONED ABOVE ?>

<-- GOOGLE ADSENSE OR WHATEVER CODE SUITABLE FOR OTHER DESTINATIONS -->

<? }
}
?>
And this is it! I'm not talking about this anymore.
__________________
| | |
Reply With Quote
  #30  
Old Feb 4th 2006, 9:49 pm
Tranix's Avatar
Tranix Tranix is offline
Champion of the Naaru
 
Join Date: Aug 2005
Location: Tranix.net
Posts: 215
Tranix is on a distinguished road
Man, I can't thanks you enough for this awesome code I was searching for this code for days and almost given up.

PS I need a few people who are living out side of the U.S. to check if you still see YPN ads on my site or not please

http://www.tranix.net

Appreciate a lot,
Tranix
Reply With Quote
  #31  
Old Feb 5th 2006, 1:35 am
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
I can see only one banner ad at the bottom
__________________
| | |
Reply With Quote
  #32  
Old Feb 5th 2006, 11:50 am
Gregtq Gregtq is offline
Grunt
 
Join Date: Jan 2006
Posts: 94
Gregtq is on a distinguished road
This is crazy for us to have to worry about international clicks.
I have no control over this other than adding a script to help but thats not 100%.
If Yahoo doesn't want foreign clicks they should have this built in to their script. Sorta sounds like a game.
Reply With Quote
  #33  
Old Feb 5th 2006, 11:53 am
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
Quote:
Originally Posted by Treasure Quest
If Yahoo doesn't want foreign clicks they should have this built in to their script.
That's correct. I don't use yahoo myself, but if they don't filter the visitors' ip, who should?!
__________________
| | |
Reply With Quote
  #34  
Old Feb 5th 2006, 3:51 pm
keikor's Avatar
keikor keikor is offline
Twilight Vanquisher
 
Join Date: Jul 2005
Location: Roland Gong
Posts: 664
keikor is on a distinguished road
Ok, let me get this more clearer for myself and others:-

So, the first step is to download both of the files and upload to your directory where you are using.

Then insert this code to whatever page you want to use:-

Code:
<?
// This part gets the ip of the visitor and matches it to a country name/code

include("geoip.inc");
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);

$visitor_country_code=geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']);
$visitor_country_name=geoip_country_name_by_addr($gi, $_SERVER['REMOTE_ADDR']);

//This part shows banners/codes that YOU decide for each country

switch ($visitor_country_name) {
case "USA": { ?>

<script language="JavaScript">
<!--
ctxt_ad_partner = "xxxxxxxxxx";
ctxt_ad_section = "";
ctxt_ad_bg = "";
ctxt_ad_width = 250;
ctxt_ad_height = 250;
ctxt_ad_bc = "FFFFFF";
ctxt_ad_cc = "FFFFFF";
ctxt_ad_lc = "FFFFFF";
ctxt_ad_tc = "111111";
ctxt_ad_uc = "111111";
// -->
</script>
<script language="JavaScript" src="http://ypn-js.overture.com/partner/js/ypn.js">
</script>


<? }
    break;

// AND SO ON, YOU CAN ADD MORE COUNTRIES HERE JUST LIKE ABOVE

default: { // THIS WILL EXECUTE FOR ALL OTHER DESTINATIONS NOT MENTIONED ABOVE ?>

<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxx";
google_ad_width = 250;
google_ad_height = 250;
google_ad_format = "250x250_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "FFFFFF";
google_color_url = "FFFFFF";
google_color_text = "FFFFFF";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


<? }
}
?>
Correct me if i am wrong.
Reply With Quote
  #35  
Old Feb 5th 2006, 3:56 pm
Tranix's Avatar
Tranix Tranix is offline
Champion of the Naaru
 
Join Date: Aug 2005
Location: Tranix.net
Posts: 215
Tranix is on a distinguished road
I think you should spell out the country name USA => United Stats
Reply With Quote
  #36  
Old Feb 5th 2006, 7:56 pm
SamOwen's Avatar
SamOwen SamOwen is offline
Twilight Vanquisher
 
Join Date: Aug 2005
Posts: 865
SamOwen will become famous soon enoughSamOwen will become famous soon enough
Quote:
Originally Posted by Treasure Quest
This is crazy for us to have to worry about international clicks.
I have no control over this other than adding a script to help but thats not 100%.
If Yahoo doesn't want foreign clicks they should have this built in to their script. Sorta sounds like a game.
Exactly. Yahoo! should filter these out. It's obvious they already know where the clicks and views are coming from.
Reply With Quote
  #37  
Old Feb 5th 2006, 9:40 pm
keikor's Avatar
keikor keikor is offline
Twilight Vanquisher
 
Join Date: Jul 2005
Location: Roland Gong
Posts: 664
keikor is on a distinguished road
I am getting this error when trying to put two ad banners or ad sizes in one page:-

Fatal error: Cannot redeclare class geoip in /home/thepath/public_html/thesite/contactus/geoip.inc on line 67

The first banner works fine but the second banner didn't

Any help?
Reply With Quote
  #38  
Old Feb 5th 2006, 11:51 pm
mihaidamianov's Avatar
mihaidamianov mihaidamianov is offline
of the Nightfall
 
Join Date: Jan 2006
Location: the European Union
Posts: 1,219
mihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of lightmihaidamianov is a glorious beacon of light
ummm... yeah, hold on

you need to add this line at the end of the script above in order to be able to reopen geoipclass

Code:
geoip_close($gi);


or simply put it at the end of the file, and - for the second banner do not use the geoip_open line anymore. Only the SWITCH part should be repeated for each banner..

AND START LEARNING WEB PROGRAMMING!
__________________
| | |
Reply With Quote
  #39  
Old Feb 6th 2006, 1:55 am
keikor's Avatar
keikor keikor is offline
Twilight Vanquisher
 
Join Date: Jul 2005
Location: Roland Gong
Posts: 664
keikor is on a distinguished road
Thanks a lot!

i think i got this working, but is there anyway to check the ads with foreign i.p. address? Like any online web based proxy tools? using international i.p.?

thanks.
Reply With Quote
  #40  
Old Feb 6th 2006, 4:46 am
fmgomes fmgomes is offline
Grunt
 
Join Date: Jan 2006
Posts: 77
fmgomes is on a distinguished road
Quote:
Originally Posted by ServerUnion
Code:
if ($ip == "com") {
 echo("in america");
}
?>
Be aware that many people have .com domains here in Europe.
Reply With Quote
Reply

Bookmarks

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Geo Targeting digitalpoint General Marketing 11 Oct 22nd 2006 3:17 am
Geo targeting cornelius Programming 2 Dec 11th 2005 3:41 pm
Geo targeting questions emotif AdSense 6 Oct 27th 2005 6:35 am
Geo-targeting tool cashbackers All Other Tools 1 Jul 28th 2005 9:35 am
Geo Targeting dcristo Affiliate Programs 4 Jun 29th 2005 8:31 pm


All times are GMT -8. The time now is 2:40 pm.