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/

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: http://www.flexej.co.uk/search/node/260mm%20type%3Arubber_bellows) 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: https://www.drupal.org/node/2309183

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.

Q.

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

alice's picture

printing services
I am really impressed with your efforts and really pleased to visit this post.

dogtrainingphoenix.net's picture

Employment advice lately comes in any forms. It's effortless get "lost while in the lingo" nonetheless understanding quite a few basic definitions can certainly help enable you to get the perfect support for your needs. To indicated simply, whether you require career information or employment development varies according to what your address is on your job journey. technews404.net

dogtrainingphoenix.net's picture

Building the significant decision to hunt a employment change just after 50 normally would not come from a single event and also one likelihood. Rather it is the slow splash, drip with events this trigger it. inceptiontech.net

dogtrainingphoenix.net's picture

Employment change eventually often by way of events 100 % beyond all of our control. Your online business and industry may perhaps be dying plus budget slices restrict your capability do your job and you will be now expected to do extra with a reduced amount of. Or a person's boss is definitely beyond arduous, cheapssoftware.net

dogtrainingphoenix.net's picture

Life-long employment and discussing one manager our full working life is actually a thing with past. With these current fast-paced world economy, careers plus industries find a way to change plus come plus go suddenly. lincolnwebhosting.net

dogtrainingphoenix.net's picture

It's really sad if a rest off comes these are typically the same folks that will find it hard to launch its job investigation quickly. It doesn't end up being that manner! Here will be three "must do" employment success exercises. vetwebdesign.net

dogtrainingphoenix.net's picture

Business enterprise networking is likewise important to get career being successful. Keeping a person's network active is often fun and beneficial. Everyone has had colleagues plus managers that are fitted with left the firm to progress to others. To reside connected simply purchase the phone to talk about hello. software-uptodate.net

Add new comment