diff options
Diffstat (limited to 'resources/views/modules/matomo-analytics')
| -rw-r--r-- | resources/views/modules/matomo-analytics/form.phtml | 24 | ||||
| -rw-r--r-- | resources/views/modules/matomo-analytics/snippet.phtml | 12 |
2 files changed, 36 insertions, 0 deletions
diff --git a/resources/views/modules/matomo-analytics/form.phtml b/resources/views/modules/matomo-analytics/form.phtml new file mode 100644 index 0000000000..8fce201551 --- /dev/null +++ b/resources/views/modules/matomo-analytics/form.phtml @@ -0,0 +1,24 @@ +<?php use Fisharebest\Webtrees\I18N; ?> + +<div class="row form-group"> + <label for="PIWIK_SITE_ID" class="col-sm-3 col-form-label"> + <?= /* I18N: A configuration setting */ I18N::translate('Site identification code') ?> + </label> + <div class="col-sm-9"> + <input type="text" class="form-control" id="PIWIK_SITE_ID" name="PIWIK_SITE_ID" value="<?= e($PIWIK_SITE_ID ?? '') ?>" maxlength="255" pattern="[0-9]+"> + </div> +</div> + +<!-- PIWIK_URL --> +<div class="row form-group"> + <label for="PIWIK_URL" class="col-sm-3 col-form-label"> + <?= /* I18N: A configuration setting */ I18N::translate('URL') ?> + </label> + <div class="col-sm-9"> + <input type="text" class="form-control" id="PIWIK_URL" name="PIWIK_URL" value="<?= e($PIWIK_URL ?? '') ?>" placeholder="//example.com/piwik/" maxlength="255"> + </div> +</div> + +<p> + <?= I18N::translate('Tracking and analytics are not added to the control panel.') ?> +</p> diff --git a/resources/views/modules/matomo-analytics/snippet.phtml b/resources/views/modules/matomo-analytics/snippet.phtml new file mode 100644 index 0000000000..c81a17f402 --- /dev/null +++ b/resources/views/modules/matomo-analytics/snippet.phtml @@ -0,0 +1,12 @@ +<script type="text/javascript"> + var _paq = window._paq || []; + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u=<?= json_encode($PIWIK_URL ?? '') ?>; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', <?= json_encode($PIWIK_SITE_ID ?? '') ?>]); + 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> |
