renoki-co/laravel-firebase-analytics
最新稳定版本:1.2.0
Composer 安装命令:
composer require renoki-co/laravel-firebase-analytics
包简介
Laravel Firebase Analytics adds blade directives to initialize, log events and set user properties for Firebase Analytics.
README 文档
README
Laravel Firebase Analytics adds blade directives to initialize, log events and set user properties for Firebase Analytics.
🤝 Supporting
Renoki Co. on GitHub aims on bringing a lot of open source projects and helpful projects to the world. Developing and maintaining projects everyday is a harsh work and tho, we love it.
If you are using your application in your day-to-day job, on presentation demos, hobby projects or even school projects, spread some kind words about our work or sponsor our work. Kind words will touch our chakras and vibe, while the sponsorships will keep the open source projects alive.
🚀 Installation
You can install the package via composer:
composer require renoki-co/laravel-firebase-analytics
🙌 Usage
Initialize in your <body> tag using the @initializeFirebaseAnalytics directive, passing the version of Firebase JS scripts and the Firebase configuration parameters:
<body>
@initializeFirebaseAnalytics([
'version' => '7.15.5',
'config' => [
'apiKey' => 'some-key',
'authDomain' => 'firebaseapp',
...
],
])
...
</body>
Afterwards, you can trigger events as stated in Firebase Analytics docs:
<body>
@initializeFirebaseAnalytics([
'version' => '7.15.5',
'config' => [
'apiKey' => 'some-key',
'authDomain' => 'firebaseapp',
...
],
])
@if ($loginSuccessful)
@firebaseAnalyticsEvent([
'name' => 'login',
'parameters' => [
'method' => 'email',
],
])
@endif
</body>
Or for logged in users or sessions, you can set default user properties:
<body>
@initializeFirebaseAnalytics([
'version' => '7.15.5',
'config' => [
'apiKey' => 'some-key',
'authDomain' => 'firebaseapp',
...
],
])
@auth
@firebaseAnalyticsUserProperties([
'name' => auth()->user()->name,
'age' => auth()->user()->age,
])
@endauth
</body>
More details about the usage can be found here:
- https://firebase.google.com/docs/analytics/get-started
- https://firebase.google.com/docs/analytics/events
- https://firebase.google.com/docs/analytics/user-properties
🐛 Testing
vendor/bin/phpunit
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email alex@renoki.org instead of using the issue tracker.
🎉 Credits
统计信息
- 总下载量: 5.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-27