Good link cloaking or "go" script?

envision

New member
Jun 5, 2008
210
6
0
I run my affiliate links through Tracking202 and I'd like to change them from
Code:
http://www.[trackingdomain].com/tracking202/redirect/dl.php?t202id=12345
to something like
Code:
http://www.[currentdomain].com/go/GreatProduct

I currently work with Wordpress, so it could be a WP plugin, but it also needs to work on pages on the same domain, but outside of WP. A standalone solution would work too.

202 should still work properly with it, i.e. allow me to track a conversion through my pages all the way back to the ad that brought the traffic.

Maybe it could also keep log of how often the links are clicked and from where, but I think 202 does the heavy lifting with tracking, so it's not THAT important.

What would be a good choice for such a script?

Bonus: Are there any concerns with the multiple redirects, time issues etc? And how do search engines look at those?
 


Check my signature, got version 1 coming out very soon thats pretty much a big overhaul. (ie: works just bout anywhere not restricted to just WP). The 'goto.php' file can be renamed to just bout anything, and I could even assist with .htaccess so it could even be something like Register a Domain, Find Hosting and Create a Website | Domain.com

Most of the customers that have purchased KbLinker generally like it because its an easy solution for geo-targeting as well as being able to change the target url based on IP or referrer of the visitor. (if you want to see a preview of v1.0 let me know).
 
Well, I found several similar solutions - some free, some paid - and was hoping someone has experience with one or the other and what the differences are:

Free

Paid

I wouldn't mind paying if I get value that none of the free versions provide. Opinions?

Also, when I looked into these, many claim they prevent commission theft. Other than a user manually stripping out the aff ID from an uncloaked link, is there more to that?
 
You can do it with .htaccess and a regex routine, but if you know how to do that you wouldn't be asking this question.

When in doubt hire a pro and Kblinker & Refrozen's apps have a good rep. I'd buy one of their plugins and be done with it. Much cheaper than the time its going to take you to do it right and break your site a few times while learning.
 
You can do it with .htaccess and a regex routine, but if you know how to do that you wouldn't be asking this question.

When in doubt hire a pro and Kblinker & Refrozen's apps have a good rep. I'd buy one of their plugins and be done with it. Much cheaper than the time its going to take you to do it right and break your site a few times while learning.

Kblinker isn't a plugin but rather a standalone script, but I will a WP plugin made to work with a copy of kblinker for easier insertion.
 
Man in all likelihood you do not need any of this shit. You can do it in a simple script that's so simple I'm typing it into the quickbox here.

Code:
<?php

if(empty($_GET['o']) || !is_numeric($_GET['o']))
   die;

$urls = array();
$urls[0] = 'http://www.yourtrackingdomain.com/offer1.php';
$urls[1] = 'http://www.yourtrackingdomain.com/offer2.php';
// $urls[n] = 'url';

header('Location: ' . $urls[$_GET['o']]);

echo '<meta http-equiv="refresh" content="0url=' . $urls[$_GET['o']] . ';" />';
echo '<script type="text/javascript"><!-- window.location = "' . $urls['$_GET['o']] . ' //--></script>';
echo '<a href="' . $urls[$_GET['o']] . '">Click here if you are not redirected.</a>';

?>

Now if you want to go to your first URL, just link to <thatscript>.php?o=0. This won't do any fancy shit but it isn't hard to modify, and it at least looks like a link on your own site. It probably won't hide the referrer (aka your landing page) from the affiliate network...if you want to do that just get one of these guys' scripts.
 
He wants pretty URLs though. And you need a semicolon after the 0 in content for the meta tag if you do choose to use the script chatmasta posted.

echo '<meta http-equiv="refresh" content="0;url=' . $urls[$_GET['o']] . ';" />';
 
Ya sorry missed that, as I said I put it in the quick post box haha...

If you want pretty urls just change

Code:
$urls[0] = 'http://www.yourtrackingdomain.com/offer1.php';

to

Code:
$urls['offer1'] = 'http://www.yourtrackingdomain.com/offer1.php';

Then link to <thisscript>.php?o=offer1
 
That's not a pretty URL! That URL is ugly, chatmasta. UGLY.


My script generates URLs like yoursite/offer1 - and I believe Karl's script generates URLs like yoursite/go/offer1 or something. Both are prettier than yoursite/thisscript.php?o=offer1.

...not that pretty URLs have much value. I don't think they increase conversion rate or anything, they're just fun to look at.

Edit: to use chatmasta's pretty URLs hack there, you'll need to remove the !is_numeric line too.
 
That's not a pretty URL! That URL is ugly, chatmasta. UGLY.


My script generates URLs like yoursite/offer1 - and I believe Karl's script generates URLs like yoursite/go/offer1 or something. Both are prettier than yoursite/thisscript.php?o=offer1.

...not that pretty URLs have much value. I don't think they increase conversion rate or anything, they're just fun to look at.

Edit: to use chatmasta's pretty URLs hack there, you'll need to remove the !is_numeric line too.

Mine by default expects you to use a script called goto.php and a id=name parameter, which could be renamed to index.php if you wanted to do anyfolder/?id=code , but I offer htaccess assistance so that the url could be domain/~code/ or domain/go/code/ or code.domain.com (if wildcard dns support is enabled).

But the nice thing bout kblinker if you have the manager installed on domain1, you can install the redirection script on any other domain as long as it can 'talk' to the database at domain1 , meaning you can have 20 different domains have the same redirection (and in different styles too), due to all seeing the same database of link configurations. As opposed to having to install a plugin, or recreate link settings at every domain you wish to use links or link groups at.

Though KBLinker is intended for people who need to do more than just redirect to a single link in a number of fashions (301, meta, stealth, framed, etc), rather allows you to change the destination url automatically based on geo targeting, ip, or referer as well as auto attach subid (as of v1.0).

If he's only dealing with say 1 to 5 links or mainly just a single domain, then chatmasta's method, combined with mod_rewrite in an htaccess file would be the [free] way to go. Besides the rewrite rule for /go/ could be quite simple

Code:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /

RewriteRule ^go/(.*)/ /redirect.php?id=$1 [L]

(it can be slightly trickier if you're trying to modify the htaccess file in a wordpress installation that has permalinks turned on)
 
Guys, i was searching for exact script today, and finally end up with Shorty set this up on a sub-domain page and now everything looks great.

Its works exactly like tinyurl but can be hosted on your own server + redirects using 302 (mysql database) and its all free...
 
Here is my easy way -
Domain: abc123,com

You want the user to click on your link and go to abc123,com/products/product25

I create a folder in the root called "products"
I create a folder in products called "product25"
I upload an index file with a simple meta-refresh to the product landing page in the "product25" folder (what chatmasta and refrozen were talking about)

Now you have a nice link that displays as abc123,com/products/product25

This is not the way to go if you have a lot of "products" you want to do this with.
 
The advantages to using either my script or Karl's have been covered quite well here, but I just wanted to add one more thing. Both our scripts should make it quite easy to say, change a link to a different destination if your affiliate were to disappear. If you were to get in a fight with your network or otherwise, it'd literally be just a few seconds of work and no touching code to get the links updated. No chance to break things while they're live, but you can still manage them without issue.

Just a thought. For your needs, Lauren's solution is probably perfect.