Download the PHP package mlstephane/laravel-analytics without Composer

On this page you can find all versions of the php package mlstephane/laravel-analytics. 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 laravel-analytics

Laravel Analytics

Latest Version on Packagist Total Downloads PHP Version

Privacy-first analytics and observability for Laravel: track visitors and user actions — pageviews, sessions, referrers, environments, bounce rate and visit duration — and read everything on a built-in dashboard. No cookies, no personal data, no IP addresses stored. Inspired by Umami.

Features

Requirements

Installation

You can install the package via composer:

The service provider and the Analytics facade are auto-discovered. Migrations are loaded automatically by the package — just run:

Publishing the config or the views is optional:

Usage

Quick start

Add the tracker to your layout <head>:

That's it: pageviews are sent automatically. Open the dashboard at /analytics and watch the data arrive.

Tracking events from the browser

The tracker exposes a small global API:

You can also track clicks declaratively with data attributes:

Any extra data-analytics-* attribute is sent as event data.

Tracking events from PHP

Use the Analytics facade:

Server-side events are attached to a single shared visitor (config server.visitor_uuid).

Tracking pageviews with a middleware

Register the alias and apply it to the routes you want tracked server-side:

Event data limits

Event data is normalized server-side (Umami-like rules):

Data type Limit
Properties max 50 per event
Strings max 500 chars
Arrays converted to string, max 500 chars
Numbers rounded to 4 decimals
Event name max 50 chars

Dashboard

The dashboard lives at /analytics (configurable prefix and middleware — default ['web', 'auth']) with periods 24h, 7d, 30d, 90d:

Periods without data are hidden from the period switcher, and clear empty states guide you from the first visit onward.

Geolocation (custom driver)

Country / region / city are resolved through a pluggable resolver. Implement the contract and point the config to your class:

The IP is only used for the lookup and is never stored.

Data retention

Deletes events older than prune.days (default 365, in chunks), then orphaned sessions and visitors.

Configuration

Key Default Description
enabled true Master switch — no route is registered when false
collect.uri analytics/collect POST endpoint used by the tracker
collect.domains [] Allowed referrer/origin domains. Empty = host of app.url, * = any domain
collect.ignore_bots true Skip bot user agents (device-detector)
collect.ignore_paths [] Regex list (preg_match) of paths that are not tracked
collect.ignore_ips [] IPs that are never tracked (private/monitoring)
collect.rate_limit 60 Max requests/minute/IP to the collection endpoint
collect.session_timeout 30 Minutes of inactivity before a visitor starts a new session
dashboard.enabled true Enable the dashboard routes
dashboard.prefix analytics Dashboard URL prefix
dashboard.middleware ['web', 'auth'] Dashboard middleware stack
tracker.auto_track true Automatic pageviews from the JS tracker
tracker.script_path js/tracker.js URL path serving the tracker script. Use a neutral filename: blockers (Brave, uBlock) block any URL ending in analytics.js
tracker.respect_do_not_track true Honor the browser Do-Not-Track flag
geolocation.driver null Class implementing LocationResolver
prune.days 365 Event retention in days
server.visitor_uuid server Visitor uuid used by facade/middleware events

Security model

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please report them privately instead of opening a public issue.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-analytics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^11.0|^12.0|^13.0
matomo/device-detector Version ^6.4
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 mlstephane/laravel-analytics contains the following files

Loading the files please wait ...