Big Article about KClient JS

Это изображение имеет пустой атрибут alt; его имя файла - Колонка-от-Ивана-1.jpg

KClient JS is the newest Keitaro integration script that allows integrating third-party websites with a JS code and dynamically changing the content without a redirect. Today this is the most popular integration method. We hope this article will help answer most of the questions and setting up the client will become easy and hustle free.

About the Kclient JS

KClient JS works the following way: 

1 – the script takes the data of the incoming click and sends a request to our API.

2 – the tracker gives an answer. If a substitution is rewuired, the contents of the stream are sent to the source site with the client and are rewrite with document.write.

As a result, a new content is displayed on the original website under the same domain, and redirect detectors see a 200 response.

The script itself has become especially popular with working with various website builders, where it is not possible to use our usual KClient PHP, but JS code injection is supported.

Bots detection

When generating a script, you can enable the base 64 option, which will generate the script code in a unique encrypted form, avoiding the content with the keys like “tracker”, “api” and other similar values that would help bots to detect the tracker.

Where to get the script code

The script code is taken inside the campaign’s settings, on the Integration tab:

Before copying the script make sure that the offer you use in the campaign is with SSL and  its URL begins with HTTPS:

Your third-party website must also have an SSL certificate installed to the domain. This is one of the requirements for the script to work properly. The second condition is that the website builder should support the execution of JS code.

What does the basic setup of a campaign with a KClient look like?

The basis of the standard case includes a campaign with two streams, where the first stream will have filters for bots and the action Do nothing, which will leave the bot on the site where the script is put, and the second stream with the target action – usually a local landing page.

It looks like this:

In the Bot Protection stream add any set of filters to catch bots.

In Stream 2 add  the target action. If a local landing page or offer is selected in the stream, then this landing page or offer will be uploaded to your site with integration without redirecting and changing the domain for the traffic which does not get into the bot stream.

How to add KClient JS to different website builders and platforms


Open your store and go to Themes > Actions > Edit code.
Select the page you need in the menu on the left. In case you need the main page, select theme.liquid.
Add the code from Keitaro to <head> tag:

Save the changes. The campaign is integrated. 


Create your page, and go to the Settings – General – Insert HTML code (Insert usual code, not base 64):

Save the changes. 


Create your website and open the list of the pages, click Settings

Go to Additional page and scroll down to HTML code to add inside HEAD field.

Add the JS code. 

Note: this feature is available only for paid plans: 

After adding the code publish the changes.


Create your website and go to Settings in the upper menu.

Click Code Injection and check Before closing </head> tag.

Import your code here: 


Create a repository with an index file. Index file should be your website.

Open Index and insert JS code: 

Save and deploy. Now, when somebody opens a page from your repository, JS code will be executed.

Following the examples above you can integrate KClient JS to any of the website builders which is more convenient for you.

In case you followed the manual, but the integration doesn’t work, read how you can solve the issues with KClient JS.

And for sure feel free to reach out to our support team, we will be happy to help out.