PHP code example of vdvcoder / laravel-dashboard-google-analytics-realtime-tile-v2

1. Go to this page and download the library: Download vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2 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/ */

    

vdvcoder / laravel-dashboard-google-analytics-realtime-tile-v2 example snippets


// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'google_analytics_realtime' => [
            'view_id' => '123456789',
            'key_file_location' => __DIR__ . '/../analytics-credentials.json',
            'urls_displayed' => 4,
            'active_users_warning_threshold' => 0,
        ]
    ],
];

// in app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(\vdvcoder\GoogleAnalyticsRealtimeTile\Commands\FetchGoogleAnalyticsRealtimeCommand::class)->everyMinute();
}