</head> 안에 다음을 추가해 보았습니다.
<!-- Matomo - head -->
<script type="text/discourse-plugin" version="0.2">
// 페이지 뷰 추적
api.onPageChange((url, title) => {
if (_paq) {
try {
var currentUser = PreloadStore.get('currentUser');
_paq.push(['setCustomVariable', 3, 'Forum status', !currentUser ? 'Anonymous' : 'LoggedIn user', 'visit']);
} catch(e) {}
_paq.push(["setCustomUrl", url]);
_paq.push(["setDocumentTitle", title]);
_paq.push(["trackPageView"]);
}
});
</script>
<!-- /Matomo - head -->
그리고 </body> 안에 다음을 추가했습니다.
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* "trackPageView"를 호출하기 전에 "setCustomDimension" 같은 트래커 메서드를 호출해야 합니다 */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://stats.xxxxxxx.xxx/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '8']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
그런데 결과적으로 페이지의 HTML 소스에서 보이는 것은 HTML 주석뿐입니다. <script> 태그가 제거된 것으로 보입니다.
해당 영역에서 스크립트를 허용하도록 활성화해야 하는 보안 설정이 있을까요?
<!-- Matomo - head -->
<!-- /Matomo - head -->
[...]
<!-- Matomo -->
<!-- End Matomo Code -->
도움 주셔서 감사합니다.
