1. Go to this page and download the library: Download themusicdev/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/ */
themusicdev / analytics example snippets
// config/app.php
'Analytics' => [
'hosts' => ['example.com'], // only these hosts render anything; staging and localhost stay out
],
'Analytics' => [
'hosts' => ['example.com'],
'tracking' => [
'google' => ['measurementId' => 'G-XXXXXXX'], // instead of GA_MEASUREMENT_ID
'umami' => false, // off, even if UMAMI_* are set
],
'inject' => [ // any script, rendered before the tags
['position' => 'head', 'order' => 10, 'src' => 'https://…', 'async' => true],
],
],
<head>
…
<?= $this->Analytics->head()
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.