This page describes how to add Google Analytics in JIRA, but is not updated for JIRA 6 :
https://developer.atlassian.com/display/JIRADEV/Adding+JavaScript+to+all+pages+for+Google+Analytics
Can you tell us how to do it in JIRA 6 ?
The banner works well but it does not register all the hits, unfortunately. Example if you use the issue navigator and then click on the first issue, once you enter in the issue display this hit is recorded, but if you click on J or K (jump/back) this does not record a hit because the banner is not reloaded. We need to find a better way to include Google Analytics.
Hi Alice,
Why dont you add the google analytics script in 'announcement banner' configuration of jira, it will work.
administration-->announcement banner.
Hi,
Thank you for your quick answer !
I'd prefer to add the script inside <head> HTML tag, but if it works like this, it will be ok.
Alice
@alice,
I had done this earlier for jira 4.x version and it worked. And again, try to avoid doing any changes to installation files.
@Alice,
Did you tried it.
Yes, and it works well !
Thank you
See may answer just posted above, using the banner is not enough.
As others have said, the trick is to use the announcement banner. The twist is that you also want to use the official autotrack plugin from Google, specifically the urlChangeTracker: https://github.com/googleanalytics/autotrack/blob/master/docs/plugins/url-change-tracker.md. It will enable tracking page views on single-page-app pages like issue navigator.
Example code that you would put in the announcement banner would be
<!-- Library that allows to track SPA transitions (e.g. navigating issues) --> <script type="text/javascript" src=" https://cdnjs.cloudflare.com/ajax/libs/autotrack/1.0.1/autotrack.js"></script> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-ACCOUNT_ID', 'auto'); ga('send', 'pageview'); // everything above is an official google analytics tracking code ga('require', 'urlChangeTracker'); // this makes sure transitions on </script> <style> /* add this only if the above code is the only thing in your announcement banner, this prevents ugly grey background and border added automatically if there is anything in the announcement banner */ #announcement-banner { display: none; } </style>
It looks like you're new here. Sign in or register to get started.