Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bezhanSalleh/filament-google-analytics
Google Analytics integration with Filamentphp (FilamentAdmin)
https://github.com/bezhanSalleh/filament-google-analytics
analytics filament-analytics filamentadmin filamentphp google-analytics laravel livewire
Last synced: 3 months ago
JSON representation
Google Analytics integration with Filamentphp (FilamentAdmin)
- Host: GitHub
- URL: https://github.com/bezhanSalleh/filament-google-analytics
- Owner: bezhanSalleh
- License: mit
- Created: 2022-02-21T18:26:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-08T13:48:42.000Z (4 months ago)
- Last Synced: 2024-07-20T01:51:52.225Z (4 months ago)
- Topics: analytics, filament-analytics, filamentadmin, filamentphp, google-analytics, laravel, livewire
- Language: PHP
- Homepage:
- Size: 311 KB
- Stars: 153
- Watchers: 6
- Forks: 29
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
- awesome-filament - bezhanSalleh/filament-google-analytics - Google Analytics integration with the Filament Admin. (Analytics)
README
# Filament Google Analytics (GA4)
Google Analytics integration for [Filament (FilamentAdmin)](https://filamentphp.com)# Installation
You can install the package in to a Laravel app that uses [Filament](https://filamentphp.com) via composer:
```bash
composer require bezhansalleh/filament-google-analytics
```For now, follow the directions on [Spatie's Laravel Google Analytics package](https://github.com/spatie/laravel-analytics) for getting your credentials, then put them here:
```
yourapp/storage/app/analytics/service-account-credentials.json
```Also add this to the `.env` for your Filament PHP app:
```ini
ANALYTICS_PROPERTY_ID=
```# Usage
All the widgets are enabled by default in a dedicated `Google Analytics Dashboard`. You can enable or disable a specific widget or the dedicated dashboard all together or show and hide some from the main `Filament Dashboard` from the config `filament-google-analytics`.
Publish the config files and set your settings:
```bash
php artisan vendor:publish --tag=filament-google-analytics-config
```#### Available Widgets
```php
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\PageViewsWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\VisitorsWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\ActiveUsersOneDayWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\ActiveUsersSevenDayWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\ActiveUsersTwentyEightDayWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\SessionsWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\SessionsDurationWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\SessionsByCountryWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\SessionsByDeviceWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\MostVisitedPagesWidget::class,
\BezhanSalleh\FilamentGoogleAnalytics\Widgets\TopReferrersListWidget::class,
```#### Custom Dashboard
Though this plugin comes with a default dashboard, but sometimes you might want to change `navigationLabel` or `navigationGroup` or disable some `widgets` or any other options and given that the dashboard is a simple filament `page`; The easiest solution would be to disable the default dashboard and create a new `page`:```bash
php artisan filament:page MyCustomDashboardPage
```
then register the widgets you want from the **Available Widgets** list either in the `getHeaderWidgets()` or `getFooterWidgets()`:
```php#### View the Active Users Metrics
#### View the Sessions and Avg. Session Duration Metrics
#### View the Devices and Country Metrics by Session (WIP)
#### View the lists of Most Visited Pages and Referrers
# Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
# Contributing
If you want to contribute to this packages, you may want to test it in a real Filament project:- Fork this repository to your GitHub account.
- Create a Filament app locally.
- Clone your fork in your Filament app's root directory.
- In the `/filament-google-analytics` directory, create a branch for your fix, e.g. `fix/error-message`.Install the packages in your app's `composer.json`:
```json
"require": {
"bezhansalleh/filament-google-analytics": "dev-fix/error-message as main-dev",
},
"repositories": [
{
"type": "path",
"url": "filament-google-analytics"
}
]
```Now, run `composer update`.
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
# Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
# Credits
- [Bezhan Salleh](https://github.com/bezhanSalleh)
- [Laravel Analytics](https://github.com/spatie/laravel-analytics) By [Spatie](https://github.com/spatie)
- [Nova Google Analytics](https://github.com/tighten/nova-google-analytics) By [Tighten](https://github.com/tighten)
- [All Contributors](../../contributors)# License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.