Adds Google Analytics. Closes #350
This commit is contained in:
@@ -36,6 +36,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label>{{ trans('forms.settings.app-setup.google-analytics') }}</label>
|
||||
<input type="text" name="app_analytics" class="form-control" value="{{ Setting::get('app_analytics') }}" placeholder="UA-12345-12" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
@if($googleId = Setting::get('app_analytics'))
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', '{{ $googleId }}', '{{ $_SERVER['SERVER_NAME'] }}');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
@endif
|
||||
@@ -9,3 +9,5 @@
|
||||
</p>
|
||||
@endif
|
||||
</footer>
|
||||
|
||||
@include("partials.analytics")
|
||||
|
||||
Reference in New Issue
Block a user