mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-2997- #comment add matomo script
This commit is contained in:
@@ -38,6 +38,12 @@ class GeneralFormType extends AbstractType
|
||||
$builder->add('analytics', 'text', [
|
||||
'label' => 'Google Analytics identifier',
|
||||
]);
|
||||
$builder->add('matomo-url', 'text', [
|
||||
'label' => 'Matomo Analytics url',
|
||||
]);
|
||||
$builder->add('matomo-id', 'text', [
|
||||
'label' => 'Matomo Analytics identifier',
|
||||
]);
|
||||
$builder->add('allow-indexation', 'checkbox', [
|
||||
'label' => 'Allow the website to be indexed by search engines like Google',
|
||||
]);
|
||||
|
@@ -24,5 +24,6 @@
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
{% include 'common/analytics.html.twig' %}
|
||||
{% include 'common/matomo_analytics.html.twig' %}
|
||||
</body>
|
||||
</html>
|
||||
|
18
templates/mobile/common/matomo_analytics.html.twig
Normal file
18
templates/mobile/common/matomo_analytics.html.twig
Normal file
@@ -0,0 +1,18 @@
|
||||
{% if app['conf'].get(['registry', 'general', 'matomo-url']) != '' %}
|
||||
{% if app['conf'].get(['registry', 'general', 'matomo-id']) != '' %}
|
||||
<!-- Matomo -->
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//{{ app['conf'].get(['registry', 'general', 'matomo-url']) }}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', {{ app['conf'].get(['registry', 'general', 'matomo-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>
|
||||
<!-- End Matomo Code -->
|
||||
{% endif %}
|
||||
{% endif %}
|
@@ -42,5 +42,6 @@
|
||||
{% block extra_content %}{% endblock %}
|
||||
{% block bodyJavascript %}{% endblock %}
|
||||
{% include 'common/analytics.html.twig' %}
|
||||
{% include 'common/matomo_analytics.html.twig' %}
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -25,5 +25,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{% include 'common/analytics.html.twig' %}
|
||||
{% include 'common/mamoto_analytics.html.twig' %}
|
||||
</body>
|
||||
</html>
|
||||
|
18
templates/web/common/matomo_analytics.html.twig
Normal file
18
templates/web/common/matomo_analytics.html.twig
Normal file
@@ -0,0 +1,18 @@
|
||||
{% if app['conf'].get(['registry', 'general', 'matomo-url']) != '' %}
|
||||
{% if app['conf'].get(['registry', 'general', 'matomo-id']) != '' %}
|
||||
<!-- Matomo -->
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//{{ app['conf'].get(['registry', 'general', 'matomo-url']) }}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', {{ app['conf'].get(['registry', 'general', 'matomo-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>
|
||||
<!-- End Matomo Code -->
|
||||
{% endif %}
|
||||
{% endif %}
|
@@ -100,6 +100,7 @@
|
||||
{% endblock %}
|
||||
{% block analytics %}
|
||||
{% include 'common/analytics.html.twig' %}
|
||||
{% include 'common/matomo_analytics.html.twig' %}
|
||||
{% endblock analytics %}
|
||||
|
||||
{% block scripts %}{% endblock scripts %}
|
||||
|
Reference in New Issue
Block a user