Hi,
I have made an application and now I want to add a script at the header level :
<script>
var _p = window._paq = window._paq || [];
_p.push(['trackPageView']);
_p.push(['enableLinkTracking']);
(function() {
var u="https://mat.fr/";
var d=document('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
any idea please ?
thanks
Hey you,
Please check the below snip.It will help you.
Thanks & Regards,
Sudip Pal
thanks for coming back,
I did what you suggest :
but I dont see it at the Required script level :
isit normal ?
Hey,
Is there any create option like the below snip?
This is another approach that you can try.
thanks but I need to do that for every page ?
If you want to apply for every page, I think you can add the JavaScript widget into OnReady event of your Layout block.
Regards,
Khuong
Hi Khuong Truong,
I also tested the solution, and it is working. However, Matomo only registers visits after refreshing the pages. I have this example where I have a button that leads to a second page. When I access the second page through this link, it doesn't register as a visit. Do you know why this happens or how I can resolve it? Thank you.
Hi @you asen ,
You can load external JavaScript by adding it on Script folder under Interface tab and then add the script on the screen using Required scripts option.
Additionally, if you need to use JavaScript code, you can use JavaScript element which is available in client action.
I recommend to refer below URL for better understanding.
https://success.outsystems.com/documentation/11/extensibility_and_integration/javascript/extend_your_mobile_and_reactive_apps_using_javascript/