From 75d92bc7f000c1c541810c5b9c0ddc94538f68ce Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 3 Apr 2015 23:22:23 +0200 Subject: [PATCH] Allow FF to send events. --- .env.example | 1 + app/Http/Controllers/Auth/AuthController.php | 2 ++ resources/views/layouts/default.blade.php | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/.env.example b/.env.example index fdf834d3ef..6e6fd0fa1a 100644 --- a/.env.example +++ b/.env.example @@ -12,6 +12,7 @@ CACHE_DRIVER=file SESSION_DRIVER=file EMAIL_SMTP= +EMAIL_DRIVER=smtp EMAIL_USERNAME= EMAIL_PASSWORD= ANALYTICS_ID= \ No newline at end of file diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 89668589df..97bb5bc4b1 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -81,6 +81,8 @@ class AuthController extends Controller // set flash message Session::flash('success', 'You have registered successfully!'); + Session::flash('gaEventCategory', 'user'); + Session::flash('gaEventAction', 'new-registration'); return redirect($this->redirectPath()); diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index e0c8eea327..6eafcace52 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -146,6 +146,11 @@ ga('create', '', 'auto'); ga('send', 'pageview'); + // send an event if relevant: + @if(Session::has('gaEventCategory') && Session::has('gaEventAction')) + ga('send','event','{{Session::get('gaEventCategory')}}','{{Session::get('gaEventAction')}}'); + @endif +