Geo redirecting and Prosper202

fight_prof

New member
May 10, 2009
126
1
0
Hey guys,

So I did some searching and I posted on another part of the forum to get help with georedirecting with prosper 202. Someone suggested doing this:

----------------------------------------------------

"go to this page and download the include file

geoPlugin's free and easy PHP geolocation webservice explained

and use the following code. point to this php page when setting up the link where the ad goes.

<?php
//country code redirect
require_once('geoplugin.class.php');
$geoplugin = new geoPlugin();

$country_code = $geoplugin->countryCode;

switch($country_code) {
case 'US':
header('Location: http://xxx.com/united-states');
exit;
case 'UK':
header('Location: http://xxx.com/united-kingdom');
exit;
default: // exceptions
header('Location: http://xxx.com/generic');
exit;
}

?>"


------------------------------------------------------

The geoPlugin mentioned above is one I use for location stamping on landers.

My problem is, since I am using P202 for my tracking, I would like to be able to track ad performance using the Text Ad feature of 202 if possible. However, if I am to make a generic ad link which goes to a redirect page with the above code, this won't pass ad information.

I'm sure someone has done something similar to this. Any advice?

Thanks.

**edit: even further, is it possible to create only 1 landing page, but then based off of the users country, text links and certain section of code are changed dynamically?**
 


If you want to use the above code for this, make 3 text ads in prosper, one for US, one for UK and one for default and then place the generated code for these ads in the corresponding header() redirects. You can then use a single ad link for your campaigns and have the above code redirect for you accordingly. You'll prolly also want to pass a subid to your redirect so something like www.genericadlink.com/?sub=sub-goes-here and with each of the headers looking like header('Location: http://www.xxx.com/?t202kw=$_GET[sub]').

Its definitely possible to dynamically change the content on your page according to the country. Prolly the easiest way would be to set some type of flag ($country = "US") and then have switch/if statements that echo out text accordingly.
 
anybody able to lend a quick hand with this?

I downloaded http://www.geoplugin.com/_media/webservices/geoplugin.class.php.tgz?id=webservices:php&cache=cache uploaded it domain.com/geo/

I saved the above code to geolink.php and uploaded it the same folder, set the CA url to google.com, and US url to msn.com, and default to yahoo.com to test.

When i view geolink.com normal and through hidemyass.com I always get directed to yahoo.com

I took a look at /geo/index.php and it does show that I'm in CA but the code above isn't redirecting me, and I can't figure out whats going on...

anyone help would be awesome since this is my first time digging into geo targeting...
 
nvm, solved it :D

in case anyone searches this in the future, the above coding is missing:

$geoplugin->locate();

before the $country_code=... line, at least tahts what i needed to get it work :)
 
OMG> Why did I not see this earlier. Just wasted 2 hours trying to find out what line was missing. Yeah, I'm an idiot. Just to spell it out for everyone else:

<?php
//country code redirect
require_once('geoplugin.class.php');
$geoplugin = new geoplugin();
$geoplugin->locate();
$country_code = $geoplugin->countryCode;
switch($country_code) {
case 'US':
header('Location: http://www.USAsite.com');
exit;
case 'UK':
header('Location: http://www.UKsite.com');
exit;
default: // exceptions
header('Location: http://www.EveryoneElse.com');
exit;
}
?>
 
OMG> Why did I not see this earlier. Just wasted 2 hours trying to find out what line was missing. Yeah, I'm an idiot. Just to spell it out for everyone else:

<?php
//country code redirect
require_once('geoplugin.class.php');
$geoplugin = new geoplugin();
$geoplugin->locate();
$country_code = $geoplugin->countryCode;
switch($country_code) {
case 'US':
header('Location: http://www.USAsite.com');
exit;
case 'UK':
header('Location: http://www.UKsite.com');
exit;
default: // exceptions
header('Location: http://www.EveryoneElse.com');
exit;
}
?>
Is this script still working properly? I'm in the UK and it sends me to everyoneelse.com - I've used a few proxies and it sends US visitors to the right place, but not UK visitors.
 
This is an old thread, but can anyone show me the modified code that would grab variables from the original URL and pass into the redirect URLs using $_GET[sub]' or similar?
 
  • Like
Reactions: stick2Herbs