Track Drupal Site Search in Google Analytics
Google Analytics has a feature to track Site Search. It must be configured with a "Query Parameter". Setting this up was a little confusing to me, so I thought I'd post here to help anyone who may be stuck.
To track Drupal's default search, located at www.example.com/search, do the following steps:
1. Click the "Edit" link on the site profile.
2. Click "Edit" next to Main Website Profile Information.
3. Under "Site Search", enter the following parameters:
I don't believe you have to strip query parameters out of the URL, it won't garble the results.
For the "Query Parameter", if you want to track Drupal's default search, just enter "search" as the query parameter.
If you're using an additional Search module, like Apache Solr, Faceted Search, or Multisite Search, your search URL will appear like so:
www.example.com/search/apachesolr_search/
www.example.com/search/multisite_search/
To also capture those search results, simply add "search/apachesolr_search" or "search/multisite_search" to the query parameter with a comma.
So the query parameter will appear like so: search,search/apachesolr_search
That's it! It worked for me, so hopefully it will for you too...



Comments
Hi Wes,
Have you been able to get this to work while using 'clean URLs' ?
Thanks - JoC
Hi John,
Yes, this should work fine with clean URLs enabled, we have it enabled on our site.
All requests in Drupal are translated from www.example.com/search/something to www.example.com/index.php?q=search/something, so the "query string" is everything after the ?, and Google Analytics will pick that up. Make sense?
I am so glad I found your website, I really found you by mistake, while I was browsing on Yahoo for something else, Anyhow I am here now and would just like to say many thanks for a tremendous post and a all round interesting blog
Recently Google had made lot of changes in the analytic and the above given information is been clearly mentioned that how to use with new features of Google analytic.
I tried your query parameter example but it doesn't work. We installed Search API module on Drupal 7, so it seems to have generated different string queries, in this format (example is for search word "food") :
example.com/search-result?search_api_views_fulltext=food&=Apply
So in this case should I enter 'search-result' as query parameter or
'search_api_views_fulltext=' or
'search_api_views_fulltext=,&=Apply' ?
Would really appreciate your help.
Great tip. Does it work for WP too?
Facedandy xaikalitag satsetesque http://usillumaror.com - iziananatt Haseexcathe http://gussannghor.com GroptetMers
Facedandy xaikalitag satsetesque http://usillumaror.com - iziananatt Haseexcathe http://gussannghor.com GroptetMers
Great article, very updated.
Google should stop making a lot of changes.
Thanks for this article, it was very updated. But also google should stop making a lot of changes.
Facedandy xaikalitag satsetesque http://usillumaror.com - iziananatt Haseexcathe http://gussannghor.com GroptetMers
Facedandy xaikalitag satsetesque http://usillumaror.com - iziananatt Haseexcathe http://gussannghor.com GroptetMers
Add new comment