Index: ad.install
===================================================================
--- ad.install	(revision 4480)
+++ ad.install	(working copy)
@@ -189,6 +189,13 @@
         'default' => '',
         'description' => 'Alow add-on modules to provide additional statistics granularity.',
       ),
+      'sitekey' => array(
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => FALSE,
+        'default' => NULL,
+        'description' => 'Site key in the form of an md5 hash.',
+      ),
     ),
     'primary key' => array('sid'),
     'indexes' => array(
@@ -198,6 +205,7 @@
       'adgroup' => array('adgroup'),
       'hostid' => array('hostid'),
       'extra' => array('extra'),
+      'sitekey' => array('sitekey'),
     ),
   );
 
@@ -484,3 +492,22 @@
   $ret[] = update_sql("UPDATE {blocks} SET cache = ". BLOCK_CACHE_PER_PAGE ." WHERE module = 'ad'");
   return $ret;
 }
+
+/**
+ * Add sitekey field to the ad_statistics table.
+ */
+function ad_update_6009() {
+  $ret = array();
+  db_add_field($ret, 'ad_statistics', 'sitekey',
+    array(
+      'type' => 'varchar',
+      'length' => 32,
+      'not null' => FALSE,
+      'default' => NULL,
+      'description' => 'Site key in the form of an md5 hash.',
+    ),
+    array('indexes' => array(
+      'sitekey' => array('sitekey')),
+    ));
+  return $ret;
+}
