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, 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:

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:

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...


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 to, 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") :

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 - iziananatt Haseexcathe GroptetMers

Demaemiainhiwzl's picture

Facedandy xaikalitag satsetesque - iziananatt Haseexcathe 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


Deangelo's picture

Its really great to see your blog i appreciate for a great blog.

Quantos's picture

Hi Wes. Thanks for this post. Should the advice here still apply to current versions of Google Analytics? I'm struggling to get Google identify the 'category parameter' in the results and I can't get the Drupal GA moderator to shed any light on it. The site is standard Drupal 7.28 site running the core search module + Custom Search module and I've tried every variation I can think of for the 'Category Parameter'. In search results URL I've got 'type:' (see sample search result: whereas the moderator believes that the category parameter should be 'cat' which I can see in the source code. In both instances Google's search results emphatically state that the search results 'site search category' is '(not set)'?

The long and short of it is on here:

Ideally I'd like to not only sort this but document the issue back to the Drupal community - if you could help?

Much appreciated in advance.


rai2014's picture

Just discovered this site thru Google, what a pleasant surprise!
Guar Meal Korma

ram14's picture

Apple products are revered for its quality, precision and great design. SRSG started its operations as Apple technology partners in the year 1997.
Apple authorized service center Mumbai
Apple product dealers in delhi
Broadcast audio equipments in india

meck's picture

screw air compressor
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.

Sunish Abraham's picture

I am trying to understand what this "Track internal search" setting actually does...we use the GoogleSearchAppliance and the /search (D6) or /gsearch (D7) is handled by the GoogleSearchAppliance module...does the GoogleAnalytics module with that "Track internal search" setting enabled send some page event to GA? Thanks...

Add new comment