Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,877
Community Members
 
Community Events
176
Community Groups

Where to place Matomo script in Bitbucket?

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 -->

1 answer

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. 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events