You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.