PHP code example of infoweb-internet-solutions / yii2-cms-analytics

1. Go to this page and download the library: Download infoweb-internet-solutions/yii2-cms-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/ */

    

infoweb-internet-solutions / yii2-cms-analytics example snippets


return [
    ...
    'analytics' => [
        'developerKey' => '', // Public key fingerprints
        'serviceAccountName' => '[email protected]', // Email address
        'clientId' => 'xxx.apps.googleusercontent.com', // Client ID
    ],
];

return [
    ...
    'analytics' => [
        ...
        'analyticsId' => 'ga:XXXXXXXX',
    ],
];

Yii::setAlias('google/api', dirname(dirname(__DIR__)) . '/vendor/google/apiclient/src');

'directory' => dirname(Yii::getAlias('@webroot')) . '/runtime/Google_Client'


use infoweb\analytics\Analytics;

$this->title = Yii::$app->name;

<div class="site-index">
    <div class="body-content">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">
                    <?= Yii::t('app', 'Dashboard');