Index: googleanalytics.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.admin.inc,v
retrieving revision 1.2.2.43
diff -u -p -r1.2.2.43 googleanalytics.admin.inc
--- googleanalytics.admin.inc	31 May 2008 08:14:08 -0000	1.2.2.43
+++ googleanalytics.admin.inc	10 Oct 2008 20:39:57 -0000
@@ -195,6 +195,16 @@ function googleanalytics_admin_settings_
     $form['advanced']['googleanalytics_cache']['#description'] .= ' '. t('<a href="!url">Public file transfers</a> must be enabled to allow local caching.', array('!url' => url('admin/settings/file-system', array('query' => drupal_get_destination()))));
   }
 
+  // Allow for tracking of the originating node when viewing translation groups.
+  if (module_exists('translation')) {
+    $form['advanced']['googleanalytics_translation_group'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Track translation groups as one unit'),
+      '#description' => t('When a node is part of a translation group, record statistics for the originating node instead. This allows for a translation group to be treated as a single unit.'),
+      '#default_value' => variable_get('googleanalytics_translation_group', 0),
+    );
+  }
+
   $site_search_dependencies = '<div class="admin-dependencies">';
   $site_search_dependencies .= t('Depends on: !dependencies', array('!dependencies' => (module_exists('search') ? 'Search'. t(' (<span class="admin-enabled">enabled</span>)') : 'Search'. t(' (<span class="admin-disabled">disabled</span>)'))));
   $site_search_dependencies .= '</div>';
Index: googleanalytics.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.module,v
retrieving revision 1.16.2.44
diff -u -p -r1.16.2.44 googleanalytics.module
--- googleanalytics.module	17 May 2008 15:47:52 -0000	1.16.2.44
+++ googleanalytics.module	10 Oct 2008 20:39:57 -0000
@@ -131,6 +131,18 @@ function googleanalytics_footer($main = 
       $url_custom = drupal_to_js(url('search/'. arg(1), array('query' => 'search='. trim($keys))));
     }
 
+    // If this node is a translation of another node, pass the original
+    // node instead.
+    if (module_exists('translation') && variable_get('googleanalytics_translation_group', 1)) {
+      // Check we have a node object, it supports translation, and its
+      // translated node ID (tnid) doesn't match its own node ID.
+      $node = menu_get_object();
+      if ($node && translation_supported_type($node->type) && isset($node->tnid) && ($node->tnid != $node->nid)) {
+        $source_node = node_load($node->tnid);
+        $url_custom = drupal_to_js(url(drupal_get_path_alias('node/' . $source_node->nid, $source_node->language)));
+      }
+    }
+
     // Track access denied (403) and file not found (404) pages.
     if (function_exists('drupal_get_headers')) {
       $headers = drupal_get_headers();
