Download the PHP package aimeos/laravel-analytics-bridge without Composer
On this page you can find all versions of the php package aimeos/laravel-analytics-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aimeos/laravel-analytics-bridge
More information about aimeos/laravel-analytics-bridge
Files in aimeos/laravel-analytics-bridge
Package laravel-analytics-bridge
Short Description Unified analytics bridge for Laravel
License LGPL-2.1+
Informations about the package laravel-analytics-bridge
Laravel Analytics Bridge
A unified analytics bridge for Laravel providing a consistent API across multiple analytics providers such as Google Analytics, Matomo, and others.
Features
- Unified API for multiple analytics services
- Drivers for Google Analytics, Matomo, and others
- Returns time series (per day) for page views, visits, visit duration
- Aggregates top countries and referrers
- Integrates PageSpeed Insights (CrUX real-user data) for Web Vitals
- Easily extendable with new drivers
Installation
Install the driver package you need:
Configuration
Publish the configuration file:
This creates the ./config/analytics-bridge.php file:
Set your .env variables accordingly and don't forget to configure the
ANALYTICS_DRIVER value using the name of the driver ("cloudflare",
"google", or "matomo").
The value of GOOGLE_AUTH must be the string from the Service Account JSON
key file encoded as base64. To do the encoding on the command line, use:
API Usage
Import the facade:
Page Statistics
Available are:
- views
- visits
- conversions
- durations
- countries
- referrers
It returns arrays with one entry per day, country or URL:
PageSpeed Metrics
Returns:
Google Search Statistics
Returns:
Google Search Queries
Returns:
Google Index Status
Returns something like:
- "Indexed"
- "Not found"
- "Crawled"
- "Discovered"
Implemnt new Driver
For a new analyics service (e.g. Foobar), create a new composer package, e.g.
yourorg/laravel-analytics-foobar. Replace every occurrence of "yourorg" and
"foobar" (in any case) with own vendor name and resp. the service name.
Use this composer.json as template:
Create a ./src/Foobar.php file that implements fetching the data from the
analytics service. The skeleton class is:
Install your package using composer:
Register your driver in config/analytics-bridge.php, e.g.:
Optimize
The google/apiclient package contains classes for all Google APIs (currently
over 300) but only two (SearchConsole and WebIndex) are required. To install
only the required ones, insert this into your composer.json at the correct
places:
When you run composer update afterwards, this will remove the unused services.
Take a look into the Google client README
for details.
License
This package is released under the LGPL-2.1+ License.
All versions of laravel-analytics-bridge with dependencies
illuminate/support Version ^11.0||^12.0||^13.0
google/apiclient Version ^2.0