FAQ — Frequenly Asked Questions

Installing and Updating

How to install Keitaro

Trial license limitations

Trial license has all the features of a [[https://help.keitaro.io/en/license#professional_license|Professional]] license, but limited by:
- two campaigns;
-  two streams in each campaign;
- only one filter can be used in a single stream.

What are the differences between Basic and Pro?

What are the differences between Pro and Business?

I did the upgrade but Pro features are unavailable

Click on admin > Update the license in the upper right corner of the tracker.

How to install ionCube

What are server requirements?

How to reinstall Keitaro without losing any data (for VPS/VDS servers)

This code will upgrade the configuration and will switch the engine from PHP-FM to RR and will update the tracker:

curl https://keitaro.io/install.sh > run; bash run -rt upgrade

If you want to switch to PHP-FM back run the following command:

export PHP_ENGINE=php-fpm; curl keitaro.io/install.sh | bash -s -- -rt tune

How to reinstall Keitaro without losing any data (for shared hostings)

  • Delete var/install.lock file;
  • Download the installator https://keitaro.io/files/install.php;
  • open in a browser install.php?step=3;
  • Complete step 3 until you see the message about successful unarchiving and close the installator.
  • Delete install.php.

How to setup several Keitaro servers with the single admin panel

Read multiserver.

How to use master-slave database replication

You can enable reports building on a slave database:

  1. Open /var/www/keitaro/application/config/config.ini.php file;
  2. Find [db_slave] section;
  3. Add slave-database settings;
  4. Save the file.

To open the port read how_to_open_ports_on_server.

Then you need to setup the replication itself.

How to install Keitaro 7

In case you decide to install this version, you agree with:

  1. product bugs;
  2. the absence of tech support;
  3. the absence of trial.

Installation methods: Dowload the script https://keitaro.io/getfile/install_legacy (the support of this script stopped on 01.02.2017) and rename the file to install.php. Run the file on a hosting.

General questions

What do the errors in a log mean?

There’s no stats, what to do

What will happen after the license expires?

Keitaro will stop working.

How can I transfer the license from one account to another?

It’s not possible, the licenses can’t be transferred from one account to another.

Can I install several Keitaros with one license?

Only in case all the licenses will be used on a server with the same ip.

How to change the license IP

You can change the license IP in your account on https://keitaro.io.

Using Keitaro

How to add domains

1. Buy Pro license

2. Add an A-record to your domain’s DNS:

@  A    x.x.x.x

where “x.x.x.x” is your server’s IP.

Read more Domains

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 to find out the reasons for traffic loss

  • Compare the number of “raw” clicks (heats), not the unique ones. Keitaro uses its own algorithms for uniqueness.
  • Compare the stats in the same time zone with the affiliate network.
  • Check your domain’s SSL-certificate.
  • (ONLY for the trackers installed via the terminal). Go to Maintenance > Status and check the “max children reached”. If the value is more than 10, write to our support team, we will help you to set up PHP-FPM.
  • In case you use shared hosting or a server with ISPmanager – reinstall the tracker using our current solution for servers How to Install Keitaro.
  • Check your scripts work in AdBlock.
  • A lot of bot can stuck in the redirects such as meta-redirect or double meta-redirect. Keitaro could not mark them as bots, but some bots can’t go through these types of redirects. To check this, make a redirect to another campaign and see the difference.
  • Check all the streams, make sure all destinations work.
  • Check Maintenance > Logs > System Log for errors.
  • If you use CloudFlare, switch Firewall to “essentially off”. Disable the compression.
  • In case Keitaro is integrated with Script or Iframe, the traffic loss could happen because bots or browsers with high level security settings are visiting the page.
  • Check your log-file access.log from nginx with server requests. Check if there are 500 or 502 errors, e.g.: 84.154.60.91 - - [16/Nov/2017:03:36:01 +0200] "GET /cmp HTTP/1.1" 502 1243 "http://test.com. 502 means your server doesn’t cope with the traffic, 500 means the errors in tracker’s work (see Maintenance > Logs).

Why there’s no conversions or a postback doesn’t work?

What is an admin panel address?

http://your_domain/admin

How to send users from domain to a campaign

Maintenance > Settings, find a Domain action and select “Send to a campaign”.

How to reset Keitaro password

The license period haven’t extended after I bought the license

  • Check your license key and the one saved in /var/license/key.lic file;
  • Delete /var/license/hash.lic file.

How can a license key be changed?

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

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 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.

Why does FB and Keitaro stats differ?

Possible reasons:

  • Your ads are visited by spy services like AdMobiSpy;
  • You compare the stats in different time zones or for different periods.
  • Facebook doesn’t calculate repeated clicks, check unique clicks.
  • Disable Prefetch settings (Maintenance > Settings).
  • You are using an old klick_client.php library or WP plugin.

"No data" message in all the reports

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

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?

How can I correct keywords encoding?

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

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 1.2.3.4
</Files>

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

location /admin/index.php {
    allow 1.2.3.4;
    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

7. With the following code you can delete the stats and add empty space to your server:

cd /var/www/keitaro && sudo -u keitaro php bin/cli.php system:delete_all_stats

Deletes the stats and adds the free space on a disk.

After the command is run you'll get a warning:

[WARNING] Important! The following will happen:                                                                 
           - old versions tables removal,                                                                        
           - clicks stats to the exact date removal (if specified in parameters),                                
           - optimization of the clicks in the stats,                                                            
           - cleaning all the current stats completely (if specified in parameters).                             
 
           These inquiries will block the database                                                               
           during the implementation and require additional free space on a disk.                                

Next, confirm the command (yes/no).

The stats will be deleted.

How to see the admin visiting hiostory

The access log is saved in /var/log/nginx/admin.access.log. You can check the log with the terminal the following way:

less /var/log/nginx/admin.access.log

Or request the last logins:

tail -n 100 /var/log/nginx/admin.access.log

VPS works slowly

This could happen because of the lack of CPU resources for your virtual server. Run the command:

vmstat 1 5

As a result you’ll see the following table:

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
111  0      0 3438984  20280 603200    0    0    11    20   38   85 10  2 32  0 56
139  0      0 3435676  20280 603220    0    0     0     0  936  318 15  3  0  0 82
126  0      0 3434312  20280 603212    0    0     0     0  903  198 14  4  0  0 82
92  0      0 3450964  20280 603868    0    0     0     0  885  198 13  3  0  0 83
145  1      0 3452128  20280 604412    0    0   448     0  993  254 14  2  0  0 84

Pay attention to the last column st. If the value is more than 0 – your VPS has unsufficient resources. Contact your server provider in this case.