---
title: "How to Install the Matomo Analytics WordPress Plugin"
description: "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..."
url: https://www.inmotionhosting.com/support/edu/wordpress/plugins/matomo-analytics/
date: 2020-12-15
modified: 2021-08-16
author: "InMotion Hosting Contributor"
categories: ["WordPress Plugins"]
type: post
lang: en
---

# How to Install the Matomo Analytics WordPress Plugin

[**Matomo Analytics**](https://matomo.org/), formerly *Piwik Analytics*, is one of the most popular [Google Analytics alternatives](https://www.inmotionhosting.com/support/website/analytics/choose-the-best-analytics-tool/) available today. The open source web analytics suite has a long list of features and over 50 [plugins available](https://plugins.matomo.org/) to customize user interaction and tracking and for your [marketing](https://www.inmotionhosting.com/support/edu/wordpress/introduction-to-hubspot-all-in-one-marketing-for-wordpress/) and [privacy](https://www.inmotionhosting.com/support/edu/wordpress/wp-privacy-setting/) 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](https://www.inmotionhosting.com/support/website/analytics/install-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:

- [WordPress](https://www.inmotionhosting.com/support/edu/wordpress/introduction-to-wordpress/)
- [Drupal](https://www.drupal.org/project/matomo)
- [GRAV](https://www.inmotionhosting.com/support/website/analytics/grav-matomo-analytics/)
- [Zenphoto](https://www.inmotionhosting.com/support/website/install-zenphoto-plugin/)
- [thirty bees](https://www.inmotionhosting.com/support/website/analytics/matomo-analytics-thirty-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](https://wordpress.org/plugins/matomo/) 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 click
- **Less user credentials** to maintain with [password management](https://www.inmotionhosting.com/support/security/keepass-for-windows-user-guide/)
- Matomo **privileges automatically mapped** to WordPress administrator roles
- **Easier maintenance** as updates and other notifications are in one location
- **Simpler 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 Plugin](#install)
  - [Install from the Dashboard](#dash)
  - [Install via WP-CLI](#wp)
  - [Install Manually](#man)
- [Get Started with Matomo Analytics in WordPress](#start)
  - [Matomo Admin Access](#access)
  - [Tracking Exclusions](#exclusion)
  - [Geolocation for Matomo Analytics](#geo)
  - [Advanced Settings](#adv)
  - [Matomo Dashboard](#matomo)

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](https://www.inmotionhosting.com/support/edu/wordpress/connect-wordpress-matomo-with-wp-matomo/) 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](#dash), [WP-CLI](#wp), or [manual installation](#manual).

This plugin downloads the *DBIP-City.mmdb* geolocation database from [DB IP](https://db-ip.com/db/download/ip-to-city-lite) into your uploads directory to detect user location based on their IP address.

### Install from the Dashboard

1. [Log into your WordPress dashboard](https://www.inmotionhosting.com/support/edu/wordpress/logging-into-wordpress-dashboard/).
2. [Install the **Matomo Analytics – Ethical Stats. Powerful Insights**](https://www.inmotionhosting.com/support/edu/wordpress/plugins/install-wordpress-plugins/) plugin and activate it.
3. In the plugins list, under *Matomo Analytics*, select [Get Started](#start).

### Install via WP-CLI

System administrators with **WP-CLI** installed can manage WordPress plugins with dedicated [SSH commands](https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/).

1. [Connect to your server using SSH](https://www.inmotionhosting.com/support/server/ssh/do-you-provide-ssh-access/).
2. [Install and activate Matomo Analytics](https://www.inmotionhosting.com/support/edu/wordpress/wp-cli/install-a-plugin-using-wp-cli/) using the following command:wp plugin install matomo --activate

### Install Manually

WordPress developers without WP-CLI or using [File Transfer Protocol (FTP)](https://www.inmotionhosting.com/support/website/ftp/getting-started-guide/) can manually upload the WordPress plugin before activating it in the dashboard.

1. To install the plugin manually, download the plugin zip file from [WordPress.org](https://wordpress.org/plugins/matomo/).
2. [Upload the zip file](https://www.inmotionhosting.com/support/edu/cpanel/how-to-upload-a-file-using-file-manager-in-cpanel/) and [extract the folder](https://www.inmotionhosting.com/support/edu/cpanel/compressing-uncompressing-files/#uncompress) in the WordPress `wp-content/plugins` folder.
3. [Log into your WordPress site](#start) 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.

[![Getting started with Matomo Aanly](https://www.inmotionhosting.com/support/wp-content/uploads/2020/12/wordpress-matomo-get-started-1024x280.png)](https://www.inmotionhosting.com/support/edu/wordpress/plugins/matomo-analytics/attachment/wordpress-matomo-get-started/)

1. [Log into your WordPress dashboard](https://www.inmotionhosting.com/support/edu/wordpress/logging-into-wordpress-dashboard/).
2. On the left, hover over *Matomo analytics* and select **Get Started**.
3. Select **Enable tracking now**.
4. Purge any server caching ([PHP-FPM](https://www.inmotionhosting.com/support/server/php-fpm/how-to-restart-php-fpm/) or [NGINX](https://www.inmotionhosting.com/support/edu/wordpress/nginx-cache-management/)) or plugin caching (e.g. [W3 Total Cache](https://www.inmotionhosting.com/support/edu/wordpress/plugins/w3-total-cache/) and [WP Super Cache](https://www.inmotionhosting.com/support/edu/wordpress/plugins/wp-super-cache/)).
5. Select **Click here to configure your tracking code** in the *Settings* section.
6. On the *Tracking* page, you can configure or disable the tracking code for your WordPress website. Notable options worth reviewing:**Disable cookies** for tracking visitors**Enable ecommerce** for WordPress stores (e.g. [WooCommerce](https://www.inmotionhosting.com/support/edu/wordpress/woocommerce/))**Track search** to learn more about what users are looking for within your website**Track 404** helps improve user experience (UX) and [search engine optimization (SEO)](https://www.inmotionhosting.com/support/website/seo/seo-getting-started-guide/)**Enable content tracking** for user engagement with [advertisements](https://www.inmotionhosting.com/support/edu/wordpress/how-to-create-affiliate-links-in-wordpress/), [videos](https://www.inmotionhosting.com/support/edu/wordpress/video-sitemap-plugins-for-wordpress/), and more**Track RSS feeds** if you encourage readers to use [Really Simple Syndication (RSS)](https://www.inmotionhosting.com/support/edu/wordpress/how-to-add-an-rss-feed-to-your-wordpress-site/) readers**User ID Tracking** for auditing registered users’ actions**Force Matomo to use a specific protocol** to ensure your Matomo suite uses an [SSL connection](https://www.inmotionhosting.com/support/edu/wordpress/wordpress-ssl/)
7. At 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](https://www.inmotionhosting.com/support/edu/wordpress/wordpress-user-role-editor/) for further flexibility with custom Matomo capabilities:

- superuser_matomo
- admin_matomo
- write_matomo
- view_matomo

### Tracking Exclusions

The *Exclusions* tab helps you clean up analytics by excluding the following from tracking:

- WordPress user roles
- IP addresses for [proxy servers](https://www.inmotionhosting.com/support/edu/wordpress/wordpress-nginx-reverse-proxy-caching/) or specific networks
- Query URL parameters such as affiliate campaign links
- User agents, useful for ignoring some [crawl bots](https://www.inmotionhosting.com/support/website/seo/search-engine-crawlers-automated-robots-not-being-controlled/)
- Fragments ([HTML anchors](https://www.inmotionhosting.com/support/edu/wordpress/gutenberg/add-anchor-links-with-gutenberg-wordpress/))

After any updates, **Save changes**.

### Geolocation for Matomo Analytics

As mentioned earlier, Matomo uses [DB-IP](https://db-ip.com/) for IP geolocation in analytics. Users wanting more accurate location results in WordPress can [create a MaxMind account](https://www.inmotionhosting.com/support/edu/wordpress/woocommerce/how-to-set-up-maxmind-geolocation-in-woocommerce/). Then, add the **MaxMind license key** to your *Geolocation* settings. **Save changes**.

If you want to be [General Data Protection Regulation (GDPR)](https://www.inmotionhosting.com/support/edu/wordpress/how-to-use-jetpack-for-gdpr-compliance/) or [California Consumer Privacy Act (CCPA)](https://www.inmotionhosting.com/blog/privacy-policy-updated/) 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](https://www.inmotionhosting.com/support/email/create-matomo-email-reports/).

![Matomo Analytics Reporting](https://www.inmotionhosting.com/support/wp-content/uploads/2020/12/wordpress-matomo-dashboard-1024x576.png)

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 analytics
- **Marketplace** for installing Matomo plugins
- **Diagnostics** for possible website, database, or server issues

Learn more ways to enhance your website through our [WordPress Education Channel](https://www.inmotionhosting.com/support/edu/wordpress/).

Improve the performance and security of your WordPress website with our [WordPress VPS Hosting](https://www.inmotionhosting.com/vps-hosting/wordpress?mktgp=t&irgwc=1&affiliates=5001860&utm_campaign=Jumbotron&utm_source=supportcenter&utm_medium=cta&utm_term=wp-hosting-performance) plans. Featuring blazing fast servers with advanced caching, 99.99% uptime, and a robust toolkit developed by WordPress experts.

![check mark](https://design.inmotionhosting.com/assets/legacy/images/check.svg)Improve Core Web Vitals ![check mark](https://design.inmotionhosting.com/assets/legacy/images/check.svg)Free SSL & Dedicated IP ![check mark](https://design.inmotionhosting.com/assets/legacy/images/check.svg)Advanced Server Caching ![check mark](https://design.inmotionhosting.com/assets/legacy/images/check.svg)US & EU Data Centers

[VPS for WordPress](https://www.inmotionhosting.com/vps-hosting/wordpress?mktgp=t&irgwc=1&affiliates=5001860&utm_campaign=Jumbotron&utm_source=supportcenter&utm_medium=cta&utm_term=wp-hosting-performance)
