{"id":15016855,"url":"https://github.com/bezhansalleh/filament-google-analytics","last_synced_at":"2026-03-01T02:12:54.861Z","repository":{"id":41872151,"uuid":"461983658","full_name":"bezhanSalleh/filament-google-analytics","owner":"bezhanSalleh","description":"Google Analytics integration with Filamentphp (FilamentAdmin)","archived":false,"fork":false,"pushed_at":"2025-05-12T13:37:39.000Z","size":1238,"stargazers_count":188,"open_issues_count":1,"forks_count":34,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-15T10:06:19.383Z","etag":null,"topics":["analytics","filament-analytics","filamentadmin","filamentphp","google-analytics","laravel","livewire"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bezhanSalleh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"bezhanSalleh"}},"created_at":"2022-02-21T18:26:26.000Z","updated_at":"2025-05-12T13:37:36.000Z","dependencies_parsed_at":"2023-12-30T23:28:13.372Z","dependency_job_id":"a33feb03-769b-4466-8721-262653af14ca","html_url":"https://github.com/bezhanSalleh/filament-google-analytics","commit_stats":{"total_commits":131,"total_committers":14,"mean_commits":9.357142857142858,"dds":0.3740458015267175,"last_synced_commit":"466132686be011557da30676c65d38953089a011"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":"spatie/package-skeleton-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezhanSalleh%2Ffilament-google-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezhanSalleh%2Ffilament-google-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezhanSalleh%2Ffilament-google-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezhanSalleh%2Ffilament-google-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bezhanSalleh","download_url":"https://codeload.github.com/bezhanSalleh/filament-google-analytics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319720,"owners_count":22051073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","filament-analytics","filamentadmin","filamentphp","google-analytics","laravel","livewire"],"created_at":"2024-09-24T19:49:28.875Z","updated_at":"2026-01-19T21:02:46.683Z","avatar_url":"https://github.com/bezhanSalleh.png","language":"PHP","funding_links":["https://github.com/sponsors/bezhanSalleh"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/bezhansalleh/filament-google-analytics\" class=\"filament-hidden\"\u003e\n\u003cimg style=\"width: 100%; max-width: 100%;\" alt=\"filament-google-analytics-art\" src=\"https://repository-images.githubusercontent.com/461983658/983ab0b3-a97f-49ab-91a0-7bfd165217e1\" \u003e\n\u003c/a\u003e\n\n\n\u003cp align=\"center\" class=\"flex items-center justify-center\"\u003e\n    \u003ca href=\"https://filamentphp.com/docs/4.x/panels/installation\"\u003e\n        \u003cimg alt=\"FILAMENT 4.x\" src=\"https://img.shields.io/badge/FILAMENT-4.x-EBB304?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://filamentphp.com/docs/5.x/panels/installation\"\u003e\n        \u003cimg alt=\"FILAMENT 5.x\" src=\"https://img.shields.io/badge/FILAMENT-5.x-EBB304?style=for-the-badge\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/bezhansalleh/filament-google-analytics\"\u003e\n        \u003cimg alt=\"Packagist\" src=\"https://img.shields.io/packagist/v/bezhansalleh/filament-google-analytics.svg?style=for-the-badge\u0026logo=packagist\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/bezhansalleh/filament-google-analytics/actions?query=workflow%3A\"Check+%26+fix+styling\"+branch%3Amain\" class=\"filament-hidden\"\u003e\n        \u003cimg alt=\"Code Style Passing\" src=\"https://img.shields.io/github/actions/workflow/status/bezhansalleh/filament-google-analytics/laravel-pint.yml?style=for-the-badge\u0026logo=github\u0026label=code%20style\"\u003e\n    \u003c/a\u003e\n\n\u003ca href=\"https://packagist.org/packages/bezhansalleh/filament-google-analytics\"\u003e\n    \u003cimg alt=\"Downloads\" src=\"https://img.shields.io/packagist/dt/bezhansalleh/filament-google-analytics.svg?style=for-the-badge\" \u003e\n    \u003c/a\u003e\n\u003cp\u003e\n\n# Google Analytics (GA4)\nGoogle Analytics integration for [Filament Panels](https://filamentphp.com) with a set of widgets to display your analytics data in a beautiful way.\n\n#### Compatibility\n\n| Package Version | Filament Version | \n|----------------|---------------------|\n| [1.x](https://github.com/bezhanSalleh/filament-google-analytics/tree/1.x) | [2.x](https://filamentphp.com/docs/2.x/admin/installation) |\n| [2.x](https://github.com/bezhanSalleh/filament-google-analytics/tree/2.x) | [3.x](https://filamentphp.com/docs/3.x/panels/installation) |\n| 3.x | [4.x](https://filamentphp.com/docs/4.x/introduction/overview) \u0026 [5.x](https://filamentphp.com/docs/4.x/introduction/overview) |\n\n## Upgrading from v2 to v3\n\nIf you are upgrading from version 2 to version 3, you will need to update the namespace anywhere you are using the plugin from `BezhanSalleh\\FilamentGoogleAnalytics` to `BezhanSalleh\\GoogleAnalytics`.\n\n# Installation\n\nYou can install the package in to a Laravel app that uses [Filament](https://filamentphp.com) via composer:\n\n```bash\ncomposer require bezhansalleh/filament-google-analytics\n```\n\nFor 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:\n\n```\nyourapp/storage/app/analytics/service-account-credentials.json\n```\n\nAlso add this to the `.env` for your Filament PHP app:\n\n```ini\nANALYTICS_PROPERTY_ID=\n```\n\u003e [!IMPORTANT]\n\u003e If you have not set up a custom theme and are using Filament Panels follow the instructions in the [Filament Docs](https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme) first.\n\nAfter setting up a custom theme add the following to your theme css file.\n\n```css\n@source '../../../../vendor/bezhansalleh/filament-google-analytics/resources/views/**/*';\n@source '../../../../vendor/bezhansalleh/filament-google-analytics/src/{Widgets,Support}/*';\n```\n\n```php\npublic function panel(Panel $panel): Panel\n{\n    return $panel\n        -\u003eplugins([\n            ...\n            \\BezhanSalleh\\GoogleAnalytics\\GoogleAnalyticsPlugin::make()\n        ]);\n}\n```\n\n# Usage\n\nAll the widgets are enabled by default for you to use them in your filament pages/resources. In order to enable the widgets for the default filament dashboard, you need to set the `filament_dashboard` option to `true` in the config file `google-analytics.php` for each widget you want to enable.\n\nPublish the config files and set your settings:\n```bash\n php artisan vendor:publish --tag=google-analytics-config\n```\n\n#### Available Widgets\n\n```php\nuse BezhanSalleh\\GoogleAnalytics\\Widgets;\n\nWidgets\\PageViewsWidget::class,\nWidgets\\VisitorsWidget::class,\nWidgets\\ActiveUsersOneDayWidget::class,\nWidgets\\ActiveUsersSevenDayWidget::class,\nWidgets\\ActiveUsersTwentyEightDayWidget::class,\nWidgets\\SessionsWidget::class,\nWidgets\\SessionsByCountryWidget::class,\nWidgets\\SessionsDurationWidget::class,\nWidgets\\SessionsByDeviceWidget::class,\nWidgets\\MostVisitedPagesWidget::class,\nWidgets\\TopReferrersListWidget::class,\n```\n\n#### Custom Dashboard\nThough 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`:\n\n```bash\nphp artisan filament:page MyCustomDashboardPage\n```\nthen register the widgets you want from the **Available Widgets** list either in the `getHeaderWidgets()` or `getFooterWidgets()`:\n\n```php\n\u003c?php\n\nnamespace App\\Filament\\Pages;\n\nuse Filament\\Pages\\Page;\nuse BezhanSalleh\\GoogleAnalytics\\Widgets;\n\nclass MyCustomDashboardPage extends Page\n{\n    protected static ?string $navigationIcon = 'heroicon-o-document-text';\n\n    protected static string $view = 'filament.pages.my-custom-dashboard-page';\n\n    protected function getHeaderWidgets(): array\n    {\n        return [\n            Widgets\\PageViewsWidget::class,\n            Widgets\\VisitorsWidget::class,\n            Widgets\\ActiveUsersOneDayWidget::class,\n            Widgets\\ActiveUsersSevenDayWidget::class,\n            Widgets\\ActiveUsersTwentyEightDayWidget::class,\n            Widgets\\SessionsWidget::class,\n            Widgets\\SessionsByCountryWidget::class,\n            Widgets\\SessionsDurationWidget::class,\n            Widgets\\SessionsByDeviceWidget::class,\n            Widgets\\MostVisitedPagesWidget::class,\n            Widgets\\TopReferrersListWidget::class,\n        ];\n    }\n}\n```\n\u003e [!NOTE]  \n\u003e In order to enable the widgets for the default filament dashboard, you need to set the `filament_dashboard` option to `true` in the config file `google-analytics.php` for each widget you want to enable.\n\n# Preview\nWidgets rendered in a dedicated dashboard (or any other page you create)\n![Demo](https://github.com/bezhanSalleh/filament-google-analytics/blob/main/previews/v4-art.png?raw=true \"Filament GA4 Preview\")\n![Demo](https://github.com/bezhanSalleh/filament-google-analytics/blob/main/previews/v4-art2.png?raw=true \"Filament GA4 Preview\")\n\n# Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n# Contributing\nIf you want to contribute to this packages, you may want to test it in a real Filament project:\n\n- Fork this repository to your GitHub account.\n- Create a Filament app locally.\n- Clone your fork in your Filament app's root directory.\n- In the `/filament-google-analytics` directory, create a branch for your fix, e.g. `fix/error-message`.\n\nInstall the packages in your app's `composer.json`:\n\n```json\n\"require\": {\n    \"bezhansalleh/filament-google-analytics\": \"dev-fix/error-message as main-dev\",\n},\n\"repositories\": [\n    {\n        \"type\": \"path\",\n        \"url\": \"filament-google-analytics\"\n    }\n]\n```\n\nNow, run `composer update`.\n\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n# Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n# Credits\n\n- [Bezhan Salleh](https://github.com/bezhanSalleh)\n- [Laravel Analytics](https://github.com/spatie/laravel-analytics) By [Spatie](https://github.com/spatie)\n- [Nova Google Analytics](https://github.com/tighten/nova-google-analytics) By [Tighten](https://github.com/tighten)\n- [All Contributors](../../contributors)\n\n# License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezhansalleh%2Ffilament-google-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbezhansalleh%2Ffilament-google-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezhansalleh%2Ffilament-google-analytics/lists"}