--- a/googleanalytics.admin.inc
+++ b/googleanalytics.admin.inc
@@ -270,6 +270,19 @@ function googleanalytics_admin_settings_form($form_state) {
     '#default_value' => variable_get('googleanalytics_site_search', FALSE),
     '#disabled' => (module_exists('search') ? FALSE : TRUE),
   );
+
+  $search_api_pages_dependencies = '<div class="admin-requirements">';
+  $search_api_pages_dependencies .= t('Requires: !dependencies', array('!dependencies' => (module_exists('search_api_page') ? t('@module (<span class="admin-enabled">enabled</span>)', array('@module' => 'Search API Pages')) : t('@module (<span class="admin-disabled">disabled</span>)', array('@module' => 'Search API Pages')))));
+  $search_api_pages_dependencies .= '</div>';
+
+  $form['tracking']['search_and_advertising']['googleanalytics_search_api_pages'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Track Search API search pages'),
+    '#description' => t('If checked, keywords entered on search api pages are tracked. You must configure your Google account to use the internal query parameter corresponding to the search api page. For more information see <a href="@url">Setting Up Site Search for a Profile</a>.', array('@url' => 'https://support.google.com/analytics/answer/1012264')) . $search_api_pages_dependencies,
+    '#default_value' => variable_get('googleanalytics_search_api_pages', FALSE),
+    '#disabled' => (module_exists('search_api_page') ? FALSE : TRUE),
+  );
+
   $form['tracking']['search_and_advertising']['googleanalytics_trackadsense'] = array(
     '#type' => 'checkbox',
     '#title' => t('Track AdSense ads'),
--- a/googleanalytics.admin.js
+++ b/googleanalytics.admin.js
@@ -87,6 +87,9 @@ Drupal.behaviors.trackingSettingsSummary = {
       if ($('input#edit-googleanalytics-site-search', context).is(':checked')) {
         vals.push(Drupal.t('Site search'));
       }
+      if ($('input#edit-googleanalytics-search-api-pages', context).is(':checked')) {
+        vals.push(Drupal.t('Search API Pages'));
+      }
       if ($('input#edit-googleanalytics-trackadsense', context).is(':checked')) {
         vals.push(Drupal.t('AdSense ads'));
       }
--- a/googleanalytics.module
+++ b/googleanalytics.module
@@ -178,6 +178,14 @@ function googleanalytics_page_alter(&$page) {
       $url_custom = '(window.googleanalytics_search_results) ? ' . drupal_json_encode(url('search/' . arg(1), array('query' => array('search' => $keys)))) . ' : ' . drupal_json_encode(url('search/' . arg(1), array('query' => array('search' => 'no-results:' . $keys, 'cat' => 'no-results'))));
     }
 
+    // Search API Page tracking support.
+    if (module_exists('search_api_page') && variable_get('googleanalytics_search_api_pages', FALSE)) {
+      $menu_item = menu_get_item();
+      if ('search_api_page_view' == $menu_item['page_callback']) {
+        $url_custom = '(window.googleanalytics_search_results) ? ' . drupal_json_encode(url($menu_item['path'] . '/' . $menu_item['page_arguments'][1], array('query' => array('search' => $menu_item['page_arguments'][1])))) . ' : ' . drupal_json_encode(url($menu_item['path'] . '/' . $menu_item['page_arguments'][1], array('query' => array('search' => 'no-results:' . $menu_item['page_arguments'][1], 'cat' => 'no-results'))));
+      }
+    }
+
     // If this node is a translation of another node, pass the original
     // node instead.
     if (module_exists('translation') && variable_get('googleanalytics_translation_set', 0)) {
@@ -461,6 +469,15 @@ function googleanalytics_preprocess_search_results(&$variables) {
 }
 
 /**
+ * Implements hook_preprocess_search_api_page_results().
+ *
+ * Collects and adds the number of search api page results to the head.
+ */
+function googleanalytics_preprocess_search_api_page_results(&$variables) {
+  drupal_add_js('window.googleanalytics_search_results = ' . intval($variables['results']['result count']) . ';', array('type' => 'inline', 'group' => JS_LIBRARY-1));
+}
+
+/**
  * Helper function for grabbing search keys. Function is missing in D7.
  *
  * http://api.drupal.org/api/function/search_get_keys/6
