I have a vps in servint with cpvlab. I did a test to see how much traffic would I lose if I use it for mobile. It ended with a loss of 40%.
So I decided to direct link and run some campaigns. But this isn´t working either. Something big is missing.
Say you want to change the link, or add a variable, or even rotate offers. You cannot. You have to build the campaigns again and wait for approvals.
It sucks...
So I´m looking for the fastest solution to redirect without losing any (or the least possible) traffic.
My questions:
- Can I and would it help to host a php file in amazon to handle the redirects?
- Can any php coder here provide the fastest php redirect script?
- This one is for Alex: any update/solution on this issue?
Thanks everyone in advance.
<?php
header('Location: http://www.example.com/');
?>
^^^^^^^^^^^^^ this
Thanks smaxor, thats a start. Now how do you:
- pass a subid to the redirect
- redirect by country
- rotate urls by country
http://redirectdomain.com/index.php?subid1=A&subid2=B&subid3=C&subid4=D
<?php
$subid1 = $_GET['subid1'];
$subid2 = $_GET['subid2'];
$subid3 = $_GET['subid3'];
$subid4 = $_GET['subid4'];
$country = getenv(GEOIP_COUNTRY_NAME);
$country_code = getenv(GEOIP_COUNTRY_CODE);
switch($country_code) {
case 'DE':
$redirect[0] = 'http://someaffurl.com&s1=".$subid1."&s2=".$subid2."&s3=".$subid3."&s4=".$subid4;
$redirect[1] = 'http://anotheraffurl.com&s1=".$subid1."&s2=".$subid2."&s3=".$subid3."&s4=".$subid4;
$number = mt_rand(0,1);
header("Location:$redirect[$number]");
exit;
case 'US':
header("Location: http://someaffurl.com&s1=".$subid1."&s2=".$subid2."&s3=".$subid3."&s4=".$subid4);
exit;
case 'CA':
header("Location: http://someaffurl.com&s1=".$subid1."&s2=".$subid2."&s3=".$subid3."&s4=".$subid4);
exit;
default: // exceptions i.e. unlisted countries
header('Location: http://offerpage.com');
exit;
}
?>
Awesome Dave, thanks. I´m trying this now.
It works like magic.
Sweet! I like to test with all countries using Overplay to make sure it's working well. Ctrl+shift+K in Firefox for web console = can see the redirects, magic.
Also, if you are getting stuff approved (e.g. on Facebook) I recommend putting // at the start of every line from
switch($country_code) {
down to
}
except for header('Location: http://offerpage.com');
That way you comment everything turning it into a simple redirect to the offer page, avoiding approvers being redirected poorly, and firing off impressions on your network and screwing up your EPC readouts for the day. Then uncomment afterward and ready to go!
throw apache into the dustbin, use nginx
@ hd2010 thanks for your comment, I´ve been reading about nginx, didn´t know about it. It seems that you can install it in your apache VPS. I will talk to servint about it.
Dave, I use HMA and the "live http headers" firefox addon. Was thinking to use a simple redirect first and then replace it with this one.
A question: Is there a way, by adding some code, to check how much traffic I´m losing by using that redirector?
--
The final part would be to integrate and redirect by carriers, IOS and mobile devices (as some offers require so), but that´s a little more complex.
Do you mean how many clicks are bouncing to the exclusion URL rather than through to your affiliate URLs? Or how many people are bouncing off due to possible long redirect times (which shouldn't happen)? There should be very little difference cf. direct linking, the php redirect is server side and happens very quickly.
Coding user/traffic tracking like that is way beyond my coding knowledge, but for looking at raw click loss I just look at clicks from my traffic source vs clicks registered at the network. If there is a big discrepancy I just ask my AM - most of the time with my FB campaigns when I'm running volume I get about 80-90% of my clicks registering on the network side due to duplicates and out-of-geo clicks, seems to be pretty much the norm, unfortunately.
I meant the second. The first I can know by adding a dif. subid to the exclusion url. The second is more difficult as the network always shows less clicks. But it´s ok.
I´ve installed nginx and it seems that the speed improved a bit. I´ll try to run a load test to see how well is performing.
made a few mods cause i want to use it as a redirect for level 1 landing page sequence in cpvlab.
so:
http://yourdomain.com/redirectpage.php
<?php
header('Location: http://yourdomain.com/base2.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="refresh" content="0;url=http://yourdomain.com/base2.php"> </head> <body> </body> </html>
Yes, you're correct. The header redirect needs to be before any HTML, and no HTML is necessary. Literally all you need in the .php file is...
[php]<?php
header('Location: http://www.yoururl.com/');
?>[/php]
A header redirect will also be faster than any client side redirect, like a meta refresh, or javascript redirect.
I've been trying to do this with
but I'm getting error, what should I put in the redirect php? because
<?php
header('Location: http://XXXX.voluumtrk2.com/click');
?>
doesn't work
I'm not sure technically how it will stack up performance wise.... but cloudflare has this functionality in their page rules

thnak you for your response, but in this case will forward the click information? being that the click info is passed via cookie?
I wanted to add a layer of "security" between me and the offer. You suggest that the 302 double meta refresh is enough?
@TheComedian - double meta refresh (DMR) is for specifically this purpose, and most affiliates, including the very technical ones, generally consider it enough. It's easy enough to test - set up a test campaign with DMR, run through it with a bunch of different browsers, and see if it successfully cloaks the referrer.
oh, perfect then, I was in doubt that it might not be enough as I saw some landers that have this base.php or redirect.php file, and I thought I might need it.
but if DMR from
thank you all for your help
Yes I would strongly suggest not adding another layer unless its mission critical, in which case I would have a cloaking platform inbetween rather than a manual redirect file.
Hey caurmen, Zeno, and others who might be able to help. Going along with the previous few posts and cloaking, I'm wondering how does HTTPS play into things if using a double meta refresh (DMR)?
I'm not too sure what the DMR is or how this is performed, but initially I was thinking an HTTPS domain was needed for cloaking so I'm wondering if HTTPS is still needed with a DMR or if HTTPS is unnecessary with DMR? Hope that makes sense.
If you're going from an HTTPS (you) to an HTTP (affiliate network) connection then the referrer shouldn't be passed. There are some reports of referrers "leaking", but they're rare and unsubstantiated. You might still want to use a DMR in that case if you're super-paranoid, but it's probably not worth it.
If you're going HTTPS to HTTPS, though, the referrer will be passed at least some of the time - it should technically be all of the time but browsers don't necessarily obey standards. So if your aff network's link is https and your tracker's also https, you'll need a DMR or equivalent.
Sorry for the delay in response and thanks for the information Caurmen. I currently have my CDN on amazon web services and don't have an HTTPS setup yet. To perform a DMR, this uses php script right which won't work with cloudfront? Does that mean I should go ahead and change my CDN to perhaps rackspace and/or get an HTTPS domain?
Thanks,
Ferg