Embedding Matomo is easy. It works much like embedding a YouTube video. You just need to copy and paste a line of code into any context where you can use an iframe tag. Many blogs and most websites will let you do this. Let’s take a look at how you can embed Matomo in a WordPress website. WordPress is one of the most popular open source content management systems. The process is very similar whatever piece of software you are using.

Change User Permissions

First, you have to configure permissions. By default, Matomo will not let other people see your data. You can make your data public in one of two ways:

Publish in a public website or app

By default, report data and all information in your Matomo server are protected and nobody can access it. To view and access any analytics data, Matomo always asks you to sign in with a valid user account. To embed the widgets without your users having to logging in to view them, follow the steps in How do I make Matomo report data public and viewable by anyone?

Learn more in Manage Users documentation).

Embed Matomo widgets on a password protected or private page

If you embed your analytics widgets on a password protected or private page, we recommend in this case that you follow these steps:

  1. create a new user,
  2. give it “View” access to the website you wish to embed in your password protected page,
  3. login to Matomo using these credentials,
  4. create a token_auth if you don’t have one yet see our FAQ,
  5. copy and paste this &token_auth=your_token_auth_here at the end of the widget URL in the widget embed HTML code.

Note: for security reasons, embedding the reports will only work when you use a token of the “View” permission (if you use a “Write” or “Admin” permission token an error message will be displayed instead.)

Embed a Matomo report in a HTML page

The next step is to choose which Matomo reports you want to embed. In Matomo click in the top right menu on Administration, then click on “Platform > Widgets”. In this page all widgets are listed with live preview. When you preview any widget you will see the embed code (highlighted here in red) underneath the preview:

When you have chosen a widget to embed and copied its code, just go to the website in which you wish to insert it, and paste the code where you want it. In the below image, the top downloads report is inserted into a page of its own.

Note: HTML view is selected because an iframe HTML tag is being pasted in:

When you click save, you will see the familiar Matomo interface embedded in your site:

Preventing scrollbars from showing up

Starting from Matomo 3.12 you can remove scroll bars by making use of the iframe-resizer library. The iframe will then no longer have a fixed height. Instead, the height of the iframe will be automatically adjusted to the height of the content height of the iframe. That means no vertical scroll bars will be shown for the iframe. To activate this behaviour, simply follow the instructions of the iframe-resizer library:

  • Give your iframe an id, for example matomoframe: <iframe id="matomoframe" ...>
  • Embed this HTML snippet into your site that embeds the iframe: <script>iFrameResize({ log: true }, '#matomoframe')</script>

Customising the widgets

To customise the widget date, website id or initial view (table, graph chart, table showing goal metrics) you can edit the parameters in the URL in the embed code:

  • idSite – website ID
  • period – day, week, month, or year
  • date – a date (YYYY-MM-DD), date range (YYYY-MM-DD,YYYY-MM-DD), or alias (e.g., ‘today’)
  • disableLink – typically set to 1; when enabled, clicking on the evolution graph redirects the page to the Matomo dashboard
  • viewDataTable – defines the widget ‘view’, and can have the following values:
    • tableAllColumns
    • tableGoals
    • table
    • cloud
    • graphPie
    • graphVerticalBar
    • graphEvolution
  • show_footer – Some reports let you hide the report footer by setting this parameter to 0

For example, to show widget data as a Bar Chart by default, you can set in the widget URL


Embed the Matomo dashboard in a HTML page

As well as embedding single reports, you can also embed the full Matomo Dashboard. In Matomo, click on Administration in the top right corner, then “Platform > Widgets”. In this page you will find the link to embed the full dashboard. This can be very useful for users who wish to integrate Matomo inside another dashboard or app.

Embed the full Matomo app anywhere

You may also embed the full Matomo application within an Iframe. To make this work, a small change to the config file is required: see this FAQ.
Once you have configured the INI setting to allow iframes, you can embed the full Matomo App directly in any HTML page in an iframe.

Embed a static image graph of your analytics data

It is also possible to include a PNG image (line graph, vertical bar graph or pie chart) that plots the data for any Matomo report. For more information, check out the documentation about Embedding Static Graph Images.

Using the Reporting HTTP APIs to request any report data or raw data

All the raw user data in Matomo, as well as all your report data, can be exported with our powerful Reporting APIs. So you can use the Reporting API to fetch any report and display the data in your own app, JavaScript, chart system, etc.

Making Matomo reports data publicly available

By default all your analytics data is protected by Matomo, and users must sign in with a valid account that has permission to view the data. In some cases (although rarely), you may want to make your analytics data publicly accessible. Learn more in this FAQ: How do I make Matomo report data public and viewable by anyone?.


Email reports

You may also share Matomo reports using the scheduled email reports feature.

Tracking mini-sites separately to give users specific permissions

When your website or app includes multiple “sections” (or page “categories” or “mini-sites”), you may want to track and report them separately from each other and give several people access to specific sections or mini-sites: learn more this guide.