Download the PHP package rs/matomo-google-charts without Composer

On this page you can find all versions of the php package rs/matomo-google-charts. 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 matomo-google-charts

Matomo Google Charts

A Laravel package for building analytics dashboards using data from Matomo and Google Charts. It fetches analytics data from a Matomo instance, caches it, and transforms it into Google Charts-compatible data structures that can be served as JSON API resources.

Requirements

Installation

The package uses Laravel's auto-discovery, so the service provider and facade are registered automatically.

Publish the config

This publishes config/piwik.php.

Environment variables

Add the following to your .env file:

When MATOMO_API_ENABLED is false (the default), the package uses a fake API implementation that returns empty data, allowing you to develop without a live Matomo connection.

Configuration

The published config/piwik.php file contains all available options:

Key Description Default
api_enabled Enable live Matomo API calls false
piwik_url Matomo server URL https://matomo.redsnapper.net
api_key Matomo authentication token null
format API response format (json, xml, php, etc.) json
period Default period for API queries last30
site_id Default Matomo site ID null
verify_peer SSL certificate verification true
http_timeout HTTP request timeout (seconds) 500.0

Usage

Creating chart types

Define your chart by extending AnalyticsChart. Set the chart metadata as properties and override query() to fetch data from the Matomo API:

The $properties array maps Matomo response fields to chart columns. The $columns array provides the column headings. The base class automatically processes the raw Matomo data into a format compatible with Google Charts.

Creating mini charts (with comparison)

Mini charts show a metric with a comparison against a previous period. Extend AnalyticsMiniChart:

Available icons: calendar, globe, monitor, views, visitors.

Using the facade

Use the MatomoChart facade to create charts and JSON resources in your controllers:

Date filtering

Date ranges are automatically resolved from the HTTP request query parameters:

Parameter Description Default
dateFrom Start date (any Carbon-parseable string) Start of previous month
dateTo End date (any Carbon-parseable string) End of previous month

A comparison period of equal length is automatically computed from the primary date range.

Chart resource JSON structure

AnalyticsChartResource returns:

AnalyticsMiniChartResource additionally includes:

Available chart types

Enum Google Charts type
AnalyticsChartType::GEO GeoChart
AnalyticsChartType::COLUMN ColumnChart
AnalyticsChartType::LINE LineChart
AnalyticsChartType::PIE PieChart
AnalyticsChartType::STANDARD_TABLE StandardTable

Available Matomo data fetchers

The MatomoAPIInterface provides methods you can use in your chart's query() method:

All fetch methods are chainable and return a MatomoCollection (extended Laravel Collection) via ->get().

Caching

API responses are automatically cached until midnight using Laravel's cache system. Cache keys are scoped by site ID, segment, and date range to avoid collisions.

Testing

License

MIT


All versions of matomo-google-charts with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
spatie/data-transfer-object Version ^3.9
robbrazier/piwik Version ^4.2
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 rs/matomo-google-charts contains the following files

Loading the files please wait ...