Index: modules/chartbeat/chartbeat.module
===================================================================
--- modules/chartbeat/chartbeat.module	(revision 5505)
+++ modules/chartbeat/chartbeat.module	(working copy)
@@ -29,42 +29,12 @@
  * Implementation of hook_init().
  */
 function chartbeat_init() {
-  $uid = variable_get('chartbeat_uid', '');
-  if (is_numeric($uid)) {
-    drupal_set_html_head('<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>');
-    drupal_add_js(array('chartbeat' => array(
-      'uid' => (int)$uid,
-      'domain' => variable_get('chartbeat_domain', ''),
-    )), 'setting');
-  }
+  drupal_set_html_head(variable_get('chartbeat_code', ''));
 }
 
 /**
  * Implementation of hook_footer().
  */
 function chartbeat_footer() {
-  $uid = variable_get('chartbeat_uid', '');
-  if (is_numeric($uid)) {
-    $output = <<<EOT
-<script type="text/javascript">
-  var _sf_async_config=Drupal.settings.chartbeat;
-  (function(){
-    function loadChartbeat() {
-      window._sf_endpt=(new Date()).getTime();
-      var e = document.createElement('script');
-      e.setAttribute('language', 'javascript');
-      e.setAttribute('type', 'text/javascript');
-      e.setAttribute('src',
-         (("https:" == document.location.protocol) ? "https://s3.amazonaws.com/" : "http://") +
-         "static.chartbeat.com/js/chartbeat.js");
-      document.body.appendChild(e);
-    }
-    var oldonload = window.onload;
-    window.onload = (typeof window.onload != 'function') ?
-       loadChartbeat : function() { oldonload(); loadChartbeat(); };
-  })();
-</script>
-EOT;
-    return $output;
-  }
+  return variable_get('chartbeat_code2', '');
 }
Index: modules/chartbeat/chartbeat.admin.inc
===================================================================
--- modules/chartbeat/chartbeat.admin.inc	(revision 5505)
+++ modules/chartbeat/chartbeat.admin.inc	(working copy)
@@ -5,17 +5,20 @@
  * Menu callback for the String Overrides module to display its administration
  */
 function chartbeat_admin_settings() {
-  $form['chartbeat_uid'] = array(
-    '#type' => 'textfield',
-    '#title' => t('User ID'),
-    '#description' => t('The user ID associated with your <a href="@chartbeat">Chartbeat</a> account.', array('@chartbeat' => 'http://chartbeat.com')),
-    '#default_value' => variable_get('chartbeat_uid', ''),
+  $form['chartbeat_code'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Installation code 1 with your <a href="@chartbeat">Chartbeat</a> account',
+      array('@chartbeat' => 'http://chartbeat.com')),
+    '#description' => t('The code will be inserted <strong>right after the opening head tag (&lt;head&gt;)</strong>.'),
+    '#default_value' => variable_get('chartbeat_code', ''),
+    '#rows' => 2,
   );
-  $form['chartbeat_domain'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Domain'),
-    '#description' => t('The domain to be reporting from on your account.'),
-    '#default_value' => variable_get('chartbeat_domain', ''),
+  $form['chartbeat_code2'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Installation code 2 with your <a href="@chartbeat">Chartbeat</a> account',
+      array('@chartbeat' => 'http://chartbeat.com')),
+    '#description' => t('The code will be inserted <strong>right before the closing body tag (&lt;/body&gt;)</strong>.'),
+    '#default_value' => variable_get('chartbeat_code2', ''),
   );
   return system_settings_form($form);
 }
