{namespace v=FluidTYPO3\Vhs\ViewHelpers}
{namespace st=Opentalent\OtStats\ViewHelpers}

<f:comment>
    <!-- (Frontend) Render the matomo integration script to the current website (if stats are enabled) -->
</f:comment>

<v:variable.set name="matomo_site_id" value="{st:matomoSiteId()}" />

<f:comment><!-- Matomo --></f:comment>
<script type="text/javascript">
    var _paq = window._paq || [];
    _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
    _paq.push(["setDomains", ["*.opentalent.fr"]]);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function() <f:format.raw>{</f:format.raw>
    var u="https://stats.2iopenservice.com/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '{matomo_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+'matomo.js'; s.parentNode.insertBefore(g,s);
    <f:format.raw>}</f:format.raw>)();
</script>
<noscript><p><img src="https://stats.2iopenservice.com/matomo.php?idsite={matomo_site_id}&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<f:comment><!-- End Matomo Code --></f:comment>
