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

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',

View File

@@ -81,18 +81,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Name der Seite',
'site-url' => 'URL der Seite',
'site-timezone' => 'Wählen Sie Ihre Zeitzone',
'site-locale' => 'Wählen Sie Ihre Sprache',
'date-format' => 'Datumsformat',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'Über diese Seite',
'days-of-incidents' => 'Wie viele (vergangene) Tage sollen angezeigt werden?',
'banner' => 'Banner-Bild',
'banner-help' => 'Wählen Sie möglichst ein Bild mit 930 px Breite.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => 'Name der Seite',
'site-url' => 'URL der Seite',
'site-timezone' => 'Wählen Sie Ihre Zeitzone',
'site-locale' => 'Wählen Sie Ihre Sprache',
'date-format' => 'Datumsformat',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'Über diese Seite',
'days-of-incidents' => 'Wie viele (vergangene) Tage sollen angezeigt werden?',
'banner' => 'Banner-Bild',
'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',

View File

@@ -90,20 +90,22 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Site Name',
'site-url' => 'Site URL',
'site-timezone' => 'Site Timezone',
'site-locale' => 'Site Language',
'date-format' => 'Date Format',
'incident-date-format' => 'Incident Timestamp Format',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'subscribers' => 'Allow people to signup to email notifications?',
'site-name' => 'Site Name',
'site-url' => 'Site URL',
'site-timezone' => 'Site Timezone',
'site-locale' => 'Site Language',
'date-format' => 'Date Format',
'incident-date-format' => 'Incident Timestamp Format',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'banner' => 'Banner Image',
'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' => [
'allowed-domains' => 'Allowed domains',

View File

@@ -82,18 +82,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Nombre del sitio',
'site-url' => 'URL del sitio',
'site-timezone' => 'Zona horaria del sitio',
'site-locale' => 'Idioma del sitio',
'date-format' => 'Formato de la fecha',
'display-graphs' => '¿Visualizar gráficas en la página de estado?',
'about-this-page' => 'Sobre esta página',
'days-of-incidents' => '¿Cuántos días de incidentes mostrar?',
'banner' => 'Imagen de inicio',
'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',
'site-name' => 'Nombre del sitio',
'site-url' => 'URL del sitio',
'site-timezone' => 'Zona horaria del sitio',
'site-locale' => 'Idioma del sitio',
'date-format' => 'Formato de la fecha',
'display-graphs' => '¿Visualizar gráficas en la página de estado?',
'about-this-page' => 'Sobre esta página',
'days-of-incidents' => '¿Cuántos días de incidentes mostrar?',
'banner' => 'Imagen de inicio',
'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',

View File

@@ -81,18 +81,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Nom du site',
'site-url' => 'URL du site',
'site-timezone' => 'Fuseau horaire du site',
'site-locale' => 'Langue du site',
'date-format' => 'Format de date',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'À propos de cette page',
'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',
'site-name' => 'Nom du site',
'site-url' => 'URL du site',
'site-timezone' => 'Fuseau horaire du site',
'site-locale' => 'Langue du site',
'date-format' => 'Format de date',
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'À propos de cette page',
'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' => '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>',

View File

@@ -84,18 +84,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Nama Situs',
'site-url' => 'URL',
'site-timezone' => 'Zona Waktu',
'site-locale' => 'Bahasa',
'date-format' => 'Format Tanggal',
'display-graphs' => 'Tampilkan grafik di halaman status?',
'about-this-page' => 'Tentang halaman ini',
'days-of-incidents' => 'Berapa hari insiden akan ditampilkan?',
'banner' => 'Gambar Banner',
'banner-help' => 'Disarankan gambar yang anda unggah tidak lebih lebar dari 930px.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => 'Nama Situs',
'site-url' => 'URL',
'site-timezone' => 'Zona Waktu',
'site-locale' => 'Bahasa',
'date-format' => 'Format Tanggal',
'display-graphs' => 'Tampilkan grafik di halaman status?',
'about-this-page' => 'Tentang halaman ini',
'days-of-incidents' => 'Berapa hari insiden akan ditampilkan?',
'banner' => 'Gambar Banner',
'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',

View File

@@ -84,18 +84,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Naam site',
'site-url' => 'URL site',
'site-timezone' => 'Tijdzone site',
'site-locale' => 'Taal site',
'date-format' => 'Datumformaat',
'display-graphs' => 'Grafieken tonen op statuspagina?',
'about-this-page' => 'Over deze pagina',
'days-of-incidents' => 'Hoeveel dagen van incidenten tonen?',
'banner' => 'Bannerafbeelding',
'banner-help' => 'Het wordt aangeraden om geen bestanden groter dan 930px breed te uploaden.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => 'Naam site',
'site-url' => 'URL site',
'site-timezone' => 'Tijdzone site',
'site-locale' => 'Taal site',
'date-format' => 'Datumformaat',
'display-graphs' => 'Grafieken tonen op statuspagina?',
'about-this-page' => 'Over deze pagina',
'days-of-incidents' => 'Hoeveel dagen van incidenten tonen?',
'banner' => 'Bannerafbeelding',
'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',

View File

@@ -84,18 +84,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Nazwa strony',
'site-url' => 'Adres URL strony',
'site-timezone' => 'Strefa czasowa',
'site-locale' => 'Język',
'date-format' => 'Format daty',
'display-graphs' => 'Wyświetlać wykresy na panelu głównym?',
'about-this-page' => 'O tej stronie',
'days-of-incidents' => 'Ile dni incydentów pokazywać?',
'banner' => 'Obrazek z logo',
'banner-help' => 'Zaleca się wrzuać pliki nie szersze niż 930px.',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => 'Nazwa strony',
'site-url' => 'Adres URL strony',
'site-timezone' => 'Strefa czasowa',
'site-locale' => 'Język',
'date-format' => 'Format daty',
'display-graphs' => 'Wyświetlać wykresy na panelu głównym?',
'about-this-page' => 'O tej stronie',
'days-of-incidents' => 'Ile dni incydentów pokazywać?',
'banner' => 'Obrazek z logo',
'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',

View File

@@ -84,18 +84,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => 'Nome do site',
'site-url' => 'URL do site',
'site-timezone' => 'Fuso horário do site',
'site-locale' => 'Idioma do site',
'date-format' => 'Formato da Data',
'display-graphs' => '',
'about-this-page' => 'Sobre esta página',
'days-of-incidents' => 'Quantos dias de incidentes para mostrar?',
'banner' => 'Imagem do banner',
'banner-help' => 'É recomendável que você faça upload de arquivos menores que 930px .',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => 'Nome do site',
'site-url' => 'URL do site',
'site-timezone' => 'Fuso horário do site',
'site-locale' => 'Idioma do site',
'date-format' => 'Formato da Data',
'display-graphs' => '',
'about-this-page' => 'Sobre esta página',
'days-of-incidents' => 'Quantos dias de incidentes para mostrar?',
'banner' => 'Imagem do banner',
'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',

View File

@@ -84,18 +84,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => '站点名称',
'site-url' => '站点URL',
'site-timezone' => '站点时区',
'site-locale' => '站点语言',
'date-format' => '日期格式',
'display-graphs' => '是否在状态页上显示图表',
'about-this-page' => '关于这个页面',
'days-of-incidents' => '显示多少天的事件?',
'banner' => '横幅图像',
'banner-help' => '建议上传文件宽度不大于930像素。',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => '站点名称',
'site-url' => '站点URL',
'site-timezone' => '站点时区',
'site-locale' => '站点语言',
'date-format' => '日期格式',
'display-graphs' => '是否在状态页上显示图表',
'about-this-page' => '关于这个页面',
'days-of-incidents' => '显示多少天的事件?',
'banner' => '横幅图像',
'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' => '允许的域',

View File

@@ -84,18 +84,20 @@ return [
'settings' => [
/// Application setup
'app-setup' => [
'site-name' => '網站名稱',
'site-url' => '網站 URL',
'site-timezone' => '網站時區',
'site-locale' => '網站語言',
'date-format' => '日期格式',
'display-graphs' => '在狀態頁上顯示圖片?',
'about-this-page' => '關於本站',
'days-of-incidents' => '顯示多少天前的事件?',
'banner' => '圖片橫幅',
'banner-help' => '橫幅寬度建議少於 930px 。',
'analytics_google' => 'Google Analytics code',
'analytics_gosquared' => 'GoSquared Analytics code',
'site-name' => '網站名稱',
'site-url' => '網站 URL',
'site-timezone' => '網站時區',
'site-locale' => '網站語言',
'date-format' => '日期格式',
'display-graphs' => '在狀態頁上顯示圖片?',
'about-this-page' => '關於本站',
'days-of-incidents' => '顯示多少天前的事件?',
'banner' => '圖片橫幅',
'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' => '容許訪問的域名',

View File

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

View File

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