# KClient JS pro business
KClient JS is based on a KClient PHP solution, but allows to integrate JS websites.
- Go to Integrations tab in a campaign's settings.
- Select KClient JS.
- Copy the code and add it to
head- the higher you put the code on a website, the earlier it will work.
After you select KClient JS solution on Integrations tab you'll see basic settings:
- Save only unique clicks - this feature allows to save only unique clicks in Keitaro's stats.
- Convert to base64 - converts integration code to base64 which makes the code unique and protects the code from blocking with brewser extensions.
- Integration Code - the final piece of the code you need to insert
# Debug mode
In case you enabled save only unique clicks feature all the data after the first opening will be saved and the following clicks will be blocked.
To test and show new data you can add a GET parameter
_new=1 to your URL. This will enable debug mode and you'll see all changes:
# Solving issues with KClient JS
# Nothing happens while visiting the website with the code
First of all, go to your campaign in Keitaro, click the Log button above the streams and check if there is a record of your click. If the log is empty that means there’s no any inquiries to Keitaro, JS is not executed.
Make sure you put the integration code correctly. The code should be inserted to
<head> tag. Check if there are mistakes, if you added extra characters when copying, or if there are symbols not allowed for JS.
Also make sure that the website and the tracker have domains with SSL certificates installed (the work is carried out within the HTTPS protocol) and the JS script in the tracker was generated with the ssl domain (that means you use https domain in Keitaro as default).
# The click is recorded in Keitaro log, but nothing happens when visiting the website
Read the traffic log and check if the click got to the necessary stream, and whether the action which the click performed coincides with the one you set in the stream. If the log says that there was a redirect, but in fact it wasn’t there or it worked incorrectly (the website loaded without styles or with a floating layout), then make sure that you work with HTTPS protocols in both cases (the website and the tracker).
# Eternal redirect when you visit a website with KClient JS
Check the streams if there is a link to your website with integration. This website URL shouldn’t be added to a stream. This causes an eternal redirect, since the visit to the website launches your campaign, in which the stream again contains a link to the website with the KClient JS code. It turns out to be a vicious circle.
# MIXED CONTENT error in a browser console when visit a website with KClient JS
Make sure that you work with HTTPS protocols in both cases (the website and the tracker). If #1 does not help, check the browser console and find the resources that are used with http, and change their urls to https. If you work with a domain through Cloudflare, make sure that Flexible/Full settings of SSL are set in CloudFlare configuration.
# CORS error in browser console, incorrect website loading
Open Maintenance > Status > Installation method. If the version is lower than 2.21 you need to upgrade your server’s configuration.