# KClient JS
advanced expert team enterprise
KClient JS connects Keitaro to remote resources via JS code. When a site link is clicked, it performs actions and settings for the campaign you connect to the site. Optionally, performs dynamic content spoofing without a visible redirect.
KClient JS is convenient to work with various website builders, where there is no possibility to place PHP code.
# Required information before setting up
KClient JS connects exclusively to sites that are hosted on third-party hosts or servers. Do not add KClient JS code to a site or webview that is uploaded as local landing or offer in Keitaro.
Do not upload websites created via website builders as a local landing page in Keitaro.
The tracking link when working with KClient JS is a link to the site where the tracking code from the tracker campaign is added. Traffic path when working with KClient JS: site with tracking code -> Keitaro -> performing actions and settings of the campaign from which the tracking code is taken.
Required: the domain parked to Keitaro and the domain of the tracking code site are two different domains.
# Configuring the integration
- Create a campaign in Keitaro.
- Open the Tracking tab in the campaign;
- Select "KClient JS" from the list
- Add the code to the
<head>
of the site you are plugging the integration into.
# Settings
After you select KClient JS solution on Tracking tab, you'll see the basic settings:
- Save only unique clicks - this feature allows saving only unique clicks in Keitaro stats.
- Convert to base64 - converts the integration code to base64 which makes the code unique and protects the code from blocking with browser extensions.
- Integration Code - the final piece of the code you need to insert.
TIP
If Save only unique clicks is turned on, and you need to test your campaign, add a new parameter &_new=1
to the page URL.
Example:
https://example.com/?_new=1
# Integrating with site builders
# Shopify
Open your store and go to Themes → Actions → Edit code.
Select the page you need in the menu from 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.
# Taplink
Create your page, go to the Settings → General → Insert HTML code
Use plain JS.
Opt out Convert to base64 option before copying the integration code.
Save the changes.
# Tilda
Create your site and open the list of the pages, click Settings;
Go to the Additional page and scroll down to HTML code to add inside the HEAD field;
Add the JS code.
Note
This feature is available only for paid plans.
After adding the code, publish the changes.
# Flexbe
Create your site and go to Settings in the upper menu;
Click Code Injection and check before closing
<head>
tag;Import your code:
# GitHub Pages
- Create a new repository:
- Open Index and insert JS code:
- Save and deploy. Now, when somebody opens a page from your repository, JS code will be executed:
# KClient JS FAQ
How to filter bots?
The basis of the standard case includes a campaign with two flows, where the first flow has filters for bots and the action "Do nothing", which will leave the bot on the site where the script is put. The second flow with the target Action, for example, local landing page:
In the "Bot Protection" flow add any set of filters to catch bots.
In "Flow 2" add the target action. If a local landing page is selected in the flow, then this landing page, or offer will be uploaded to your site with the integration without redirecting and changing the domain for the traffic, which does not get into the bot flow.
What are the incompatible site builders?
- WIX.
- Google.Sites.
Nothing happens while visiting the site with the code.
First, go to your campaign in Keitaro, click the "Log" button above the flows and check if there is a record of your click. If the log is empty, that means there's no inquiries to Keitaro, JS is not executed.
Make sure you put the integration code correctly. The code must be inserted to <head>
tag. Check if there are
mistakes, if you added extra characters when copying, or there are symbols not allowed for JS.
Also, make sure that the site 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 by default).
The click is recorded in Keitaro log, but nothing happens when visiting the site.
Read the traffic log and check if the click got to the necessary flow, and whether the action, which the click performed, coincides with the one you set in the flow. If the log says that there was a redirect, but in fact it wasn't, or it worked incorrectly (the site loaded without styles or with a floating layout), then make sure that you work with HTTPS protocols in both cases (the site and the tracker).
Eternal redirect when you visit a site with KClient JS.
Check the flows if there is a link to your site with integration. This site URL shouldn't be added to a flow. It causes an eternal redirect, since the visit to the site launches your campaign, in which the flow contains a link to the site with the KClient JS code again. It turns out to be a vicious circle.
MIXED CONTENT error in a browser console when visiting a site with KClient JS.
Make sure that you work with HTTPS protocols in both cases (the site 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 or Full" settings of SSL are set in Cloudflare configuration.