Active
Project:
Fuzzy Search
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2011 at 13:36 UTC
Updated:
24 May 2013 at 21:51 UTC
I would like to report site searches to Google Analytics. The Google Analytics module tracks site search with the core search module but it doesn't work with Fuzzy Search. What needs to change to make it work or is it something that needs to happen in the Google Analytics module? I believe the code in Google Analytics responsible for tracking site search is on lines 138-140 in googleanalytics.module
if (module_exists('search') && variable_get('googleanalytics_site_search', FALSE) && arg(0) == 'search' && $keys = search_get_keys()) {
$url_custom = '(window.googleanalytics_search_results) ? ' . drupal_to_js(url('search/'. arg(1), array('query' => 'search='. drupal_urlencode($keys)))) . ' : ' . drupal_to_js(url('search/'. arg(1), array('query' => 'search=no-results:'. drupal_urlencode($keys) .'&cat=no-results')));
}
There is also a section on the Google Analytics module settings page to add custom js code. Maybe a custom snippet can be added to enable Fuzzy Search tracking?
Comments
Comment #1
awolfey commentedIt's a good idea. I can try to look at this but I'm very busy for the next few months. I doubt that the ga module would include it. It's probably best to work it in to fuzzysearch or try the custom js.
I encourage you to work on it and provide a patch.
Thanks
Comment #2
joost1278 commentedDid someone fix this problem in the last 19 months?
I can't seem to track my site searches with Google Analytics with whatever kind of queryparameter I try.