Yes, you can use Javascript tracking, direct calls to the Tracking API and server log file analytics at the same time- if you record data for each technique in a separate website in Matomo.

For example, if you already use the JavaScript code on your website and you wish to import data from the log file as well, it is important to import server log file data in a different website to keep things in order.

In this case we recommend the following steps:

  1. create a new website in Matomo, eg. with a name “Example.org (log files)”.
  2. note the idsite of this new website. You will use this website ID to import your log file data into.
  3. in the command line, force all requests from the log files to be recorded in a specific website ID via
    --idsite=X

Important note: If you import data from the logs in the same website as the JavaScript tracker, you will have “double counts” of visits, pages, etc. Log Analytics does not deduplicate records, so if you import the same data multiple times, the visits will be duplicated.

Previous FAQ: Can I use Log Analytics with Matomo Cloud?