Binom Documentation

К навигации

JS Cloaker

Some site constructors don’t let users include .php scripts into landing page code, which makes it impossible to use the Click API script. This is when JS Cloaker can be of help.

This script will help you send traffic to a landing page and change its content depending on whether or not Binom detected it as bot traffic.

How it works


Let’s say that there’s traffic coming to Landing Page A that contains the JS Cloaker script. The script collects information about traffic and sends it to Binom (like LP Pixel). Binom registers that info as a new click and depending on the Bot/NOT bot rule sends one of the following commands to Landing Page A:

— load Landing Page B without redirect (if an integrated landing page is specified in the campaign settings)
— redirect to Landing Page B (if a non-integrated landing page is specified in the campaign settings)
— do nothing (if + Direct is specified in the campaign settings)

So it is possible to show Landing Page A to bots and moderators and Landing Page B to your target traffic.

The Bot rule gets a response from MagicChecker or Cloaker for Facebook (if both are running, then their responses will be bound together with the AND operator).

Script


  • JS Cloaker script
    •                     
                            <script>
                              !function(){if(-1==window.location.href.search("[?&]nr=1")){var e=new XMLHttpRequest;e.open("GET","http://YOURDOMAIN/click.php?key=CAMPKEY&lp_type=js_redirect",!0),e.onload=function(){if(200===e.status){var t=JSON.parse(e.responseText);return t.landing_html?(document.open(),document.write(t.landing_html),void document.close()):t.landing_url?(document.open(),document.write("<html><head>"),document.write('<meta name="referrer" content="never" />'),document.write('<meta http-equiv="refresh" content="0; url='+t.landing_url+'" />'),document.write("</head></html>"),void document.close()):void 0}},e.send()}}();
                            </script>
                          
                        

Insert the script into head of your landing page. Instead of YOURDOMAIN specify a domain, and instead of CAMPKEY specify your campaign key.

The script is unique for each campaign, open the campaign settings and find it in the JS Cloaker field.

Setting up a campaign


If you want to show one landing page to the bots and moderators, and another version of it to your target traffic, try using the following settings:

This way your target traffic will be sent through the NOT bot rule. Content on Landing Page A will be changed to content on Landing Page B (if Landing Page B is integrated) or that traffic will be redirected from Landing Page A to Landing Page B (if Landing Page B is not integrated).

The rest of traffic will be sent through a default path with + Direct specified, so no changes will be applied. To save a campaign and not ruin the statistics, specify an offer or Direct URL. Instead of + Direct you can specify any other landing page. In this case content of Landing Page A will change for the moderators as well:

Hiding JS Cloaker


To encrypt the JS Cloaker script, select an option from the dropdown menu:

Default

Without encryption.

Base64 Encoded

Base64 encoding scheme.

Obfuscated

Obfuscation method.

Obfuscated Random

Each Copy click will make Binom save JS Cloaker code to the clipboard and add a random meta content value, making the code of the script look different.