Installation and update

How can I install Keitaro TDS?

The difference between Basic and Pro versions

The features, which are available only in PRO and BUSINESS licenses:

  • Multiuser access.
  • Domain parking.
  • Streams monitoring.
  • Enable own custom scripts, redirects, macros, and filters.
  • Admin API.

Read more in Which License to Buy section.

How can I install ionCube?

Check ionCube Installation page.

What are the server requirements?

How to reinstall Keitaro without losing the data

  • Delete the file var/install.lock;
  • Download the installer https://keitaro.io/files/install.php;
  • Open in a browser install.php?step=3;
  • Go to the step, where a successful files unpacking will be announced;
  • Create an empty file var/install.lock or delete an installer.

General questions

What is going to happen when the license expires?

Keitaro will stop collecting statistics and restrict access to the administration panel.

Can I install several TDS under the same license?

Yes, if they use the same IP address.

How to change license IP?

Go to your account on keitaro.io to the “Licenses” page.

Click on “Change IP” and change the current IP-address to the new one.

How to Use Another DB for Building Reports?

  1. Open file /var/www/keitaro/application/config/config.ini.php
  2. Find sction [db_slave]
  3. Enter slave db information
  4. Save it

Working with Keitaro

What is the admin panel address?


How to send visitors to a campaign from the domain?

On the Settings page in Misc tab find “Action for domain” and choose “Send to campaign”.

Why doesn't the stream work, or why does the click go to a wrong stream?

  1. Go to the “Maintenance > Logs > Traffic” page.
  2. Enable traffic log.
  3. Make a click, or wait until a click gets into a wrong stream.
  4. Look at a traffic log. There you'll be able see how the sream filters have just functioned.

Also, have a look at the “Additional > Traffic Simulation” menu. You can emulate getting any user to a campaign there.

How can I restore TDS password?

Download the script https://keitaro.io/getfile/reset_password. Upload it to TDS directory via FTP. Open http://your_tds/reset_password.php in your browser. On the script page insert your login and your new password. Delete the script after the password has been changed.

The license date is not changed after extension.

  • Check your license key. Compare it with the one in the file /var/license/key.lic;
  • Delete the file /var/license/hash.lic.

How can a license key be changed?

Write a new key in /var/license/key.lic and delete the /var/license/hash.lic.

Keitaro files cannot be deleted or edited

If you need to access only one file, create a script in TDS directory:

chmod('file/path', 0777);

Change the path to file and open it in browser.

If you need to change rights to several files, use the script https://keitaro.io/getfile/fix_permissions. Change the path to the directory, upload it to Keitaro's directory and open in your browser.

Which attributes must have files?

If PHP works in CGI or FastCGI mode set 755 for diretory var and 655 for other files.

cd /tds/directory
chmod 755 -R ./var

Check if the file owner is the same as the owner of PHP processes:

chown -R user ./

If you use Apache and mod_php set 777 attributes.

Why 777 rights are necessary for Keitaro directory?

Installer and update script need “create” and “write” file rights. If the server has the right configuration, 775 is enough, but usually web server works from another username and another group name.

Why counter numbers at LiveInternet (Metrics) website and Keitaro are different?

If the website is the source of traffic:

  • Check if the domain is present in antivirus databases through virustotal.com;
  • Check if there are problems in Keitaro functionality, check the logs /var/log/errors.log и keitaro_errors.log;

If the website is the traffic receiver:

  • Compare hits, uniques are counted differently in different systems. If the server statistics, for example, WebStat is installed, check their indices.
  • TDS can skip the bots if those do not load the counters;
  • Counters may be blocked by browser plugins.

"No data" message in all the reports

Check Cron settings at the “Status” page and error log /var/log/errors.log.

How to find reason for website traffic drop?

First make sure that the website traffic actually dropped:

  • Compare the number of “raw” clicks, not unique clicks. Keitaro has its own algorithms for identifying uniqueness and often the number of hits converges.
  • Some shops of cheap traffic can show inflated rates of clicks. They have an increased level of cheating, bot traffic.
  • Check the values in one time zone.


  • Go through all the streams by yourself. Check if they are all working.
  • Check the system log on the page “Maintenance > Logs”.
  • If you use CloudFlare, switch the Firewall settings to “essentially off”. Turn off the compression.
  • Check your domain through these services host-tracker.com, http://urlvoid.com and http://virustotal.com.
  • If Keitaro is connected via Script or Iframe, the loss of traffic is possible due to page visits by bots or browsers with increased security settings.

More complex diagnostics for which you need server administration skills:

  • Find the nginx query log (access.log). Compare the number of requests to the campaign with the Keitaro values over the same time period (do not forget for the time zones).
  • Check the error logs Nginx, Redis, MySQL.

Referrers from Google and Yandex are not transmitted

Starting from September 25, 2013 Google turned on https on search page. Referrer is not transmitted during moving from https to http.

From the end of 2013 Yandex started reducing the transmission of referrers http://habrahabr.ru/company/yandex/blog/204886/.

Why is the domain with Keitaro marked as "Malicious site"?

Some services give the website “Malicious site” status for redirection to another domain.

To avoid it:

  1. Create a file main.html with any content in the domain directory;
  2. Open the page “Maintenance > Settings > Misc > Domain Action”;
  3. Choose action “Redirect to URL” and write URL of the created file.

How can I replace or hide a referrer?

Please read How to Hide Referrer.

How can I correct keywords encoding?

Add the parameter charset=utf-8 to the links to your campaigns.

How can I open an exported CSV in Excel?

  1. Create a new table;
  2. File → Import;
  3. Choose the «CSV file» option, click «Import» and choose your file;
  4. Choose «Original data type: Delimited», «File origin: Cyrillic (Windows)», press «Next»;
  5. Leave only «Delimeters: Semicolon», press Finish.
  6. Press OK in the new window.

How to restrict access to the admin panel?

Apache. Create an /admin/.htaccess file with the following contents:

<Files index.php>
order Deny,Allow
Deny from all
Allow from

Nginx. Add this to host section(/etc/nginx/nginx.conf):

location /admin/index.php {
    deny all;

How to add empty space to your server

1. Go to Maintenance > Settings > System and set up the “Stats store term”.

2. Clean up the Redis dumps in Termonal. It will delete draft data:

rm -r /var/lib/redis/*

3. If you upgraded from Keitaro v.7 you can delete old tables in Terminal:

export DB_NAME='keitaro'
export DB_USER='root'
mysql -u $DB_USER  -e 'show tables' $DB_NAME | grep -e 'keitaro_archive\|keitaro_index' | xargs -I "@@" mysql -u $DB_USER -e "TRUNCATE table \`@@\`" $DB_NAME

4. You can delete stats to the exact date, but if there are many clicks in a database it may take a long time:

export DB_NAME='keitaro'
export DB_USER='root'
mysql -u $DB_USER  -e 'DELETE FROM keitaro_clicks WHERE datetime < "2018-01-01" ' $DB_NAME 

5. These commands can optimize the clicks in the stats and free some space. Important! These inquiries will block the database during the implementation and require additional free space on a disk.

export DB_NAME='keitaro'
export DB_USER='root'
mysql -u $DB_USER -e 'optimize table keitaro_clicks' $DB_NAME 
mysql -u $DB_USER -e 'optimize table keitaro_conversions' $DB_NAME 
mysql -u $DB_USER -e 'optimize table keitaro_visitors' $DB_NAME 
mysql -u $DB_USER -e 'optimize table keitaro_ref_ips' $DB_NAME 
mysql -u $DB_USER -e 'optimize table keitaro_ref_referrers' $DB_NAME 
mysql -u $DB_USER -e 'optimize table keitaro_ref_user_agents' $DB_NAME 

6. You can clean all the current stats completely with the following commands:

export DB_NAME='keitaro'
export DB_USER='root'
mysql -u $DB_USER -e 'truncate keitaro_ip_sessions' $DB_NAME 
mysql -u $DB_USER -e 'truncate keitaro_clicks' $DB_NAME
mysql -u $DB_USER -e 'truncate keitaro_visitors' $DB_NAME