Feature #30
[PATCH] Support for Google Analytics
| Status : | Closed | Start : | ||
| Priority : | Low | Due date : | ||
| Assigned to : | neuro - | % Done : | 0% |
|
| Category : | frontend | |||
| Target version : | 5.1.4 | |||
| Resolution : | fixed |
Description
I thought it would be nifty to add easy support for a google analytics account in the general settings.
Since all google analytics requires to be added to the html is:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-xxxxxx"; urchinTracker(); </script>
Where xxxxx is the id assigned to that profile.
The patch I've made only adds the support to the settings table and the general admin view... each theme would still need to add the following snippet to work... perhaps make it an easy helper method instead?
<% unless config_value(:google_analytics_id).empty? %>
<%= javascript_include_tag "http://www.google-analytics.com/urchin.js" %>
<script type="text/javascript">
_uacct = <%= config_value(:google_analytics_id) %>; urchinTracker();
</script>
<% end %>
History
01/02/2006 05:28 PM - Redmine Admin
Ideally you'd fix something in this block...
<%= javascript_include_tag "cookies" %> <%= javascript_include_tag "prototype" %> <%= javascript_include_tag "effects" %> <%= javascript_include_tag "typo" %> <% benchmark "BENCHMARK: layout/script" do %> <script type="text/javascript"><%= @content_for_script %></script> <% end %>
... to add the urchin/google analytics code when necessary. Having to change the themes at this point is moderately undesirable. content_for_script seems like a likely suspect...
01/14/2006 10:37 AM - Redmine Admin
Sounds neat, too bad I don't have a Google Analytics account to test with.
I do think we need some sort of variable for generic header tags, like this. So instead of @content_for_script maybe something like @content_for_header that includes the whole <script> tag (after all, for this functionality we need a separate <script> tag to load the google analytics script).
04/30/2006 06:10 PM - me-nikolay-com -
Is this going to be incorporated in Typo someday? Google Analytics is now free and would be a nice addition to Typo.
05/13/2006 04:57 PM - Redmine Admin
If it would help, I can donate an invitation code for Google Analytics to help support this feature. If interested, please drop me an email.
07/21/2008 09:28 PM - neuro -
- Status changed from Feedback to Assigned
- Assigned to changed from tobi - to neuro -
- Target version changed from Maybe Someday to 5.2
I take it, this may be a nice feature to have and not too heavy to integrate.
