[FREE] Fake Referrer Script, tested in Chrome, Firefox and IE.

Status
Not open for further replies.

MarketerX

Regular Member
Joined
Mar 7, 2010
Messages
404
Reaction score
125
Hey everyone, I used too use CPA Redirector 2 a few years ago, but the author of that plugin closed his site down, so I decided to write a quick, simple script to fake the HTTP referrer. I will also explain how to use it.

Let's say you have an offer on a CPA network where Facebook traffic is not allowed, but you want too promote that offer on Facebook. Obviously your network wouldn't be OK with that, because they check the HTTP referrer for any requests too your affiliate link. So, what you want to do is fake the referrer, and make sure one is sent to your affiliate link that is not from facebook.com

The trick to doing this is to place this code ABOVE THE <HTML> TAG on a "white hat" page promoting the offer you are spamming, make sure this page is following your CPA networks rules for that offer, such as no use of the word "Free".

Code:
<?php

    $secret = "secretpassword";
    $afflink = "http://afflinkhere.com/";


    if ($_GET["token"] == $secret) {
        $url = strtok($_SERVER["REQUEST_URI"],'?');
        setcookie("var", $secret, time()+3600);  /* expire in 1 hour */
        echo "<script>window.location.href = \"" . $url . "\"</script>";
    }


    if (isset($_COOKIE["var"]) && $_COOKIE["var"] == $secret) {
        setcookie("var", "", time()-3600);  /* unset cookie */
        echo "<script>window.location.href = \"" . $afflink . "\"</script>";
    }


?>

Let's assume that your white hat url where you placed this code is http://whitehat.com/some-landing-page.php

Now the link you would want to spam on facebook (after using a URL shortener) would be http://whitehat.com/some-landing-page.php?token=secretpassword

The beauty of this is, if you do not add ?token=secretpassword too the URL, some-landing-page.php will show it's normal, white hat content. And when your affiliate manager checks your traffic logs and referrers, they will see http://whitehat.com/some-landing-page.php, without the secret token. Also the code I posted above will not appear if they view the source of your page, since it is written in PHP, only someone with access too your server or knows the secret password will know it's there.

I know this is a super-simple form of faking the referrer, but it works in the latest version of all major browsers. Make sure you change the hardcoded secret password and affiliate link, and place the code ABOVE THE <HTML> TAG on the page you want your affiliate manager too think your traffic is coming from.
 
Last edited:
Updated code too properly remove secret cookie before the redirect to your affiliate link occurs.
 
Last edited:
Glad someone appreciates this, using this, you can do all kinds of nifty tricks, like content locking, incents when they aren't allowed, iframed email submits (just mix in some legit traffic too keep your EPC under the radar.) Personally I am using this too spam blogs with Scrapebox and not get banned for my traffic source ;)

When my AM asks about my traffic I just tell them I am running a AdWords or Facebook PPC campaign too my whitehat site, the one they will see in their referral logs.
 
Last edited:
Yes, you can. Just put your peerfly offer link in the script, and make sure the page you put the code on is totally whitehat and follows that particular offers rules, some peerfly offers you cant use the word "free" on your landing page, for example. If you want too do a free iphone email submit, make sure the page you put the code I posted on has a peerfly banner or link too that particular offer.
 
Totally brilliant share there. Nice one. This really does have value and multiple uses.

Thanks,

Shez
 
Simple and effective. Thanks!!

Just the way it should be :) I'm thinking about making a WP plugin and also giving it away for free, I'm sure alot of people use WP on their white hat sites but might not know how to use this code with WP. Actually, you can right now, just go into your admin panel, then Appearance -> Editor, click Header.php and add this too the very top of that file and update. Then you can access any blog post, by adding ?token=secretpasswordhere to the end of your blog posts URL, and your AM will think your traffic is coming from whatever blog post you added ?token=secretpasshere too. So remember, when you spam, use a link like yourwhitehatblog.com/some-wp-blog-post.php?token=secretpasswordhere (also, remember to use a URL shortener when spamming, too keep automated spam filters from recognizing it), your AM will never know what site(s) your traffic came from if you do this. Will update this maybe today too work with multiple rotating offers, since it is only hardcoded for one right now.

If anyone has any questions or feature requests, post em here.
 
Last edited:
Interesting, so it blanks the referrer? Blanking obviously hides your traffic source, but also raises a red flag too your AM. However, if you traffic is converting for their advertisers, they are less likely too really care that your referrer is blanked. Faking is much better imo, because usually they expect too see a referrer in their logs.

If you want the ultimate referrer leak protection, blank then fake :)
 
OP this is very powerful thing, I like it very much, thanks. Do you think that big G can sense this type of deception? Did you manage to observe the effect on G analytics?
 
Does anyone manage to work this with mobile? only working on desktop here...Also if I use firefox in private mode it doesnt work
 
This doesn't work for mobile traffic, i keep seeing my FB refers, anyone knows a refer faker for mobile traffic :)
 
Status
Not open for further replies.
Back
Top