Skip to content

Latest commit

 

History

History
50 lines (26 loc) · 3.06 KB

File metadata and controls

50 lines (26 loc) · 3.06 KB

Installation instructions for Matomo

Matomo is an open source platform, that allows for a free On_Premise version, that you can download and install on your own server. These instructions will not go through how to install Matomo, assuming you already have the platform all set up. On their website, you can find the installation instructions.

1 - The tracking code

When installing the software, a tracking code should be provided to you, but if not, or you're creating a new site in the platform, you can get it by accessing Administration

Screenshot of the notice

And then Websites->Tracking Code

Screenshot of the notice

When opening it, a piece of code is presented to be copied and pasted into your site. Copy it and place it in the AtoM theme (see below - 2).

Screenshot of the code to install

2 - Placing the code in AtoM's site

Now, you can take the code you copied and place it in the _footer.php file of your theme.
If you don't have a theme setup, AtoM's default theme is arDominionPlugin, located in the plugins folder of your AtoM installation. Now, ideally, you should create a new theme, based on the arDominionPlugin and make the changes there (see https://accesstomemory.org/en/docs/2.7/admin-manual/customization/theming/#customization-theming on how to create it), or you can change the theme directly (note that it will probably be overridden when you update Atom, so track the changes you make).

The _footer.php file
You may have noticed, if you've been following the instructions and making the changes at the same time, that there is no _footer.php file in the plugin folder. That's because any custom plugins, in Symfony (the framework on what AtoM is built on) can override existing files. In the case of AtoM, the file needed to be overridden is located at /apps/qubit/templates/_footer.php.

Screenshot of installation folder location

This means you have to recreate the path in the plugin, by creating a new folder called templates and a file, _footer.php, inside.

Screenshot of the folder and file to create

After that, copy the original file's content (the one from /app/qubit/_footer.php), and add, at the top, right below the <footer> tag, the tracking code from the Matomo dashboard setup.

Screenshot of the code to add

Everything should be set up now.

3 - Removing ourselves from the counts

I'm not absolutely sure if, and how, is possible to remove the site's internal users from the total count of hits through the Matomo administration, but, to prevent logged in users or administrators of the AtoM instance from being counted, you can add checks to the code, like this:

Removing Administrators

Screenshot of the code to change to remove admins

Removing authenticated users

Screenshot of the code to change to logged in users