We're using Matomo for web monitoring and metrics reporting. The tool requires a relatively simple script to be applied to all pages, which gathers some traffic data and sends it to a Matomo instance.
Looking for recommendations on where to place such a script in Bitbucket. In Jira and Confluence, we've been able to leverage the Announcement Banner and Custom HTML configs to run the script. But since Bitbucket uses markdown for the announcement banner, I don't have the same front end options.
Recommendations on where a script could be placed in order to run for all pages.
Example Matomo script:
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{$MATOMO_URL}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', {$IDSITE}]);
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 -->
I was able to put it onto the login screen, since we're running the Resolutions SAML SSO plugin, and I can edit the login page template to run the script. But obviously, that only runs on one page, and no other pages after that.
Fiddled around, inserted the script into the configurations for the announcement-banner.soy, aui.soy, and other similar files. Errors on startup that the soy files couldn't compile or something. It was worth a try.
Open to suggestions on possible locations to wedge a script into the global page configs.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.