How to Install the Matomo Analytics WordPress Plugin Updated on August 16, 2021 by InMotion Hosting Contributor 5 Minutes, 11 Seconds to Read Matomo Analytics, formerly Piwik Analytics, is one of the most popular Google Analytics alternatives available today. The open source web analytics suite has a long list of features and over 50 plugins available to customize user interaction and tracking and for your marketing and privacy needs. The recommended shell_exec PHP function cannot be enabled on shared hosting. However, Matomo runs fine without it for most use cases. Before, you’d need to install a stand-alone Matomo Analytics application on the web server with a dedicated database user and password for storing data. Then you’d have to embed the Matomo tracking code into your website header or footer to start logging interactions. Or you could add the tracking code and import some statistics in a content management system (CMS) dashboard such as: WordPressDrupalGRAVZenphotothirty bees Then, in 2019, the Matomo developers created an official plugin to manage analytics features from within the WordPress dashboard. Matomo Analytics – Ethical Stats. Powerful Insights grants you access to on-site web analytics functions without having to install a separate web application on the server. There are a few notable advantages to this: Analytics accessible with only 1 button clickLess user credentials to maintain with password managementMatomo privileges automatically mapped to WordPress administrator rolesEasier maintenance as updates and other notifications are in one locationSimpler migration process as all Matomo data is in the installed WordPress directory and database Below we’ll cover how to: Install the Official Matomo Analytics WordPress PluginInstall from the DashboardInstall via WP-CLIInstall ManuallyGet Started with Matomo Analytics in WordPressMatomo Admin AccessTracking ExclusionsGeolocation for Matomo AnalyticsAdvanced SettingsMatomo Dashboard Per the Matomo developers, if you’re already using a standalone Matomo installation or Matomo Cloud, it’s best to use the WP-Matomo plugin which integrates your website with your existing Matomo data. Attempting to combine the two data sources could result in data corruption. Install the Official Matomo Analytics WordPress Plugin You can install the Matomo WordPress plugin with the dashboard, WP-CLI, or manual installation. This plugin downloads the DBIP-City.mmdb geolocation database from DB IP into your uploads directory to detect user location based on their IP address. Install from the Dashboard Log into your WordPress dashboard.Install the Matomo Analytics – Ethical Stats. Powerful Insights plugin and activate it.In the plugins list, under Matomo Analytics, select Get Started. Install via WP-CLI System administrators with WP-CLI installed can manage WordPress plugins with dedicated SSH commands. Connect to your server using SSH.Install and activate Matomo Analytics using the following command:wp plugin install matomo --activate Install Manually WordPress developers without WP-CLI or using File Transfer Protocol (FTP) can manually upload the WordPress plugin before activating it in the dashboard. To install the plugin manually, download the plugin zip file from WordPress.org.Upload the zip file and extract the folder in the WordPress wp-content/plugins folder.Log into your WordPress site or use the WP-CLI SSH command to activate the plugin:wp plugin activate matomo Get Started with Matomo Analytics in WordPress This section will cover the basics of enabling and configuring the Matomo tracking code for WordPress. Log into your WordPress dashboard.On the left, hover over Matomo analytics and select Get Started.Select Enable tracking now.Purge any server caching (PHP-FPM or NGINX) or plugin caching (e.g. W3 Total Cache and WP Super Cache).Select Click here to configure your tracking code in the Settings section.On the Tracking page, you can configure or disable the tracking code for your WordPress website. Notable options worth reviewing:Disable cookies for tracking visitorsEnable ecommerce for WordPress stores (e.g. WooCommerce)Track search to learn more about what users are looking for within your websiteTrack 404 helps improve user experience (UX) and search engine optimization (SEO)Enable content tracking for user engagement with advertisements, videos, and moreTrack RSS feeds if you encourage readers to use Really Simple Syndication (RSS) readersUser ID Tracking for auditing registered users’ actionsForce Matomo to use a specific protocol to ensure your Matomo suite uses an SSL connectionAt the bottom, Save Changes. Matomo Admin Access At the top, select the Access tab to control which WordPress roles (editor, author, etc.) have assigned Matomo roles by default. The options are View, Write, and Admin. The Super User role is automatically assigned to the WordPress administrator. Once you’re done, don’t forget to Save changes. Developers can also use WordPress role editor plugins for further flexibility with custom Matomo capabilities: superuser_matomoadmin_matomowrite_matomoview_matomo Tracking Exclusions The Exclusions tab helps you clean up analytics by excluding the following from tracking: WordPress user rolesIP addresses for proxy servers or specific networksQuery URL parameters such as affiliate campaign linksUser agents, useful for ignoring some crawl botsFragments (HTML anchors) After any updates, Save changes. Geolocation for Matomo Analytics As mentioned earlier, Matomo uses DB-IP for IP geolocation in analytics. Users wanting more accurate location results in WordPress can create a MaxMind account. Then, add the MaxMind license key to your Geolocation settings. Save changes. If you want to be General Data Protection Regulation (GDPR) or California Consumer Privacy Act (CCPA) compliant, read the Privacy & GDPR info first. Advanced Settings The Advanced tab is where you ensure Matomo knows which IP address is indeed yours. This is important when your website is behind a proxy server. If the detected IP is wrong, select the radio button for the correct option. You may also deselect the Yes checkbox to prevent Matomo from deleting website analytics if the plugin is uninstalled. Save changes if necessary. Matomo Dashboard Once you’ve completed your Matomo setup, select Matomo Analytics > Reporting from the sidebar to access the Matomo dashboard. You may need to whitelist the website if you’re using a web browser extension for ad blocking including uBlock Origin, Adblock, and NoScript. The dashboard is very similar to the standalone Matomo web application dashboard. Click the gear icon in the upper-right corner to access Matomo dashboard settings including segmentation and automated email reports. After you’ve gotten familiar with the Matomo dashboard, you should check out the other Matomo Analytics options in the WordPress sidebar: Summary for a snapshot of recent analyticsMarketplace for installing Matomo pluginsDiagnostics for possible website, database, or server issues Learn more ways to enhance your website through our WordPress Education Channel. Improve the performance and security of your WordPress website with our WordPress VPS Hosting plans. Web Application Firewalls Free SSL Certificates Advanced Server Caching WordPress VPS Plans Share this Article InMotion Hosting Contributor Content Writer InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals! More Articles by InMotion Hosting Related Articles W3 Total Cache – Guide to WordPress Caching Using Wordfence Login Security for 2FA Top Monitoring Plugins for WordPress How to Setup an Affiliate System in WordPress Google Web Stories Creates Beautiful Content for WordPress Websites WordPress comment spam prevention with Akismet How to Use WP 2FA for WordPress Using Twentig to Build Your WordPress Site Best WordPress Plugins for Adding Event Calendars to your Website What Are the Best WordPress Plugins for Small Business Owners?