I previously showed how to do link cloaking using PHP.
I’ve been modifying it to help me tune my campaigns a little better, so I thought I’d share the latest version.
This is the PHP file that you’d call for your jumps…
<?php // Edit this key for the secret part of your keyword encryption $encryptkey = '123'; // Edit this array for your offer jumplinks $path = array( 'azoogle' => 'http://x.azjmp.com/XXXXX?sub=', 'copeac' => 'http://www.cpaclicks.com/redirect.asp?a=xxxx&b=xxxxx&d=0&l=0&p=0&o=', ); // Use the 'key' variable (set at the destination URL of your ad) so you know which ad-network or ad-group the user is coming from $key = htmlspecialchars($_GET['key']); $ovkey = htmlspecialchars($_GET['OVKEY']); $ovraw = htmlspecialchars($_GET['OVRAW']); $mdkey = md5($encryptkey . $ovkey); $filename = './logs/' . $key . '.txt'; $content = 'JUMP, ' . $_SERVER["REMOTE_ADDR"] . ', ' . date(”h:iA”) . ', ' . date(”Y-m-d”) . ', ' . $mdkey . ', ' . $ovkey . ', ' . $ovraw; $handle = fopen($filename, 'a'); fwrite($handle, “$content\r\n”); fclose($handle); if (array_key_exists($_GET['id'],$path)) header('Location:'.$path[$_GET['id']].$key.'-'.$mdkey); ?>
The code is rather complex, so I’d recommend you learn PHP if you want to modify it to your liking. But as it is, the code works fine if you just want to cut-and-paste it onto your site (you’ll of course need to replace the jumplinks with your affiliate links ).
To summarize what this code does:
The log file will end up with a line like this: JUMP, 70.170.13.79, 04:42PM, 2007-07-20, 202cb962ac59075b964b07152d234b70, test-ovkey, test-ovraw
Some simple analysis you can run on the logs:
NOTE: in the code, modify $encryptkey to your own secret password. The MD5 hash is calculated using the $encryptkey pre-pended to your keyword (so in the example above, the MD5 is calculated against “123test-ovkey”). This is just another layer of secrecy for you to sleep better at night
What would be the purpose of encrypting the ovkey?
Just trying to figure that bit out.
Thanks, Jonathan
You can’t really tell which keyword actually converts, unless you look at the SubID from the affiliate company’s stats. You’ll need some kind of unique identifier. A traditional method is to just send the keyword as a SubID, but people might not want to tell their affiliate company which keywords convert best.
So the simplest way to achieve this correlation between keyword and conversion, is to substitute a unique identifier. Thus, the MD5 hash, creates a unique identifier, based off the keyword, without actually revealing the keyword. Thus, you’ve got the keyword/conversion correlation, while maintaining secrecy of your keyword list.
Note, knowing the correlations is also useful in identifying keywords that click-through to the offer page, but never convert (thus wasted PPC costs).
[...] Keyword Analysis for Affiliate MarketersWhy isn’t my keyword isn’t getting any impressions?Yahoo Search Marketing techniqueLink CloakingBroad Match problems with Google Adwords [...]
Good tips here. Better improve my PHP noob skills : ) Thanks.