PHP code example of swvjeff / laravel-analytics

1. Go to this page and download the library: Download swvjeff/laravel-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/ */

    

swvjeff / laravel-analytics example snippets


return [
    'tracking_id' => env('ANALYTICS_TRACKING_ID'),

    'secondary_tracking_ids' => []
];

use Analytics;

// Add any additional GA tracking IDs programmatically
Analytics::addTrackingId('UA-9999999-2');
Analytics::addTrackingId('UA-9999999-3');
 bash
php artisan vendor:publish --provider="Swvjeff\Analytics\AnalyticsServiceProvider"