FAQ › How to …?

  1. Can I get reports for a custom date range?
  2. How to make Piwik faster?
  3. After the top 500 elements, Piwik automatically groups pages, keywords, websites, etc. under the label "Others"; How can I force Piwik to not limit the data?
  4. How can I force the reports to be re-processed from the logs?
  5. How to track error pages (404 pages) in Piwik? Which URLs are 404 and which referers lead to these pages?
  6. How can I set custom groups of pages (structure) so that page view are aggregated by categories?
  7. How to show Today's statistics in Piwik reports by default, instead of yesterday?
  8. How can I track visits on my intranet?
  9. How can I automatically login my users in Piwik when they go from my CMS to Piwik?
  10. How to delete all the statistics for a given websites, or for all websites?

Answers

  1. Can I get reports for a custom date range?

    Piwik currently reports on days, weeks, months and years. Reports for a custom date range (e.g. "from 4th november to 24th december") is not yet available, as this would potentially be too computationally intensive. As we improve Piwik's algorithms and data structure we may add this feature at a later date. Stay tuned!

  2. How to make Piwik faster?

    By default, Piwik reports are processed when you request them in the User Interface. Please see How to setup auto archiving of your reports every night? to automate the generation of Piwik reports. See also How long does the Piwik archiving process? for expected speed for high traffic websites.

  3. After the top 500 elements, Piwik automatically groups pages, keywords, websites, etc. under the label "Others"; How can I force Piwik to not limit the data?

    For performance reasons, Piwik will by default keep only archive the first top 500 pages, top 500 keywords, etc. Piwik will then sum all the remaining pages, keywords, etc. under the label "Others".

    If you wish to archive all the data, or simply archive more than 500 entries, you can override these values in the configuration file config/config.ini.php. For example, to limit all table to 5000 entries, add the following in config/config.ini.php:

    [General]
    ; maximum number of rows for any of the Referers tables (keywords, search engines, campaigns, etc.)
    datatable_archiving_maximum_rows_referers = 5000
    ; maximum number of rows for any of the Referers subtable (search engines by keyword, keyword by campaign, etc.)
    datatable_archiving_maximum_rows_subtable_referers = 5000
    ; maximum number of rows for any of the Actions tables (pages, downloads, outlinks)
    datatable_archiving_maximum_rows_actions = 5000
    ; maximum number of rows for pages in categories (sub pages, when clicking on the + for a page category)
    datatable_archiving_maximum_rows_subtable_actions = 5000

  4. How can I force the reports to be re-processed from the logs?

    In some very rare cases, it might be useful to force Piwik to re-process the reports from the original logs. By default, reports will only be processed once (preferably with an automatic cronjob setup at night) and then archived in the database. When you visit the Piwik UI, all you see if data read directly from these archive tables.

    To force Piwik to re-process your reports there are two ways:

    • To trigger the archiving for all the reports, you can delete all piwik_archive_* tables. The next time you visit the Piwik UI, Piwik will automatically detect that the archives are missing, re-create the tables, and re-trigger the archiving.
    • If you just wish to re-trigger reports for a given date, you can manually set always_archive_data_day=1 to force archiving of the daily reports, and/or always_archive_data_period=1 to force archiving for all period reports (week, month, year). If you then visit the Piwik UI for a given date, reports will be re-processed. When you are done, do not forget to set these values back to 0.
  5. How to track error pages (404 pages) in Piwik? Which URLs are 404 and which referers lead to these pages?

    Pages regularly appear and disappear on websites, other websites might link to wrong URLs on your website, etc.

    You can track with Piwik which URLs are leading to a 404, and which referer pages link to 404 on your website.

    • Setup a custom 404 page: you can easily do this if you use a CMS (for example, in wordpress, all 404 pages are loading a custom 404 template). If you don't use a CMS, you can usually specify a 404 custom page in your webserver configuration file.
    • Add the Piwik tracking code in this custom 404 page. Edit the tracking code and set: piwikTracker.setDocumentTitle('404/URL = '+encodeURIComponent(document.location.pathname+document.location.search) + '/From = ' + encodeURIComponent(document.referrer));
    • In your Piwik report, in Actions > Pages, you will now have a new entry for the 404 pages. It will also list the full URL of the 404 pages, as well as all referers leading to this page. Enjoy!
  6. How can I set custom groups of pages (structure) so that page view are aggregated by categories?

    In the Piwik Javascript tracking code, you can specify custom page names by using the piwikTracker.setDocumentTitle() method; (Read more information about the Piwik Javascript Tracking options).

    In the Piwik Page views reports, by default all page names are automatically categorized in groups delimited by the character '/'. For example, if you set a custom page name piwikTracker.setDocumentTitle("Products / Gardening / id=123");, Piwik will record this page view in the directory "Products", the sub-directory "Gardening" and the page name "id=123". This means that you will get the total number of visitors viewing pages in Products, Gardening, as well as hits on the specific page "id=123".

    If you would like to change the delimiter used to categorize pages, you can for example set in your config/config.ini.php :
    action_category_delimiter = ::

    You can then define your custom page names as follows: piwikTracker.setDocumentTitle("Products :: Gardening :: id=123"); and the grouping will be done based on this new delimiter.

  7. How to show Today's statistics in Piwik reports by default, instead of yesterday?

    If you want Piwik to show today's statistics in the reports, you can update your Piwik config file piwik/config/config.ini.php and add the following at the end:

    [General]
    default_day = today

  8. How can I track visits on my intranet?

    Piwik can track visits on your intranet website as long as Piwik itself is hosted in your intranet.

  9. How can I automatically login my users in Piwik when they go from my CMS to Piwik?

    Some Piwik users automatically provide their CMS customers with Piwik statistics. If you want to provide a one-click automatic login to Piwik for your users, you can pass their login & the md5 string of their password in the URL parameters:

    /pathpiwik/index.php?module=Login&action=logme&login=your_login&password=your_MD5_password

    This will log the user (create a cookie in their browser) and redirect to the index.php on succesful login. We advise to do this authentication over HTTPS. Note that this authentication method doesn't work for the Super User.

    You can also specify the URL to redirect after a successful login, if different from the default Piwik dashboard page:

    /pathpiwik/index.php?module=Login&action=logme&login=your_login&password=your_MD5_pwd&url=http://piwik.mycompany.com/subpath/

  10. How to delete all the statistics for a given websites, or for all websites?

    It is possible to keep all the websites information (names, defined goals, etc.) and only delete the stored analytics data. However, there is currently no tool available to do this: you can directly delete the data from the Piwik database. Do the following:

    • Delete all the mysql tables with a name starting with piwik_archive_* ; they will automatically be re-created when Piwik processes the reports
    • Execute the following query: DELETE FROM piwik_log_visit WHERE idsite = X with X replaced by the website ID you wish to reset.

You may also be interested in...

Entries (RSS)