Blog / Archive
How to Cloak Affiliate Links on Facebook with PeerClick?
Link cloaking is a technique that shows Facebook's moderators and bots a compliant white page, while real users are redirected to the actual affiliate offer. Cloaking affiliate links on Facebook relies on the PeerClick tracker with a JavaScript pixel, a connected MyLead offer, and traffic filters that separate reviewers from genuine visitors. It is the fastest method to pass ad moderation.
This guide walks through the full PeerClick cloaking setup with a JavaScript pixel — from connecting your MyLead offer to launching the campaign on Facebook. Every step below is practical, not theory.
What you'll learn from this article:
how link cloaking passes Facebook's automated ad moderation,
how to connect a MyLead offer and its postback inside PeerClick,
how to configure the Website Protection tool and traffic filters,
how to generate the JS pixel and test the white-page / black-page split.
How does link cloaking on Facebook work?
Cloaking splits your traffic into two streams: Facebook's review bots and human moderators see a neutral white page, while real users from your ads land on the black page with the MyLead offer. The PeerClick tracker decides who sees what based on device, referrer, and bot filters, so non-compliant offers still pass review.
Cloaking with a JS pixel is the simplest and fastest method in PeerClick. Before your first campaign, prepare two things:
a clean domain with an SSL certificate — one that has never been used before, so it carries no prior Facebook flags;
a white landing page — a compliant page added to that domain that moderators and bots will see.
How do you add MyLead as an affiliate network and offer in PeerClick?
PeerClick connects to MyLead through its trusted-networks list, so the tracker can read conversions automatically. You add MyLead as an affiliate network, then create an offer that holds your MyLead link with the {clickid} macro. That macro ties every click to a conversion, which is what makes the postback work later.
Sign in to your PeerClick account, open Aff. Networks → New, choose MyLead from the trusted networks, and click Create. For the full walkthrough, see the guide on adding MyLead as an affiliate network to a tracker.
Open your MyLead panel, generate the campaign configuration, and copy the offer URL you want to promote.
Back in PeerClick, open the Offers tab, create a new offer, paste the link, and select MyLead as the affiliate network. The {clickid} macro fills in automatically and is required to record conversions.


How do you set up a Facebook traffic source in PeerClick?
A traffic source in PeerClick tells the tracker where your visitors come from and which parameters to record. For Facebook, you load the ready-made Facebook Ads template, which pre-fills tokens like ad_id and campaign_id. These tokens pass ad-level data into your stats, so you can later see which creative drives conversions.
Open Sources → New, search for “facebook”, and add the Facebook Ads template. Need a refresher? Read how to correctly add a traffic source.
In Parameters, keep the tokens you need with the green Track toggles, or disable tokens to shorten the ad URL. Click Create Traffic Source.


How do you configure the MyLead postback in PeerClick?
A postback is a server-to-server signal that reports a conversion from MyLead back to PeerClick, without relying on cookies. You copy the postback URL generated inside your PeerClick offer and add it in MyLead, so every approved lead updates your tracker statistics in real time. The {clickid} captured earlier is what lets MyLead match each conversion to the right click.
Learn more about postback in affiliate marketing and how MyLead postbacks are structured.
Copy the postback URL generated inside your PeerClick offer.
In MyLead, open For Webmasters → Postback → Add a New Postback URL.
Paste the URL into the Postback URL field and click Save.


How to create the cloaking campaign in the Website Protection tool?
The Website Protection campaign type is PeerClick's cloaking tool. You point it at your clean domain, attach the Facebook traffic source, and tick the traffic filters that flag reviewers — Facebook, bots and spies, data centers, VPN, and unrecognized devices. Real users pass the filters and reach the offer; flagged traffic stays on the white page.
If trackers are new to you, start with our guide on how to set up a tracker.
On the Campaign tab, click New. Set Campaign type to Website Protection, paste your clean domain as the Website URL, name the campaign, and select the Facebook traffic source — the configured tokens are added automatically.
On the right, tick the filters that flag reviewers (Facebook, bots and spies, data centers, VPN, unrecognized device) for stronger protection. While testing, turn off the Without Refer filter, then switch it back on once the check is done.
Choose the redirect method. JS-pixel cloaking does not support the Without redirect option, so for affiliate-network offers select redirect To URL. Paste the black-page URL — your MyLead offer with the {clickid} parameters added earlier.
Add one blacklist rule to test the tool: click Add rule, open the Devices tab, tick Chrome under Browsers, and click Apply. This makes Chrome behave as a bot during your check.




How to generate the JS pixel and launch the campaign on Facebook?
The JavaScript pixel is the script that PeerClick uses to track visitors on your landing page. You pick a custom pixel domain, copy the pixel, and paste it into the Head section of your landing page's HTML. The pixel's protocol must match your page — http with http, https with https — otherwise tracking fails.
On the Website Protection tab, select your pre-added custom domain for pixel generation, copy the JS pixel, and paste it into the Head section of your landing page's HTML. Keep the protocols matched (http or https).
Finalize the campaign with Create, then open General and copy the link from the Website URL field with all tokens.
Test it: open the copied link in Chrome to see the white page (thanks to the Chrome rule), then open it in another browser to see the black page. Matching results mean the tool works.
Place the Website URL on Facebook and pause the tool during moderation — one click turns the icon red (off). After review passes and clicks come in, activate it again so the icon turns green. Avoid the common mistakes that get accounts banned on Facebook.




Choose a MyLead offer worth cloaking from our roundup of the best MyLead campaigns, then run it through this setup. PeerClick also has one of the most responsive support teams in the industry, so reach out if you get stuck.
To test everything risk-free, use the promo code MYLEAD-CLO and get $50 on your PeerClick account — enough to set up and test 1 cloaking campaign for free.
Key takeaways
Cloaking shows a white page to Facebook's bots and moderators and the black MyLead offer to real users.
A clean domain with SSL, never used before, plus a white landing page are mandatory before you start.
The {clickid} macro and a configured postback are what let MyLead report conversions back to PeerClick.
JS-pixel cloaking needs the redirect To URL method for affiliate-network offers, not “Without redirect”.
Always pause the tool during Facebook moderation (red icon) and activate it (green icon) only after review passes.
FAQ
1. What is link cloaking in affiliate marketing?
Cloaking is a technique that serves different content to different visitors: a compliant white page to ad reviewers and bots, and the real affiliate offer to genuine users. It is mainly used to pass automated moderation on paid traffic sources.
2. Is cloaking allowed on Facebook?
Cloaking goes against Facebook's advertising policies, so affiliates use it at their own risk. This guide explains how the PeerClick tool works technically — always check the terms of your traffic source and affiliate campaign first.
3. Why do you need a clean domain for cloaking?
A domain that has never been used carries no prior Facebook flags, which keeps your white page trusted. The SSL certificate matters too, because the JS pixel's protocol must match the page's protocol or tracking breaks.
4. What is the difference between the white page and the black page?
The white page is the safe, compliant page shown to moderators, bots, and flagged traffic. The black page is your real MyLead offer, shown only to genuine users who pass the filters.
5. How do I get the PeerClick discount for MyLead users?
Use the promo code MYLEAD-CLO to get $50 on your PeerClick account. It covers setting up and testing one cloaking campaign for free.
Summary
Cloaking affiliate links on Facebook with PeerClick comes down to one principle: show reviewers a clean white page and route real users to your MyLead offer through a JS pixel and redirect rules. Set up a clean domain, connect the offer and postback, configure the Website Protection tool, and test before you launch. Ready to begin? Create your free MyLead publisher account and pick an offer worth cloaking.
Have any questions? Feel free to reach us through our channels.