BLUE-11: Added another config field to allow an admin to set Google Analytics or other RUM tracking code

This commit is contained in:
Andy Heathershaw 2016-10-28 16:07:24 +01:00
parent acf8215105
commit 21ef4de5c9
5 changed files with 17 additions and 2 deletions

View File

@ -83,6 +83,7 @@ class ConfigHelper
return array(
'allow_self_registration' => true,
'analytics_code' => '',
'app_name' => trans('global.app_name'),
'date_format' => $this->allowedDateFormats()[0],
'default_album_view' => $this->allowedAlbumViews()[0],

View File

@ -74,7 +74,8 @@ class DefaultController extends Controller
'smtp_password',
'theme',
'recaptcha_site_key',
'recaptcha_secret_key'
'recaptcha_secret_key',
'analytics_code'
];
$defaults = UserConfig::defaults();

View File

@ -128,5 +128,8 @@ return [
'user_deletion_failed' => 'An error occurred while removing :name\'s user account: :error_message',
'user_deletion_successful' => 'The user account for :name was removed successfully.',
'user_pending' => 'Pending activation',
'users_title' => 'User accounts'
'users_title' => 'User accounts',
'visitor_analytics_heading' => 'Visitor analytics',
'visitor_analytics_p' => 'If you would like to analyse your visitor\'s activity using Google Analytics, Piwik or other real-time user monitoring services, please copy and paste the tracking code in the box below.',
'visitor_analytics_p2' => 'This code will appear at the end of your site\'s body tag. Remember to include the "script" tags.'
];

View File

@ -70,6 +70,15 @@
</label>
</div>
</fieldset>
<hr/>
<fieldset>
<legend>@lang('admin.visitor_analytics_heading')</legend>
<p>@lang('admin.visitor_analytics_p')</p>
<p>@lang('admin.visitor_analytics_p2')</p>
{!! Form::textarea('analytics_code', old('analytics_code'), ['class' => 'form-control', 'rows' => 10]) !!}
</fieldset>
</div>
{{-- E-mail --}}

View File

@ -93,5 +93,6 @@
});
</script>
@stack('scripts')
{!! \App\Facade\UserConfig::get('analytics_code') !!}
</body>
</html>