PHP code example of renoki-co / laravel-firebase-analytics

1. Go to this page and download the library: Download renoki-co/laravel-firebase-analytics library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

renoki-co / laravel-firebase-analytics example snippets


<body>
    @initializeFirebaseAnalytics([
        'version' => '7.15.5',
        'config' => [
            'apiKey' => 'some-key',
            'authDomain' => 'firebaseapp',
            ...
        ],
    ])

    ...
</body>

<body>
    @initializeFirebaseAnalytics([
        'version' => '7.15.5',
        'config' => [
            'apiKey' => 'some-key',
            'authDomain' => 'firebaseapp',
            ...
        ],
    ])

    @if ($loginSuccessful)
        @firebaseAnalyticsEvent([
            'name' => 'login',
            'parameters' => [
                'method' => 'email',
            ],
        ])
    @endif
</body>

<body>
    @initializeFirebaseAnalytics([
        'version' => '7.15.5',
        'config' => [
            'apiKey' => 'some-key',
            'authDomain' => 'firebaseapp',
            ...
        ],
    ])

    @auth
        @firebaseAnalyticsUserProperties([
            'name' => auth()->user()->name,
            'age' => auth()->user()->age,
        ])
    @endauth
</body>