Add piwik stats

This commit is contained in:
Luc Didry
2015-06-13 17:20:02 +02:00
parent 0862c707d9
commit ca1b5f0658
13 changed files with 182 additions and 122 deletions
+8
View File
@@ -59,6 +59,14 @@ class SettingsTableSeeder extends Seeder
'name' => 'app_analytics_gs',
'value' => 'GSN-712462-P',
],
[
'name' => 'app_analytics_pi_url',
'value' => 'piwik.example.org',
],
[
'name' => 'app_analytics_pi_siteid',
'value' => '1',
],
[
'name' => 'display_graphs',
'value' => '1',
+2
View File
@@ -93,6 +93,8 @@ return [
'banner-help' => 'Wählen Sie möglichst ein Bild mit 930 px Breite.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => 'Erlaubte Domains',
+2
View File
@@ -103,6 +103,8 @@ return [
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
'subscribers' => 'Allow people to signup to email notifications?',
],
'security' => [
+2
View File
@@ -94,6 +94,8 @@ return [
'banner-help' => 'Se recomienda subir una imagen no más grande de 930px de ancho .',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => 'Dominios permitidos',
+4 -2
View File
@@ -91,8 +91,10 @@ return [
'days-of-incidents' => 'Nombre de jours à afficher ?',
'banner' => 'Bannière',
'banner-help' => 'Il est recommandé de télécharger des fichiers de moins de 930 pixels de large.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_google' => 'Code Google Analytics',
'analytics_gosquared' => 'Code GoSquared Analytics',
'analytics_piwik_url' => 'URL de votre instance de Piwik (sans http(s)://)',
'analytics_piwik_siteid' => 'Identifiant du site dans Piwik (site id)',
],
'security' => [
'allowed-domains' => 'Domaines autorisés. <small class="help-block"></small>',
+2
View File
@@ -96,6 +96,8 @@ return [
'banner-help' => 'Disarankan gambar yang anda unggah tidak lebih lebar dari 930px.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => 'Domain yang dibolehkan',
+2
View File
@@ -96,6 +96,8 @@ return [
'banner-help' => 'Het wordt aangeraden om geen bestanden groter dan 930px breed te uploaden.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => 'Toegestane domeinen',
+2
View File
@@ -96,6 +96,8 @@ return [
'banner-help' => 'Zaleca się wrzuać pliki nie szersze niż 930px.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => 'Dozwolone domenyw',
+2
View File
@@ -96,6 +96,8 @@ return [
'banner-help' => 'É recomendável que você faça upload de arquivos menores que 930px .',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => 'Domínios permitidos',
+2
View File
@@ -96,6 +96,8 @@ return [
'banner-help' => '建议上传文件宽度不大于930像素。',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => '允许的域',
+2
View File
@@ -96,6 +96,8 @@ return [
'banner-help' => '橫幅寬度建議少於 930px 。',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'analytics_piwik_url' => 'URL of your Piwik instance (without http(s)://)',
'analytics_piwik_siteid' => 'Piwik\'s site id',
],
'security' => [
'allowed-domains' => '容許訪問的域名',
@@ -59,6 +59,22 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label>{{ trans('forms.settings.app-setup.analytics_piwik_url') }}</label>
<input type="text" name="app_analytics_pi_url" class="form-control" value="{{ Setting::get('app_analytics_pi_url') }}" placeholder="piwik.example.org">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label>{{ trans('forms.settings.app-setup.analytics_piwik_siteid') }}</label>
<input type="number" min="1" max="100" name="app_analytics_pi_siteid" class="form-control" value="{{ Setting::get('app_analytics_pi_siteid') ?: 1 }}">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
@@ -18,3 +18,19 @@
_gs('{{ $gosquaredTracking }}');
</script>
@endif
@if($piwikTracking = Setting::get('app_analytics_pi_url'))
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ $piwikTracking }}";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', {{ Setting::get('app_analytics_pi_siteid', 1) }}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//{{ $piwikTracking }}/piwik.php?idsite={{ Setting::get('app_analytics_pi_siteid', 1) }}" style="border:0;" alt="" /></p></noscript>
@endif