If you are not yet using Matomo On-Premise, Matomo Cloud or hosting your own instance of Matomo, please use the Matomo for WordPress plugin.
This plugin uses the Matomo API to show your Matomo statistics in your WordPress dashboard. It's also able to add the Matomo tracking code to your blog and to do some modifications to the tracking code. Additionally, WP-Matomo supports WordPress networks and manages multiple sites and their tracking codes.
To use this plugin the Matomo web analytics application is required. If you do not already have a Matomo setup (e.g., provided by your web hosting service), you have two simple options: use either a self-hosted Matomo or a cloud-hosted Matomo by InnoCraft.
[youtube https://youtu.be/Qc2kooLNDiU]
Learn more.
First steps
Learn how to install your own Matomo instance: Requirements, Installation.
If you need support about Matomo, please have a look at the Matomo forums.
Finally, you can start setting up WP-Matomo.
Shortcodes
You can use following shortcodes if activated:
[wp-piwik module="overview" title="" period="day" date="yesterday"]
Shows overview table like WP-Matomo's overview dashboard. See Matomo API documentation on VisitsSummary.get to get more information on period and day. Multiple data arrays will be cumulated. If you fill the title attribute, its content will be shown in the table's title.
[wp-piwik module="opt-out" language="en" width="100%" height="200px"]
Shows the Matomo opt-out Iframe. You can change the Iframe's language by the language attribute (e.g. de for German language) and its width and height using the corresponding attributes.
[wp-piwik module="post" range="last30" key="sum_daily_nb_uniq_visitors"]
Shows the chosen keys value related to the current post. You can define a range (format: lastN, previousN or YYYY-MM-DD,YYYY-MM-DD) and the desired value's key (e.g., sum_daily_nb_uniq_visitors, nb_visits or nb_hits - for details see Matomo's API method Actions.getPageUrl using a range).
[wp-piwik]
is equal to [wp-piwik module="overview" title="" period="day" date="yesterday"].
Credits and Acknowledgements
Graphs powered by Chart.js (MIT License).
All translators at Transifex and WordPress.
Anyone who donates to the WP-Matomo project, including the Matomo team!
All users who send me mails containing criticism, commendation, feature requests and bug reports - you help me to make WP-Matomo much better!
Replace jqplot and jquery.sparklines with Chart.js
Allow to show overview stats for last 60 and 90 days
Allow to select the per post stats range from today to last 90 days
Optionally remove Matomo's script tag's type attribute, see https://wordpress.org/support/topic/how-to-remove-unnecessary-type-attribute-for-javascript/.
Fix/update proxy script (thanks to nicobilliotte and Rasp8e, https://github.com/braekling/WP-Matomo/pull/91)
Make plugin working if deployed in a custom folder (thanks to utolosa002, https://github.com/braekling/WP-Matomo/pull/88)
Improvement: Only activate/ load admin components if an admin page is actually loaded. Thanks to Michael!
Bugfix: Proxy tracking will work again. Piwik 2.7 or higher is recommended.
Bugfix: Avoid a PHP notice in dashboard.
NOTE: If you update Piwik and use the "add tracking code" feature, please also update your WP-Piwik tracking code: Just open the WP-Piwik tracking code settings and save them again.
Bugfix: Deprecated get_currentuserinfo() replace. Thx to the infinity, see https://github.com/braekling/WP-Piwik/pull/21
Bugfix: Overview widget will show proper values even if a period > 1 day is selected, see https://wordpress.org/support/topic/weird-numbers-im-wp-piwik
Added InnoCraft Cloud support (the new service created by the people behind Piwik). Piwik.pro is still usable via HTTP mode, the configuration will be updated automatically.
Added search functionality to site browser
Added preload DNS option, see https://piwik.org/blog/2017/04/important-performance-optimizations-load-piwik-javascript-tracker-faster/
Added option to set link and download classes (expert settings)
Added option to choose which post types should be considered for annotations
Bugfix: Opening Piwik stats of a specific network site does not lead to the sitebrowser anymore
Several language updates, amongst others Portuges (Brazil) finished. See https://www.transifex.com/organization/piwik/dashboard/wp-piwik for further information.
Bugfix: If WP-Piwik is not configured properly or the connection to Piwik could not be established, the toolbar graph won't cause a JavaScript error anymore.
Bugfix: In some cases the update message did not disappear -> fixed
Important change: If you want to upgrade from 0.8.x to 0.10.x, please install 0.9.9.18 first: https://downloads.wordpress.org/plugin/wp-piwik.0.9.9.18.zip
Improvement: Define additional file extensions for tracking downloads
Improvement: Added a POT file to support translators (Note: 1.0 will change a lot, so please don't spend too much time in translating the current version, e.g., by creating an all new translation. With 1.0 I will also offer a translation platform to support your work.)
Improvement: If necessary, you can force Piwik to use HTTP or HTTPS now (e.g., to avoid redirections from http to https)
Bugfix: PHP API causes plain text output issue, see http://wordpress.org/support/topic/bug-cant-access-to-tabs-in-setting-after-configuration
Bugfix: PHP API causes WordPress multisite login issue, see http://wordpress.org/support/topic/causes-multisite-superadmin-subsite-login-problem
Bugfix: Removed PHP warning if annotations are enabled and annotations will work again, see http://wordpress.org/support/topic/warning-message-everywhere-in-the-backend-call_user_func_array-expects
Feature: "Track visitors across all subdomains" script changes are done by Piwik now, see http://wordpress.org/support/topic/track-across-subdomains-wp-on-subdomain?replies=2
WordPress 3.5 compatibility fix: http://wordpress.org/support/topic/v35-errors-fix?replies=5 (Thanks Christian Foellmann!)
Advanced Search Result Analytics, see http://piwik.org/docs/javascript-tracking/#toc-tracking-internal-search-keywords-categories-and-no-result-search-keywords
Site Search stats added
Use js/index.php: Replaces piwik.js and piwik.php by js/ (instead of piwik.js only)
Connection timeout setting added
Full reset option added
Uninstall script added
Stats metaboxes: Date formatted
Use proxy settings defined in wp-config.php
Piwik.php proxy script added (see http://piwik.org/faq/how-to/#faq_132)
Bugfix: After upgrade, Piwik automatically places cookies again (http://wordpress.org/support/topic/after-upgrade-piwik-automatically-places-cookies-again)