Home > Paid Traffic Sources > Facebook & Instagram

The redirect script for SAM (22)


04-12-2012 10:11 PM #1 hd2010 (Member)
The redirect script for SAM

Yo, giving back to STM community, thanks for helping me understand this affiliate game, special thanks to the admin, especially Zeno who is very helpful, lets earn more money

Winston's BuyBuddy/SAM FB rotator 1.6 (updated to 1.6 to support geoip php API)
- geoip country support
- weighted offer link rotation
- SAM subid tracking support
- single FB approval switch for offer
- work with/without http reverse proxy (varnish cache)
- support geoip php api

Script Installation/Usage
------------------------

1. Upload all files to a folder to subdomain or your extra domain.
2. Fill in the url value for $offerurl, the url is the final page which after the redirects.
3. Fill in the url value for $redirect, make sure include the subid parameter, for example ?s1= for cake platform
4. For weighted rotation, if you need 50/50, fill in the $redirect[0] to $redirect[4] with your first offer url, then the rest with second offer url
5. chosen country, the country which the offer being advertised on
6. Set $fb_approval to TRUE when submit to FB for ad approval.
7. if you use maxmind geoip php API, use go_geoip_api.php, rename it to something redirect.php or anything you like
8. if you use the maxmind geoip php class, use go.php, change your $geoip_db_location, if you store your maxmind geoip database elsewhere, your webserver must able to read this folder for geoip lookup to work fine.
9. copy & paste into other folder if you have other campaigns.
10. only rotate.php and geoip folder needed for this script work fully, aff.php and offer.php are for you to undertsnad how this script work.

This is for exclusive for STM's members, no sharing outside, no $97 clickbank product, if caught, you will earn a ban

https://www.dropbox.com/s/en8p8v7rnp...script_1.6.rar


04-12-2012 10:28 PM #2 brianb (Member)

I'm dumb. What does this do exactly?


04-12-2012 10:29 PM #3 hd2010 (Member)

@brianb : install it and feel the magic


04-13-2012 03:19 PM #4 paycoguy (Member)

Quote Originally Posted by brianb View Post
I'm dumb. What does this do exactly?
Yeah, I don't get it either. Is it just an offer rotator?


04-13-2012 11:23 PM #5 hd2010 (Member)

@paycoguy : rotator for SAM


04-16-2012 01:40 AM #6 caffeineclicks (Member)

i've never tried doing this...

I see facebook on occasion mass clicking my ads. i assume its a spider thats checking to see that the same URL is the click thru.

I suppose it woudlnt be wise for me to use this on that account?


04-16-2012 03:04 AM #7 zeno (Administrator)

It's not a cloaker, it's just for geo-redirecting traffic. It's better to do that rather than to not do it.


06-18-2012 04:18 AM #8 naruto (Member)

Hi hd2010, the file is no longer exists, could you please re-upload?


06-24-2012 07:32 PM #9 goldgarden (Member)

hi hd2010,
please re upload
file does not exist

Thank you.


06-25-2012 01:38 AM #10 hunghtq (Member)

Ya, please reupload it bro!


06-26-2012 04:24 PM #11 krisicash (Member)

Ahh that will be awesome can yo ure upload ?


06-27-2012 12:21 AM #12 hd2010 (Member)

I will reupload once I back from vacation.


06-27-2012 10:07 AM #13 hd2010 (Member)

reuploaded


08-31-2012 09:40 AM #14 Oded Abbou (Member)

@hd2010 - Good stuff!

Would love to use this script but the only problem is that i already using cpvlab for tracking conversions (subid tracking) and offer rotation (switching url's after approval)...

The only missing is the geo redirects.

Is there a way i can cut some of the code so i can only use the maxmind geoip php API? if yes, are there any files i should not use or upload..?

Don't wanna to make any conflicts with cpvlab but really like to integrate with yours!


08-31-2012 10:23 AM #15 zeno (Administrator)

If all you're wanting to do is some simple georedirection just put an intermediate PHP file between adverts < > CPVlab or between CPVlab < > affiliate link. Edit to fit, make sure to test using proxies + watch the http headers to make sure things are redirecting as you intend.

e.g.

[PHP]
<?php

$subid1 = $_GET['subid1']; //get all individual subids
$subid2 = $_GET['subid2'];

$geo = geoip_record_by_name( $_SERVER['REMOTE_ADDR'] ); //get geoip data
$countrycode = $geo['country_code']; //extract two letter country code

//simple redirect based on country code
switch($countrycode) {
case 'US'or'CA'or'UK':
$redirect[1] = 'http://CPVlaburl.com/whatever?subid1='.$subid1;
$number = mt_rand(1,1);
header("Location:$redirect[$number]");
exit;

case 'DE':
$redirect[1] = 'http://CPVlaburl.com/whatever?subid1='.$subid1;
$number = mt_rand(1,1);
header("Location:$redirect[$number]");
exit;

default: // exceptions
header('Location: OFFERURL');
exit;
}
?>
[/PHP]


08-31-2012 01:49 PM #16 Oded Abbou (Member)

Thanks zeno!


STATUS UPDATE: moving to beyondhosting and from what i read, they already have this db installed.. now we just need a php script to call the db?

@zeno - with the code above, what would actually be the campaign url (destination url) for the ads? from what i saw, i need to place the "cpvlab campaign url" in the code above.


Any solution if i already using the "Generate Cloaked pages" feature in cpvlab? should i insert the code you just post inside the cloaked index.php..? or a separate file?


The thing is i never use the original cpvlab campaign url... i always cloak and upload the cloaked index.php file onto a dedicated domain/directory.

Do you think in case of using cloaked url and also the geo redirect script would slow the actual process? too many redirects at once..?



Thanks!


08-31-2012 11:01 PM #17 zeno (Administrator)

You'd have your Facebook ad point to the redirect file, wherever that may be, which in turn redirects out to your CPVlab links. I can't help much with CPVlab is I don't use it so don't understand how these cloaked pages work and what exactly it is that's being cloaked. On a decent server that georedirection script will only add a couple of hundred milliseconds to the redirect process so isn't a big issue. However if you can edit the cloaked php file CPVlab has made and add the georedirection to that, that would be better. Should be relatively easy I would think. E.g. use script above, after the case: 'US' or whatever part have the contents of the cloaked php file, then under default have it bounce out to the offer? I'm sure someone who uses CPVlab will give you the low down.

[PHP]
<?php

$subid1 = $_GET['subid1']; //get all individual subids
$subid2 = $_GET['subid2'];

$geo = geoip_record_by_name( $_SERVER['REMOTE_ADDR'] ); //get geoip data
$countrycode = $geo['country_code']; //extract two letter country code

//simple redirect based on country code
switch($countrycode) {
case 'US':

//Cloaked CPVlab PHP file code in here

exit;

default: // exceptions
header('Location: OFFERURL');
exit;
}
?>
[/PHP]


09-01-2012 12:05 AM #18 hd2010 (Member)

I wish STM pay me royalty...


09-01-2012 08:35 AM #19 Oded Abbou (Member)

Thanks for your help zeno!


09-03-2012 11:49 AM #20 hd2010 (Member)

@zeno : in the redirection script, why need to specify each country code in the switch statement ?


09-03-2012 09:12 PM #21 zeno (Administrator)

I'm not quite sure what you mean - are you referring to my use of "case 'US'or'CA'or'UK':"? I put that there as an example of how to get multiple countries all going to the same link.


09-03-2012 10:32 PM #22 hd2010 (Member)

yes, that what I mean, that will work


Home > Paid Traffic Sources > Facebook & Instagram