As you probably already know old Facebook cloaking method not always work. They start testing new method without the traditional intern referral URL. So I’ve created clocking script + service to track reviewer’s IP addresses and share between users.
How it works:
You install script on your server, configure it and when Facebook intern come to review your ad from the traditional referral URL, script will send IP address, referral URL and user agent to tracking server. We will provide a daily updates of IP text file with fresh IP addresses. So your script always be up to date. More users use this script/service the more IP we will collect.
Installation and Configuration
1. Download Facebook Cloaking Script with Daily Updated IP Database.
2. Unpack the files to any folder on your web server. Make sure this line is in your php.ini file: allow_url_fopen = On
3. Edit the configuration file fbcloaking-config.php. You will see 2 PHP arrays $offers and $cloaked. $offers array for your non-cloaked URLs and $cloaked for cloaked links:). For same offer you have to use identical array keys in both arrays.
Example:
$offers = array( 'offer-id1' => "http://trk.com/dl.php?t202id=123&t202kw=" . $_GET['ad'], 'offer-id2' => "http://trk.com/dl.php?t202id=456&t202kw=" . $_GET['ad'], 'offer-id3' => "http://anotheroffer.com/", ); $cloaked = array( 'offer-id1' => 'http://apps.facebook.com/visabusiness/', 'offer-id2' => 'http://www.disney.com/', 'offer-id3' => 'http://affiliateplex.com/', );
As you can see you can pass through any query string parameters further to your tracking software.
Here is example how to configure cloaking script with prosper202/tracking202:
The best way to split testing your ads with prosper202/tracking202 and Facebook is using single destination URL and t202kw parameter.
For example you have created few ads with following URLs pointing to your cloaking script:
http://yourdomain.com/redirect.php?oid=offer1&ad=ad1
http://yourdomain.com/redirect.php?oid=offer1&ad=ad2
http://yourdomain.com/redirect.php?oid=offer2&ad=ad1
http://yourdomain.com/redirect.php?oid=offer3&ad=ad1
Then your configuration file should look something like this:
$offers = array( 'offer1' => "http://trk.com/dl.php?t202id=123&t202kw=" . $_GET['ad'], 'offer2' => "http://trk.com/dl.php?t202id=456&t202kw=" . $_GET['ad'], 'offer3' => "http://trk.com/dl.php?t202id=789&t202kw=" . $_GET['ad'], ); $cloaked = array( 'offer1' => 'http://apps.facebook.com/visabusiness/', 'offer2' => 'http://www.disney.com/', 'offer3' => 'http://affiliateplex.com/', );
If you don’t use tracking software you can just put offer or landing page URL into $offers array.
4. Daily update IP text file fbcloaking.txt from here.
Tags: cloaking, Facebook
wow two thumbs up…. thanks for the script.. any better way to improve it ??
How can I improve it? Any suggestion?
This is great. Keep the IPs coming!
Thanks for the script!
Thanks for this helpful script!
[...] 2) Facebook Cloaking Script with Daily Updated IP Database – A cloaking script that sends the interns that approve your ad to a “safe” landing page. This is only useful if you are promoting something that likely wouldn’t be passed based on your LP. [...]
nice script. you can just use a redirect too once the ad gets approved..but this is better if your submitting a lot of ads.
i wrote up a script yesterday that redirects repeat visitors who both did and did not convert. check it out:
http://internetbusinessdaily.net/how-to-deal-with-repeat-visitors-who-didnt-convert/
let me know if this is useful to others…i find it very useful. since i change my ads so often i get repeat clicks all the time and they either signed up already and wont again or didnt sign up and wont.
I’m trying to toggle my allow_url_fopen, but my hosting company will not do it globally or at all(poor programming,security issues they say). My current php settings has allow_url_fopen = off based on phpinfo(). I tried toggling it with .htaccess file but I’m not sure if that is targeting the PHP.INI file. Please help as I would like to beat those interns. Thank you!
is there a way to do this with the cURL module?
awesome script…can’t wait to try it out. I’m new to FB advertising, but just got back from ASW and learned that a good number of people are making their income solely from FB. And for the fact that you use it with Prosper202 makes it even more awesome!
[...] Facebook Cloaking Script – Here is a pretty cool script that will collect IPs of the first IP to review your ad, and then redirect that IP each time to a different offer other than what you are promoting. This is good if you are trying to get ads up that might be determined as sketchy according to Facebook’s ad policies. It loads the data to a central database so there is already a ton of IPs collected. [...]
is this still being updated?
Ops, switched to new server and forgot to add cron job.
Now IPs list will update daily.
Enjoy
Do we have permission to modify the script for our own needs?
Thanks
>Do we have permission to modify the script for our own needs?
Yes you have
I still can’t get that to work, my redirect file is
http://pastebin.com/m539bca89
I modified it a little to run on PHP 4.3.3
and my fbcloaking-config.php file is
http://pastebin.com/m3fe78bea
Can you tell me where I am wrong. And keep up the good work!!
What exactly is not working, check your error_logs and give me more info.
Your final URL should look like /redirect.php?oid=offer1
nice i missed the ?oid=offer1 part, great script!! i hope interns won’t see my ad
Thanks for the script – this is really useful. Pity the blog owner seems to have stopped posting. There’s some good info here.
Hey,
I troubleshooted my non working script and it seems that the url: http://fb.affiliateplex.com/track? doesnot seem to return anything back. As a result the script is not working for me. Any ideas why it’s happenning?
Hey,
It’s normal behavior, /track don’t have to return anything. Read installation instructions and check your configuration.
[...] Also, if you haven’t heard, Facebook now has ad reviews being done from Irish and UK IPs. This means if you are direct linking and that link has a redirect script for IPs outside of the offers accepted traffic range, they will be redirected to something else. This is why so many ads are getting disapproved for direct linkers. With my script, this is fixed. Here is a basic script you can install and use on your server. [...]
Very nice script, i will definately give it a try as I haven’t had much success with facebook before… thank you
Great script and service, thanks for this.
One optimization suggestion for redirect.php: group all the if (preg_match…) statements together into one if(), with || (ORs) so that if the first ‘if’ (or second, third, etc.) matches, the others are not executed (known as ’short circuiting’, if any OR matches, the entire statement is immediately TRUE, or if any AND does not match, the entire statement is FALSE).
if((preg_match(’/dev\.facebook/’ , $_SERVER['HTTP_REFERER'])) ||
(preg_match(’/dev[^\.]+\.facebook/’ , $_SERVER['HTTP_REFERER'])) ||
(preg_match(’/intern\.facebook/’ , $_SERVER['HTTP_REFERER'])) ||
(preg_match(’/\.cs\.facebook/’ , $_SERVER['HTTP_REFERER'])) ||
(stristr($_SERVER['HTTP_REFERER'], ‘/intern/ads/review.php’)))
{
$cloak = TRUE;
}
I’m assuming the PHP interpreter does short circuiting, like a C compiler will.
Emile thank you for your contribution
[...] Facebook doesn’t like the landing page of Fling. It is too “adult”. Get yourself this cloaking sytem at AffiliatePlex if you don’t already have it. I use my own custom cloaking built into my tracking system [...]
Is any one checking authenticity of the IP’s listed the fbcloaking.txt file? A good percentage of those are just dynamic DSL connections based in Australia & NZ.
Good script to cloak the Facebook. But can anybody tell me what is the impostance of collectin ip address? How it can help a webmaster?
[...] doesn’t really like the Fling landing page, so he recommends cloaking it, which you can use AffiliatePlex if you don’t have your own cloaking already. You will want to say in your ad some other [...]
I tried the script and it didn’t work for me. Ads were consistently denied until I hard coded the link to more innocent site.
[...] to the strange and mysterious ad review process, most affiliates are cloaking their ads. The Facebook cloaking script at AffiliatePlex.com comes highly recommended. Cloaking basically means that when the Facebook reviewer checks your ad, [...]
Is this script still working? I hope FB people in Ireland will see then something different then my offer page and I hope the FB peolple in the US see something different when I’m promoting international offers as they don’t approve my ads unless they see a decent page.
Yes, it’s still working.
Hi,
Just a quick observation. I was testing the cloaking script and something I noticed was that it somehow added my own ip to the master IP database. I would think that it only adds ips from facebook referrers. Is their a possible issue where it randomly adds ips to the database that dont really belong to facebook approvals.
I did however test it on my VPN connection and it to worked fine without issues.
Hey, I don’t understand for the P202 version, what we put in the offer array and what we put on the cloacked array. I’m a little bit confused. Thanks to clarify.
Is this still a viable way to cloak from the facebook approval team?
Yes, it is!
I’m confused and have a few questions. I’m would like to use a lp and not direct linking soooo………
Does your fb ad destination url point to your landing page or the script?
In $offers array, do you put the url of your lp or the offer your landing page leads to?
In the $cloaked array, do you put a clean offer(like a facebook app) or a clean lp leading to a clean offer?
I am confused as to whether your showing them the reviewer the same lp and then a different offer or just a different lp and offer all together.
I hope this makes sense…
Hey, using a VPS with directadmin – anyone know how to set up the cron to update that file each day?
http://fb.affiliateplex.com/fbcloaking.txt seems to be down?
Yeah, server problem. Will fix it soon.
It’s back up, thanks.
Script still working ?????
Yeah, it’s working.
So, i’m just starting out with this (shifting over from subids to trying to configure p202).and tryin to get a few facebook campaigns going..should I begin by setting up my fb ads in p202 then cloak the p202 links? Or is this something I kind of need to do all at the same time? Excuse me for my lack of technical knowledge
Hey,
Good script, but how can I use this to track my subids with FB Ad manager and the networks?
When I got the files configured and uploaded, does the database update itself or do I have to do that manually?
If it does update automatically, how often does it do that?
PS. Can’t thank you enough.
You have to update text file manually (or automatically via cron).
Enjoy
is FB cloaking legal? could they not sue you for creating a tool to fraud them?
It’s against their TOS but of course it’s legal
And it’s made not to fraud them. Have you tried to use their ad system, their approval process is random. One they they can approve absolutely legit ad, next disapprove it, etc. Google: “facebook ad approval experience”