Feature #30

[PATCH] Support for Google Analytics

Added by michael-schubert-cx - 1091 days ago. Updated 30 days ago.

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.

03/10/2007 04:59 PM - neuro -

  • Status changed from New to Closed
  • Resolution set to wontfix

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.

09/07/2008 10:31 AM - neuro -

  • Target version changed from 5.2 to 5.1.4

11/01/2008 04:30 PM - neuro -

  • Resolution set to fixed

Added in trunk, will be in 5.2

11/01/2008 04:30 PM - neuro -

  • Status changed from Assigned to Closed

Also available in: Atom PDF