We use matomo internally to get stats on all our sites to better understand flow and usages.
I need to put similar code into the headers of the ossn site. I obviously do not want to edit every single file.
I've searched Google and this site and cannot find anyone asking about this.
Does someone know how I can add tracking code so that it will be across the entire site?
I think you said it :).
Anyhow, the component is working perfectly. Thanks.
Yes, that's what I was trying to express with "This component will add your Google Analytics code or anything similar to the head section of your site."
Feel free to suggest a better component description - I'm not a native English speaker
Nice, that works perfectly.
If I end up using Google or Bing or something else, can I simply add the code into this as well?
I tried it but,
"This component requires OSSN 7.1 or higher"
I guess it means I have to wait for the 7.1 premium?
Give it a try and install Google Analytics
It's basically capable of inserting ANY valid code into the
<head> section of Ossn sites.
No question, 1 line of code will execute faster than 1000 lines. :) Thus, in the end it depends on the very component (will it load 3rd party scripts, extra fonts, whatever?). Just use your browser's developer console to compare load times with a component enabled/disabled.
Sure, it looks like this (edited)
<!-- Matomo -->
var paq = window.paq = window._paq || ;
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script');
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
<!-- End Matomo Code -->
BTW, does adding components start bogging down the site eventually? I would want to limit the number of components the site is using if possible.