Tracking and Cloaking using PHP

Hi All,
II have been implementing PHP for tracking (using Appendix A in HPAM) and for cloaking (using info from Jeremy’s video) and would greatly appreciate it if anyone can answer the following two questions for me:
1). When I view my landing page and hover over a link, it gives this URL:
http://www.mywebsite.com/redirectpage.php?sid=
Am I supposed to be seeing the ?sid= at the end?
2). I’ve read that Google penalise landing page quality if they find affiliate links that open directly from that landing page. As I am using re-direct pages for my affiliate links, I am presuming that this will safeguard me from being penalised as my affiliate links open from my redirect page, not from my landing page. Is this right? I have read on the forum about blocking bots from crawling webpages - is this necessary to stop landing page quality being affected, or is the re-direct method enough?
Many thanks in advance for anyone that can answer either of these for me. :)
Rachael

Hi Rachel,
Your landing page link should look something like this:
http://www.yoursite.com/go.php?link=1
You would then create a PHP redirect script that would look something like this:
<?php header("Location:http://www.myaffiliatelink.com/?sid=value"); ?>You can't hide anything from Google. They can simply follow the cloaked link and examine the HTTP headers.
Link cloaking is mainly for hiding ugly affiliate URLs from site visitors and competitors.
Best,
Jeremy
Hi Jeremy
Thanks a million for the reply :) . I so wish that I could say that I am clear on it all now, but after trying to piece everything together (and going over past posts on the forum to try and shed some light) I'm even more confused. :?
I now have the correct URL showing when I hover over my link, but this link is no longer re-directing (just comes back with a blank page). The term "link1" has confused me as there is no reference to "link1" on the redirect page. I found an old post from you regarding having more than one link on a php re-direct page, which uses the term "link1" - I tried out this code but with the same outcome as above.
I'm obviously going wrong somewhere, and would REALLY appreciate it if you, or anyone else who reads this, can help me out. This is what I have done:
1). Using the URL that you gave:
http://www.yoursite.com/go.php?link=1
I replaced the "1" with something more significant, so that my link URL reads, for example:
http://www.yoursite.com/go.php?link=datingsiteA
And on my php redirect page, I have replaced the "link1" with "datingsiteA" as follows (I can't seem to add the php open and close symbols to the code tab below, so have just put the bulk of the code):
case "datingsiteA": header("Location:http://www.anrdoezrs.net/click-1234567-10378999"); break; case "datingsiteB": header("Location:http://www.kqzyfj.com/click-1234567-10387033"); break; case "datingsiteC": header("Location:http://www.jdoqocy.com/click-1234567-10278209"); break;This is not working for me, so I am going wrong somewhere, but am totally blind as to where!
I'm still not clear where the "sid" bit goes amongst all of this either, but first things first!
I think it would be invaluable for members like me who are stuck on this issue if a more "techie" minded person could put together a post which sets out the following:
1). The code that can be used on a php redirect page for when using more than one link
2). The exact URL for one of the links that goes to this php redirect page
3). The tracking code (the "sid" bit) that needs to go into both of the above to allow tracking via redirect pages.
I realise that most of this stuff is covered in Appendix A and Jeremy's video, but how to combine all this info together is the tricky bit.
Okay, just my two pennies worth! Many thanks in advance to anyone who can clear this up for me, or point me in the right direction to find the info I need. :D
Rachael
Rachael,
This should solve your problem.
First of all, I am not sure how you are tracking your SID value from your PPC campaigns so I am going to assume that you are using cookies. If not I am going to show you how to do it.
Step 1:
Your landing page url for your PPC campaigns should look something like this:
www.yoursite.com/landingpage.php?sid=trackingvariable
Step 2:
On your landing page you need to set the cookie which stores your sid tracking variable. This is done by placing the following code above all of the the html code on your landing page:
if (isset($_GET['sid'])) {
$sid=$_GET['sid'];
setcookie("sid", $sid, time()+31536000,"/","www.yoursite.com");
}
?>
Step 3
Now you should create your php redirect page. I am assuming that one of your redirect links looks like the following:
http://www.yoursite.com/go.php?link=datingsiteA
Create a blank php page and call it go.php and add the following code:
$link=$_GET['link'];
if ($link == "") {$location = "Location: http://www.yoursite.com";}
if ($link == "datingsiteA") {$location = "Location: http://www.anrdoezrs.net/click-1234567-10378999";}
if ($link == "datingsiteB") {$location = "Location: http://www.kqzyfj.com/click-1234567-10387033";}
if ($link == "datingsiteC") {$location = "Location: http://www.jdoqocy.com/click-1234567-10278209";}
if(isset($_COOKIE['sid])) {
$location = $location . "?sid=" . $_COOKIE['sid'];
}
header($location);
exit();
?>
Step 4:
Change the links on you landing page to reflect the new redirect links, so your three re-direct links would look like this:
http://www.yoursite.com/go.php?link=datingsiteA
http://www.yoursite.com/go.php?link=datingsiteB
http://www.yoursite.com/go.php?link=datingsiteC
Hope this help.
Jeff
Try something like this:
I've created a php file called filename.php. This file can be used for multiple links, just create a separate case statement for each product link that you want to use. If none of the cases are matched then the default will be used (typically just take them to the home page of the merchant). I also pass the keyword for tracking which you can see at the "sid=" portion of the code.
<?php //Determine which affiliate link was clicked switch($_REQUEST['w']) { case 'storelink': $link="http://www.dpbolvw.net/jh777zw41w3JMLRKPSNJLKOOWXYZ?sid=".$_GET['keyword']; break; default: $link = "http://www.dpbolvw.net/jh777zw41w3JMLRKPSNJLKOOWXYZ?sid=default"; } header("Location: $link"); // Jump to the hiddden affiliate URL above exit(); ?>Then on your landing pages your links would look like this:
Hope this helps.
hey there,
Im not sure i got this part.
if i do that, do i still need to give the "sid" a random value on CJ?
if so, then where exactly do i place them if i got the sid=".$_GET['keyword'];
another thing, it might sound silly but i cant see the benefit of using such code for my inner store links (not the landing pages)
To Jeff and Rayd8
Thank you so so much for taking the time to reply to my post. I can't tell you how frustrated I have got trying to solve the problem myself! This is invaluable info for me and I really appreciate it. :D
Rachael
Hello...
I noticed in the code for creditrepairguide.org that Jeremy puts the following code near the top in < > (had to take brackets out or it wouldn't show in this post):
?php include ('header.php');?
Adding this code wasn't mentioned in the link cloaking video.
Should this code be added when cloaking affiliate links? And are there are any other instances when this code should be added to a web page?
Thank you!
it's just an include which produces the header image. it doesn't have anything to do with link cloaking.
could someone send me a link or the video itself of jeremy's PHP link cloaking video?
I have tried downloading the file many times to both my PC as well as my Mac but I get only the sound without the image.
thanks in advance
nimpact@gmail.com
Jonathan
Jonathan, the video is here: http://video.google.com/videoplay?docid=-7352837742173741830&hl=en
Moe
What is the difference/advantage to using all that code shown above versus just using this code on an HTML redirect page?
meta http-equiv="refresh" content="0;URL=http://www.dpbolvw.net/jh777zw41w3JMLRKPSNJLKOOWXYZ?sid=default"