Cloakbro Documentation

Cloakbro is a Advanced Traffic Filtering solution designed for Affiliates.

Introduction

Cloakbro offers a traffic filtering cloud-solution for affiliates that are dealing with traffic from ad-networks. By using Cloakbro you come in full control over your traffic by detecting and seperating real users from bots and other unwanted visitors.


Prerequisites

To get started using Cloakbro you will need to have the following ready:

  • Hosting — Cloakbro works on all servers (VPS and Dedicated) and on most shared hosting providers (not recommended). We recommend lethost.co (use coupon "CloakBro" for 10% off).
  • Domain — You will need a domain that is connected to your hosting. We recommended to always use Cloudflare with proxy mode on.
  • White-Page — The page that blocked visitors see.
  • Black-Page — The page that allowed visitors see.

Flows

Flows are traffic flows, in a flow you can configure what happens to the visitors that you want and what should happen to the ones that you don't want.


Create a Flow

Creating a flow can be done from the Flows page in your client area by clicking the Add Flow button in the top right corner.


Flow Settings

Here's a detailed explanation of each of the settings.

Setting Name Description
General Settings
Flow Name This will be the name of the flow for your own reference.
Host Domain This is the domain where you are going to host the Cloakbro scripts and your white-page.
Whitelist IP This IP address will always pass the filters. This can come in handy for testing purposes.
Time Restrictions
Timezone Here you can set the timezone of the flow, the time schedule will be in accordance to this timezone.
Start Time that the flow will be actively filtering visitors and redirecting to the white or blackpage.
End Time that the flow will stop filtering visitors.
GEO Filters
Allowed Countries Select which countries are allowed to pass the filter.
Match browser timezone with location Check if the IP location timezone is the same as the visitors browser timezone.
Match browser language with location Check if the IP location native language is the same as the visitors browser language.
Device Filters
Allowed device types Select which devices are allowed.
Allowed browsers Select which browsers are allowed.
Connection Filters
Maximum number of visits The maximum amount of times a user can visit before permanently be redirected to the white page. (Set on '0' to disable this option and allow users to visit infinitlely)
Allowed IP types Checks if the IP is IPv4 or IPv6. Selected types are allowed to pass the filter.
Disallow connection types Checks if the IP connections is a VPN, Proxy, TOR, Relay or Busisness.
Block empty referrer Visitors that directly access your URL will be blocked and visitors referred from other sorces will pass the filter.
Block bots Will block common bots.
Run IP through CloakBase CloakBase is our large database of fingerprints, when enabled we will check if this visitor has appeared as suspicious on any other flow accross all users.
JavaScript Filters
JS Fingerprinting Will take a fingerprint and run various browser tests to determine if the visitor is suspicious.
Only Allow Touchscreen Will only allow devices with a touch enabled screen such as tablets and phones.
CloakDetect™ A JS based VPN and Proxy detection system.
VPN Detection Tolerance Here you can set the strictness of detection, top right of the slider you can see an estimation of how many VPNs it will block.
Proxy Detection Tolerance Here you can set the strictness of detection, top right of the slider you can see an estimation of how many Proxies it will block.
White Page Settings - Load Local Page
White Page File Enter the filename or filepath to your white page. For example: 'white.html' or '/path/to/white.php'.
White Page Settings - Mirror External Page
Mirror Link Enter the full URL of the page that you want to mirror here, including 'https://'.
Black Page Settings - Redirect
Redirect method 301 Moved Permanently. This and all future requests should be directed to the given URL.
302 Found. Object Moved aka Moved Temporarily.
303 See Other. The response to the request can be found under another URL using a GET method.
307 Temporary Redirect. The request should be repeated with another URI, but future requests can still use the original URI.
Redirect URL Link to your black page.
Weight Single Link: If you have only one link, you can assign any weight to it, and all traffic will be directed to that single link.
Multiple Links: When you have multiple links, you can distribute the traffic proportionally by assigning weights to each link. For example:
  • Link A: weight = 50
  • Link B: weight = 25
  • Link C: weight = 25
Half of the traffic goes to Link A, while the remaining traffic is split evenly between Link B and C
Black Page Settings - Load local page
Black Page File Enter the filename or filepath to your black page. For example: 'black.html' or '/path/to/black.php'.
Black Page Settings - iFrame
iFrame URL The entered URL will be inserted as an iFrame on top of your white page.
Black Page Settings - Stay on page Nothin happens, visitor will stay on the page but the details and test results of the click will be visible in the dashboard.

Editing a Flow

Hover the Flow that you would like to edit on the Flows page and click on the edit icon () to edit the flow. There is no need to re-install the flow files after making changes.


Installation

Flows are traffic flows, in a flow you can configure what happens to the visitors that you want and what should happen to the ones that you don't want.


Downloading the Flow Files

Hover the Flow that you would like to download on the Flows page and click on the download icon () to download the manual installation files or click on the WordPress icon () to download the WordPress plugin.


Manual Installation

After creating a flow you will receive a .zip file with your flow files. If you did not automatically receive them then you can easily download them again from the flows page by hovering your mouse over the flow and clicking the download icon.

Placing the files on your webserver.

Firstly rename the name of your whitepage (safepage) to index-2.html or index-2.php. Now extract the contents of the .zip (that you've downloaded earlier from your flow) and place them in the same directory as your whitepage.

IMPORTANT: Extra step for local blackpages.

If you selected the local blackpage method then you will need to rename the index file of your blackpage to bpage.html or bpage.php.

Example Webserver structure:
|--index.php // (Cloakbro's script)
|--index-2.php // (Your whitepage/safepage - visitors that didn't pass the test will be redirected here)
|--bpage.php // (Your Local blackpage - visitors that did pass the test will be redirected here)
|--assets/
|--|--track.php // (Cloakbro's script)
                                      


WordPress Installation
Important! If you want to use a local blackpage with your WordPress installation read here.

We assume that at this point you already have your WordPress installed and running. Now let's add CloakBro to your WordPress website.

  • Find your page 'slug' — The slug is the last part of the url you can find this slug easily by going in to your WordPress Dashboard > Pages > Edit Page > URL.
    For example if the url is https://cloakbro.com/my-slug then 'my-slug' is the slug we need.
  • Download Plugin ZIP — Go to Flows, hover your mouse over the flow that you want to use and click on the icon.

  • Now enter the slug that we got from the first step and click on Download and we will receive the WordPress plugin that we have to install next.

  • Installing the Plugin — To install the plugin simply upload it to your WordPress website.
    Plugins > Add New Plugin

  • Next click on 'Upload Plugin'

  • Next select and upload the plugin that you've downloaded earlier.

  • Test Functionality — Once installed and activated, test if the page is functioning properly and if the clicks are coming through in the Cloakbro Dashboard. Once you've confirmed everything is fine you're ready to start driving traffic to your pages!
Important! If you want to use a local blackpage with your WordPress installation read here.

WordPress Installation - Local Black Page

To add a local black page extract the contents of the WordPress .zip file that you've downloaded and add a folder called 'template'.


Next add your black page contents inside of this folder and rename your index file to 'bpage.php' or 'bpage.html'.


Now compress the contents back to .ZIP and upload this plugin to your Wordpress website. The plugin should install successfully and you will be all set to start running traffic!


Common error troubleshooting

Here are some of the most common errors and how you can solve them. Most errors are caused due to the use of a shared hosting plan with Namecheap or similair providers that have Firewalls.

Error Solution
PHP 402 error Disabled 'mod_security' from cPanel and use CloudFlare. If that doesn't help you're probably using a shared hosting plan with a provider like Namecheap and you'll need to switch providers we recommend lethost.co (use coupon "CloakBro" for 10% off).
PHP $_SERVER variable error Disabled 'mod_security' from cPanel and use CloudFlare. If that doesn't help you're probably using a shared hosting plan with a provider like Namecheap and you'll need to switch providers we recommend lethost.co (use coupon "CloakBro" for 10% off).
PHP Parse error Make sure your PHP version is 7.4 or higher, if that doesn't help refer to the 'PHP 402 error' solution above.
WordPress Plugin not working Flush all caches if you're using a caching plugin. Check if you entered the right '/slug' and that the plugin is enabled.

Facebook (Meta) Pixel Tracking

It's not a good idea to use your Facebook (or any other) pixel directly from your black-page. The best way is to fire pixel events from your white-page domain, here's how:

In this example, I'm going to use two different domains:

  • white-page.com is where the cloaker and white-page are installed.
  • black-page.com is my black-page where real visitors get redirected to from our white-page. This is also where a purchase/conversion/lead happens.

We're going to add a file to white-page.com called pixel.php and put this code inside of it.

  <?php
  $px_id = $_GET['px_id']; // Variable to hold the Pixel ID
  $px_ev = $_GET['px_ev']; // Variable to hold the event that we want to fire
  ?>

  <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=<?php echo $px_id; ?>&ev=<?php echo $px_ev; ?>"/>

Great! Now all we need to do is add some code to our black-page.com site. Here are some examples:

Example: You want to fire a Page View event.
Simply add this code before the </body> tag of your website:

  function cloakBroPixelEvent(px_id, px_ev) {
      var iframe = document.createElement('iframe');
      iframe.src = 'https://white-page.com/pixel.php?px_id=' + px_id + '&px_ev=' + px_ev;
      iframe.style.display = 'none';
      iframe.referrerPolicy = 'no-referrer';
      document.body.appendChild(iframe);
  }

  // Usage
  var pixelId = '0101010101'; // Replace with your pixel ID
  cloakBroPixelEvent(pixelId, 'PageView'); // PageView is the name of the Pixel event; you can change this to any other

Example: You want to send a conversion event (Purchase, Lead, etc.).

  // Again, our function to fire the pixel
  function cloakBroPixelEvent(px_id, px_ev) {
      var iframe = document.createElement('iframe');
      iframe.src = 'https://white-page.com/pixel.php?px_id=' + px_id + '&px_ev=' + px_ev;
      iframe.style.display = 'none';
      iframe.referrerPolicy = 'no-referrer';
      document.body.appendChild(iframe);
  }

  // Find your function that completes the conversion, for example:
  function registerLead(name, email, phone) {
      fetch('https://your-server.com/register-lead', {
          method: 'POST',
          headers: {
              'Content-Type': 'application/json',
          },
          body: JSON.stringify({ name, email, phone }),
      })
      .then(response => response.json())
      .then(data => {
          var pixelId = '0101010101'; // Replace with your pixel ID
          cloakBroPixelEvent(pixelId, 'Lead'); // Lead is registered successfully, so we fire the Pixel event here
      })
      .catch(error => console.error('Lead registration failed', error));
  }

And that's it! Now our Pixel will receive data and learn from it.


Keitaro Integration

To add CloakBro to Keitaro as an filter you will need to add the following script

Now place this file in the /var/www/keitaro/application/filters directory on your Keitaro server.

Create a new flow in your Keitaro campaign, choose the filter 'cloakbro' and enter your Flow Key.
You can find the Flow Key by hovering your Flow on the Flows page and clicking the copy () button.


If the filter was set to 'IS' the condition is equal to 'IS real visitor' and the opposite goes for 'IS NOT' then the condition is equal to 'IS NOT a real visitor'. Here is a example of how to use the 'IS' condition:


Note: The redirect method and redirect URL are irrelevant when using a flow with Keitaro and JS functions are unavailable.