PHP code example of vitorbizarra / laravel-gtag

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

    

vitorbizarra / laravel-gtag example snippets


return [
    /*
     * The Google Analytics id, should be a code that looks something like "G-xxxx".
     */
    'id' => env('GTAG_ID', ''),

    /*
     * Enable or disable script rendering. Useful for local development.
     */
    'enabled' => env('GTAG_ENABLED', true),

    /*
     * Configures the Google Analytics script domain.
     */
    'domain' => env('GTAG_DOMAIN', 'www.googletagmanager.com'),
];
bash
php artisan vendor:publish --tag="laravel-gtag-config"
bash
php artisan vendor:publish --tag="laravel-gtag-views"
html
{{-- layout.blade.php --}}
<head>
  @