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.

edit

2. Click "Edit" next to Main Website Profile Information.

edit2

3. Under "Site Search", enter the following parameters:

Site Search

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

john coffey's picture

Hi Wes,

Have you been able to get this to work while using 'clean URLs' ?

Thanks - JoC

wjones's picture

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?

Shane O' Henry's picture

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

Website Designing Services in India's picture

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.

Clipart Illustrator's picture

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.

Blake's picture

Great tip. Does it work for WP too?

Demaemiainhiwzl's picture

Facedandy xaikalitag satsetesque http://usillumaror.com - iziananatt Haseexcathe http://gussannghor.com GroptetMers

Demaemiainhiwzl's picture

Facedandy xaikalitag satsetesque http://usillumaror.com - iziananatt Haseexcathe http://gussannghor.com GroptetMers

Finden Sie mehr heraus's picture

Great article, very updated.
Google should stop making a lot of changes.

Finden Sie mehr heraus's picture

Thanks for this article, it was very updated. But also google should stop making a lot of changes.

kacey lu's picture

I found the entire Software Tailor team to very helpful and knowledgeable.
You help me understand the differences between the other systems on the market
and the Software Tailor system.Please find
Software Outsourcing

voice's picture

In addition, Google analytics for mobile package allows Google analytics to be applied to mobile sites. The mobile package embodys server-part tracking ciphers that consume PHP, JavaServer pages, ASP.CHIC, or Perl for its server-sidet language.
online phd programs

dh's picture

dh

Deangelo's picture

Its really great to see your blog i appreciate for a great blog. http://legalvideos.co/

Add new comment