All Projects → andreaselia → laravel-analytics

andreaselia / laravel-analytics

Licence: MIT license
Analytics for the Laravel framework.

Programming Languages

PHP
23972 projects - #3 most used programming language
Blade
752 projects

Projects that are alternatives of or similar to laravel-analytics

Logarr
“Logarr” is a self-hosted PHP web app that consolidates, formats, and displays log and text files for easy analysis and monitoring.
Stars: ✭ 216 (+56.52%)
Mutual labels:  self-hosted
Self Hosted Docker Server Templates
Just some templates to get someone started with hosting various servers in Docker
Stars: ✭ 237 (+71.74%)
Mutual labels:  self-hosted
Remark42
comment engine
Stars: ✭ 3,365 (+2338.41%)
Mutual labels:  self-hosted
Maloja
Self-hosted music scrobble database to create personal listening statistics and charts
Stars: ✭ 223 (+61.59%)
Mutual labels:  self-hosted
Homepage
A simple, standalone, self-hosted PHP page that is your window to your server and the web.
Stars: ✭ 234 (+69.57%)
Mutual labels:  self-hosted
Self Hosted Cookbook
A cookbook, for docker-compose based recipes, for self-hosted applications and services.
Stars: ✭ 244 (+76.81%)
Mutual labels:  self-hosted
Goploader
Easy file sharing with server-side encryption, curl/httpie/wget compliant
Stars: ✭ 205 (+48.55%)
Mutual labels:  self-hosted
mark-idea
一款私有云笔记,git + markdown
Stars: ✭ 182 (+31.88%)
Mutual labels:  self-hosted
Docsbox
Self-hosted document converting service with HTTP API
Stars: ✭ 235 (+70.29%)
Mutual labels:  self-hosted
Suri
Your own link shortener that's easily deployed as a static site (for free)
Stars: ✭ 249 (+80.43%)
Mutual labels:  self-hosted
Magnetissimo
Web application that indexes all popular torrent sites, and saves it to the local database.
Stars: ✭ 2,551 (+1748.55%)
Mutual labels:  self-hosted
Wakapi
📊 A minimalist, self-hosted WakaTime-compatible backend for coding statistics
Stars: ✭ 232 (+68.12%)
Mutual labels:  self-hosted
Dplatform Shell
Deploy self-hosted apps easily: simple, bloat-free, independent installation
Stars: ✭ 245 (+77.54%)
Mutual labels:  self-hosted
Magnetico
Autonomous (self-hosted) BitTorrent DHT search engine suite.
Stars: ✭ 2,626 (+1802.9%)
Mutual labels:  self-hosted
Awesome Selfhosted
A list of Free Software network services and web applications which can be hosted on your own servers
Stars: ✭ 70,996 (+51346.38%)
Mutual labels:  self-hosted
Viewscreen
Viewscreen - a personal video streaming server
Stars: ✭ 215 (+55.8%)
Mutual labels:  self-hosted
Server
self-hosted tag-based time tracking
Stars: ✭ 238 (+72.46%)
Mutual labels:  self-hosted
vindigo
📝 A brand new kanban inspired planning tool for all your projects. 💻
Stars: ✭ 52 (-62.32%)
Mutual labels:  self-hosted
flagsmith
Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
Stars: ✭ 2,309 (+1573.19%)
Mutual labels:  self-hosted
Waveline Server
Simple self-hosted music streaming server
Stars: ✭ 248 (+79.71%)
Mutual labels:  self-hosted

Laravel Analytics

Latest Stable Version

Easily collect page view analytics with a beautifully simple to use dashboard.

Laravel Analytics Dashboard

Installation

Install the package:

composer require andreaselia/analytics

Publish the config file and assets:

php artisan vendor:publish --provider="AndreasElia\Analytics\AnalyticsServiceProvider"

Don't forget to run the migrations:

php artisan migrate

You can add the page view middleware to a specific route group, e.g. web.php like so:

Route::middleware('analytics')->group(function () {
    // ...
});

Or add the page view to all middlewares/on an application level like so:

// app/Http/Kernel.php

protected $middleware = [
    // ...
    \AndreasElia\Analytics\Http\Middleware\Analytics::class,
];

Configuration

Excluding routes

You can exclude certain routes from being tracked by adding them to the exclude array in the analytics.php config file.

Masking routes

You can mask certain routes from being tracked by adding them to the mask array in the analytics.php config file. This is useful if you want to track the same route with different parameters, e.g. /users/1 and /users/2 will be tracked as /users/∗︎.

Changing how session_id is determined

By default, session_id in the page_views table is filled with the session ID of the current request. However, in certain scenarios (for example, for API and other requests not using cookies), the session is unavailable.

In these cases, you can create a custom session ID provider: create a class that implements the AndreasElia\Analytics\Contracts\SessionProvider interface and set its name as the provider option in the analytics.php config file. The configured class object is resolved from the container, therefore, dependency injection can be used via the __constructor.

One example of a custom way to generate the session ID in cookie-less environment is to hash IP address + User Agent + some other headers from the request.

Feel free to take a look at AndreasElia\Analytics\RequestSessionProvider for an example of implementing the SessionProvider interface.

Laravel Nova

The package comes with a dashboard and metrics for Laravel Nova.

Dashboard

You can add the dashboard to Laravel Nova by adding new \AndreasElia\Analytics\Nova\Dashboards\Analytics to dashboards array in your NovaServiceProvider:

    protected function dashboards(): array
    {
        return [
            new \AndreasElia\Analytics\Nova\Dashboards\Analytics,
        ];
    }

Metrics

Alternatively, you can add the metrics to your own Laravel Nova dashboard by adding them to the cards array in your dashboard file.

    protected function cards(): array
    {
        return [
            new \AndreasElia\Analytics\Nova\Metrics\Devices,
            new \AndreasElia\Analytics\Nova\Metrics\PageViews,
            new \AndreasElia\Analytics\Nova\Metrics\UniqueUsers,
        ];
    }

Contributing

You're more than welcome to submit a pull request, or if you're not feeling up to it - create an issue so someone else can pick it up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].