Skip to content

Commit

Permalink
add mysql/db version to posted analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Jan 19, 2018
1 parent 7e09cf6 commit 6e12c00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Models/Enums/AnalyticsDimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
class AnalyticsDimensions
{
const PHP_VERSION = 1;
const MYSQL_VERSION = 2;
const DATABASE_VERSION = 2;
const PHPVMS_VERSION = 3;
}
14 changes: 13 additions & 1 deletion modules/Installer/Http/Controllers/InstallerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

namespace Modules\Installer\Http\Controllers;

use App\Models\Enums\AnalyticsDimensions;
use DB;
use Log;
use PDO;
use Irazasyed\LaravelGAMP\Facades\GAMP;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Validator;

use App\Models\User;
use App\Models\Enums\AnalyticsDimensions;
use App\Repositories\AirlineRepository;
use App\Facades\Utils;
use App\Services\UserService;
Expand Down Expand Up @@ -269,9 +271,19 @@ public function usersetup(Request $request)
# Set the intial admin e-mail address
setting('general.admin_email', $user->email);

# some analytics
$gamp = GAMP::setClientId(uniqid('', true));
$gamp->setDocumentPath('/install');

$gamp->setCustomDimension(PHP_VERSION, AnalyticsDimensions::PHP_VERSION);

# figure out database version
$pdo = DB::connection()->getPdo();
$gamp->setCustomDimension(
strtolower($pdo->getAttribute(PDO::ATTR_SERVER_VERSION)),
AnalyticsDimensions::DATABASE_VERSION
);

$gamp->sendPageview();

# If analytics are disabled
Expand Down

0 comments on commit 6e12c00

Please sign in to comment.