Allow FF to send events.

This commit is contained in:
James Cole 2015-04-03 23:22:23 +02:00
parent 74aa6e911e
commit 75d92bc7f0
3 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,7 @@ CACHE_DRIVER=file
SESSION_DRIVER=file
EMAIL_SMTP=
EMAIL_DRIVER=smtp
EMAIL_USERNAME=
EMAIL_PASSWORD=
ANALYTICS_ID=

View File

@ -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());

View File

@ -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>