tightenco / nova-google-analytics
Google Analytics integration with Nova
Installs: 43 379
Dependents: 1
Suggesters: 0
Security: 0
Stars: 85
Watchers: 15
Forks: 14
Open Issues: 7
Requires
- php: >=7.1.0
- laravel/nova: *
- spatie/laravel-analytics: ^3.6
Requires (Dev)
- phpunit/phpunit: 7.1
This package is auto-updated.
Last update: 2021-01-15 15:56:33 UTC
README
JUST GETTING STARTED.
Plans:
- Analytics tool
- Individual cards for each of the useful analytics data points
- Resource tools (e.g. analytics on each page)
- Maybe actions for events?
- Other great stuff I hope :)
Installation
You can install the package in to a Laravel app that uses Nova via composer:
composer require tightenco/nova-google-analytics
Next up, you must register the card with Nova. This is typically done in the cards
method of the NovaServiceProvider
.
// in app/Providers/NovaServiceProvider.php // ... public function cards() { return [ // ... new \Tightenco\NovaGoogleAnalytics\PageViewsMetric, new \Tightenco\NovaGoogleAnalytics\VisitorsMetric, new \Tightenco\NovaGoogleAnalytics\MostVisitedPagesCard, ]; }
For now, follow the directions on Spatie's Laravel Google Analytics package for getting your credentials, then put them here:
yourapp/storage/app/analytics/service-account-credentials.json
Also add this to the .env
for your Nova app:
ANALYTICS_VIEW_ID=
Security
If you discover any security related issues, please email matt@tighten.co instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.