Adding JavaScript to all pages E.g. Google Analytics

JIRA Documentation

Index

Some people wish to add some javascript to every page within JIRA. One such use case is Goolge Analytics.

To implement this you need to add the following javascript to all your pages:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-xxxxx";
urchinTracker();
</script>

The easiest way to do this would be (as of 3.4.1) to add this script into the Annoucement Banner which is displayed on nearly every page. This will display an empty red box, but you can simply comment out the style in the CSS. This will take care of about 90 - 95% of pages. This can be edited through the Adminitration section.

Else, you can manually add it to the file: stylesheettag.jsp This is included on every page.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Feb 07, 2007

    EONISCCMP says:

    A simple solution to hide the empty red box without editing the CSS: <div id="B...

    A simple solution to hide the empty red box without editing the CSS:

    <div id="BannerSub" style="display:none">
    </div>
    
    <script type="text/javascript">
       document.getElementById("BannerSub").parentNode.style.display='none';
    </script>