Do we have any way to add google analytic script to fisheye/crucible?
Asked by Kamal Saini:

Hi,

I am able to add google analytic script successfully for JIRA under Administrator\>System\>User Interface\>Announcement banner. I want to add google analytics script in fisheye/crucible instance too. Can anybody please let me know how to do that?

Thanks,

Kamal


Answers:
author: rstephens
body: Hi Kamal,

There is no system-wide announcement banner for FishEye/Crucible like JIRA. There are two ways you could do this:

1. If you have a commercial license, you can edit the JSP source to include the announcement banner. Documentation on the JSP source release of FeCru is here.

2. You can [build a simple plugin](https://developer.atlassian.com/display/FECRUDEV/FishEye+and+Crucible+Plugin+Guide) to display the javascript. You could either include the javascript on every page by making it a downloadable plugin resource, or create a "Web Panel" that will be rendered on every page.

Kind Regards,  
Richard Stephens

comments: author: Kamal Saini
body: Hi Richard,

Thanks for the quick response. So it means there is no straight forward way to add google analytics script as in jira. I will try the solutions suggested by you.

Thanks again,

Kamal


author: Kamal Saini
body: ```
&lt;atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"&gt;    &lt;plugin-info&gt;        &lt;description&gt;${project.description}&lt;/description&gt;        &lt;version&gt;${project.version}&lt;/version&gt;        &lt;vendor name="${project.organization.name}" url="${project.organization.url}" /&gt;        &lt;param name="plugin-icon"&gt;images/pluginIcon.png&lt;/param&gt;        &lt;param name="plugin-logo"&gt;images/pluginLogo.png&lt;/param&gt;    &lt;/plugin-info&gt;         &lt;!-- add our i18n resource --&gt;    &lt;resource type="i18n" name="i18n" location="googleAnalyticsForFisheye"/&gt;         &lt;!-- add our web resources --&gt;    &lt;web-resource key="googleAnalyticsForFisheye-resources" name="googleAnalyticsForFisheye Web Resources"&gt;        &lt;dependency&gt;com.atlassian.auiplugin:ajs&lt;/dependency&gt;        &lt;resource type="download" name="googleAnalyticsForFisheye.js" location="/js/googleAnalyticsForFisheye.js"/&gt;        &lt;context&gt;atl.general&lt;/context&gt;    &lt;/web-resource&gt;         &lt;!-- publish our component --&gt;    &lt;component key="myPluginComponent" class="com.sapient.fisheyePlugin.googleAnalyticsForFisheye.MyPluginComponentImpl" public="true"&gt;        &lt;interface&gt;com.sapient.fisheyePlugin.googleAnalyticsForFisheye.MyPluginComponent&lt;/interface&gt;    &lt;/component&gt;          &lt;!-- import from the product container --&gt;    &lt;component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" /&gt;     &lt;/atlassian-plugin&gt;
```


author: Kamal Saini
body: Hi Richard,

I am working on to building a simple plugin to display the javascript on every page of fisheye. The plug-in is showing in fisheye "Administration"\>"System Settings"\>"Manage Add-ons" but somehow (surely, I am missing somthing or doing it wrong) the javascript is not showing on any of the page of fisheye. Below is my "atlassian-plugin.xml" file. I am having one javascript file at the below mentioned location in xml. Do I need somthing else (some servlet to register web resource) to get javascript on every page of fisheye? Can you please help me with this or suggest me some pointers? I was trying to follow<https://developer.atlassian.com/display/FECRUDEV/Web+Resources>

```

```


author: Kamal Saini
body: Hi Richard,

I am working on to building a simple plugin to display the javascript on every page of fisheye. The plug-in is showing in fisheye "Administration"\>"System Settings"\>"Manage Add-ons" but somehow (surely, I am missing somthing or doing it wrong) the javascript is not showing on any of the page of fisheye. Below is my "atlassian-plugin.xml" file. I am having one javascript file at the below mentioned location. Do I need somthing else (some servlet to register web resource) to get javascript on every page of fisheye? Can you please help me with this of suggest me some pointers? I was trying to follow <https://developer.atlassian.com/display/FECRUDEV/Web+Resources>

```
&lt;atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"&gt;    &lt;plugin-info&gt;        &lt;description&gt;${project.description}&lt;/description&gt;        &lt;version&gt;${project.version}&lt;/version&gt;        &lt;vendor name="${project.organization.name}" url="${project.organization.url}" /&gt;        &lt;param name="plugin-icon"&gt;images/pluginIcon.png&lt;/param&gt;        &lt;param name="plugin-logo"&gt;images/pluginLogo.png&lt;/param&gt;    &lt;/plugin-info&gt;	    &lt;!-- add our i18n resource --&gt;    &lt;resource type="i18n" name="i18n" location="googleAnalyticsForFisheye"/&gt;        &lt;!-- add our web resources --&gt;    &lt;web-resource key="googleAnalyticsForFisheye-resources" name="googleAnalyticsForFisheye Web Resources"&gt;        &lt;dependency&gt;com.atlassian.auiplugin:ajs&lt;/dependency&gt;        &lt;resource type="download" name="googleAnalyticsForFisheye.js" location="/js/googleAnalyticsForFisheye.js"/&gt;        &lt;context&gt;atl.general&lt;/context&gt;    &lt;/web-resource&gt;        &lt;!-- publish our component --&gt;    &lt;component key="myPluginComponent" class="com.sapient.fisheyePlugin.googleAnalyticsForFisheye.MyPluginComponentImpl" public="true"&gt;        &lt;interface&gt;com.sapient.fisheyePlugin.googleAnalyticsForFisheye.MyPluginComponent&lt;/interface&gt;    &lt;/component&gt;         &lt;!-- import from the product container --&gt;    &lt;component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" /&gt;    &lt;/atlassian-plugin&gt;
```


Tags: analytics

google