How to add Google Analytics script in JIRA 6 ?

4 answers

1 accepted

4 votes
Accepted answer
Claudio Ombrella Community Champion Nov 19, 2013

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.


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.



Did you tried it.


Yes, and it works well !

Thank you



which solution did you tried , let me know.

if mine is right , can you accept the answer :)

Adding the analytics code to the announcement banner works absolutely fine.

Just need to ensure that google analytics javascript URL is accessible from the server on which Jira is hosted.

Hi there, by Announcement Banner do you mean this?


Do I just paste the <script>.....</script> directly into the Announcement box?

I tried that it didn't work because the text that were pasted showed up directly in the Announcement Banner. 

Can you help?

Hi Teng,

It still works for me in JIRA 6, pasting the script in this field, like you described it. When you try to edit this field with HTML tags, is it working ? Like this one for exemple :

<span style="color:red">This is an important message</span>


Claudio Ombrella Community Champion Jun 16, 2016

Adding the Google script in the announcement banner is not enough. You will miss a lot of pages, for example if you search issues and you get let's say 10 results in the issue navigator, the banner will count on page hit when you load the first issue. If you then click on J (jump) or K (back) the screen is not loaded again so the banner does not run the Google Analytics script. The only way of solving this issue is by entering the Google Analytics script in the description of the summary field on each one of your field configurations you have, see screen shot below.

Screen Shot 2016-06-17 at 8.36.35 AM.png

Hi Claudio, I'm not sure that I fully understand your instructions.. When I put the <script>...</script> into the Description box, it appears on the screen underneath the Description field (which is how it should work when you put anything into that box), like this:


Am I missing something?

Claudio Ombrella Community Champion Jun 20, 2016

You need to enter the script in the description of the SUMMARY field not the description field. By the way which version of JIRA are you running?

I have inserted the script in the summary field now:


The same thing has happened:


I am on JIRA v7.

Any advice?


I had done this earlier for jira 4.x version and it worked. And again, try to avoid doing any changes to installation files.

Claudio Ombrella Community Champion Jun 16, 2016

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

&lt;!-- Library that allows to track SPA transitions (e.g. navigating issues) --&gt;
&lt;script type="text/javascript" src=""&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  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
/* 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;

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,704 views 17 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you