Download the PHP package flowpack/neos-matomo without Composer

On this page you can find all versions of the php package flowpack/neos-matomo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package neos-matomo

Neos Matomo Package

Version license

Track visits of your Neos site with Matomo (Piwik) Open Analytics Platform!

This package integrates the Matomo Open Analytics Platform into Neos and is also compatible with older Piwik installations.

Features

Inspired by the packages neos/neos-googleanalytics and khuppenbauer/MapSeven.Piwik.

Initially this package was called portachtzig/neos-piwik. Thanks to the creators @koernchen02 and @sarahRehbock for all their work!


Matomo - Open Analytics Platform https://matomo.org/


Requirements

Compatibility with older versions

The version 2 of this package is still compatible with Piwik instances but might at some point not work anymore when Matomo gets a bigger update.

Always check that your tracking software is up-to-date and use the latest releases of this package if possible.


Installation

Run the following command in your site package

composer require --no-update flowpack/neos-matomo

Then run composer update in your project root.

Updating from neos-piwik to neos-matomo

Instead of requiring portachtzig/neos-piwik you should now require flowpack/neos-matomo in your composer.json.

Also if you use or override Portachtzig.Neos.Piwik:StatsTabMixin you'll have to change the naming
in your own NodeType configurations to Flowpack.Neos.Matomo:StatsTabMixin.

In your configuration file you have to change the path

Portachtzig:
  Neos:
    Piwik:

to

Flowpack:
  Neos:
    Matomo:

Also we added caching for the api requests. Therefore by default the statistics will be kept up to 5 minutes before a refresh occurs.

Configuration

After the package has been installed, there will be an additional Backend Module in Neos, called "Matomo". Depending on your current FLOW_CONTEXT you might want to flush the cache.

To connect Neos with your Matomo installation you just have to enter some properties in your Settings.yaml to track your user's statistics. You can have the configuration in your site package or add it during deployment. You can also use the included backend module then to verify your configuration.

This is an example of how it can look:

Flowpack:
  Neos:
    Matomo:
      host: 'tracking.example.org'
      protocol: 'https'
      token_auth: 'abcdefg1234567890'
      idSite: 1                                           
      containerId: 'abcdef' # Optional
      system: 'matomo' # Optional, "matomo" or "piwik"
      apiTimeout: 10 
      cacheLifetimeByPeriod:
        year: 86400
        day: 3600

Additional features

Tracking Opt-Out content element

This package provides a small configurable iframe content element for Neos which allows users to manually opt out of the tracking if "Do-Not-Track" is not enabled in their browser. The content of the iframe is loaded from the configured tracking host.

You can adjust all settings that Matomo offers via their API.

API request caching

By default the requests to the Matomo API will be cached depending on the period of the stat that is being checked. Some information is shown based on a period of a year. Here we use a default timeout of 1 day. Other stats are for one to several days. Here the preset for the timeout is 1 hour.

The timeouts by period can be overriden in your Settings.yaml. See the example above.

You can override the cache backend settings of this package in your own Caches.yaml:

FlowpackNeosMatomo_ApiCache:
  backend: Neos\Cache\Backend\FileBackend
  backendOptions:
    defaultLifetime: 300

And if you don't want caching at all, just use the backend Neos\Cache\Backend\NullBackend instead of the configured FileBackend.

Accessing the Matomo API

You can access the Matomo API through this package by injecting the Flowpack\Neos\Matomo\Service\Reporting class.

You can then use the public method callAPI($methodName, $arguments = [], $useCache = true) to call any API method of Matomo and you will get the json decoded response as array. Some methods will need specific user permissions, if your tokens user doesn't have them a error message will be in the array.

Multi site compatibility

The Matomo site id and token in the Settings.yaml can also be defined as array and this way you can configure as many sites as you want. The plugin will then check for the current sites nodename in this array. If no matching site is found, the first entry will be used.

See this example with one token but several sites:

Flowpack:
  Neos:
    Matomo:
      host: tracking.example.org
      token_auth: 12345678910
      idSite:
        myfirstsite: 1
        mysecondsite: 2
        mythirdsite: 2

And the same when used with tag manager:

Flowpack:
  Neos:
    Matomo:
      host: tracking.example.org
      token_auth: 12345678910     
      idSite:
        myfirstsite: 1
        mysecondsite: 2
        mythirdsite: 2
      containerId:
        myfirstsite: 'abc'
        mysecondsite: 'def'
        mythirdsite: 'ghi'

License

Neos Matomo Package is released under the GPL v3 (or later) license.

Screenshots

Backend view with selected Matomo Panel in the Property Inspector

visits per day in the last month

visits per day in the last week

all time visits and page views (hits) of the selected page

visits per browser (all time)

visits per os (all time)

visits per device category (all time)


All versions of neos-matomo with dependencies

PHP Build Version
Package Version
Requires neos/neos Version ^5.3 || ^7.0 || ^8.0
ext-curl Version *
guzzlehttp/psr7 Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package flowpack/neos-matomo contains the following files

Loading the files please wait ....