Skip to content

Firefly III: a personal finances manager

Allow FF to send events.

James Cole75d92bc7f000
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', '<?php echo env('ANALYTICS_ID', 'XXX-XX-X'); ?>', '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
+
</script>
</body>
</html>