Index: /Users/dburns/Sites/sonymulti/daughtry/trunk/public_html/sites/all/modules/contrib/google_analytics/googleanalytics.module
===================================================================
--- /Users/dburns/Sites/sonymulti/daughtry/trunk/public_html/sites/all/modules/contrib/google_analytics/googleanalytics.module	(revision 4679)
+++ /Users/dburns/Sites/sonymulti/daughtry/trunk/public_html/sites/all/modules/contrib/google_analytics/googleanalytics.module	(working copy)
@@ -75,13 +75,27 @@
         $fields[$field] = $value;
       }
       $segmentation = "__utmSetVar('".implode(':', $fields)."');";
-		}
+    }

-		// Add any custom code snippets if specified
-		$codesnippet = variable_get('googleanalytics_codesnippet', '');
+    // Add any custom code snippets if specified
+    $codesnippet = variable_get('googleanalytics_codesnippet', '');
+    $version = variable_get('googleanalytics_version', '');

-    $script = '<script type="text/javascript" src="http' . $prefix . ".google-analytics.com/urchin.js\"></script>\n";
-    $script .= '<script type="text/javascript">' . "<!--\n_uacct = \"".$id."\";{$segmentation}{$codesnippet}urchinTracker();\n// --></script><noscript></noscript>\n";
+    if($version) {
+      $script = '<script type="text/javascript" src="http' . $prefix . ".google-analytics.com/urchin.js\"></script>\n";
+      $script .= '<script type="text/javascript">' . "<!--\n_uacct = \"".$id."\";{$segmentation}{$codesnippet}urchinTracker();\n// --></script><noscript></noscript>\n";
+    }
+    else {
+      $script ='<script type="text/javascript">
+                  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+                  document.write("\<script src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'>\<\/script>" );
+                </script>
+                <script type="text/javascript">
+                  var pageTracker = _gat._getTracker("'.$id.'");
+                  pageTracker._initData();
+                  pageTracker._trackPageview();
+                </script>';
+    }
     return $script;
   }
 }
@@ -109,6 +123,13 @@
    // Render the role overview.
   $result = db_query('SELECT * FROM {role} ORDER BY name');

+  $form['account']['googleanalytics_version'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Legacy Google Analytics'),
+      '#default_value' => variable_get("googleanalytics_version", FALSE),
+      '#description' => t('This will enable Legacy Google Analytics instead of most recent.<br /> Please note that Legacy Google Analytics will not receive feature updates and is not compatible with new features.'),
+     );
+
   $form['roles'] = array(
         '#type' => 'fieldset',
         '#title' => t('User Role Tracking'),
