Tracking internal search with Drupal and Google Analytics

After some playing around with not working settings, its quite easy to do. But since its not well documented, i’ll write a quite How To here.

 

Setting up Google Analytics

Assuming you have your Google Analytics set up properly there are some settings here that we need to take a look at.

  1. Go to the overview page of ALL websites
  2. Search your Drupal website and click on the EDIT on the right site
  3. Under “Main Website Profile Information” click the edit on the top right corner of the box
  4. Under “Site Search” make sure “Do Track Site Search” is checked
  5. Under “Query Parameter” fill in “search,search/apachesolr_search,search/multisite_search” without the “
  6. Click save changes
Back to top  

Setting up Drupal

You need to have the core search module enabled for obvious reasons. It should work out of the box for normal Drupal sites.

If you are using the Google Analytics module :

  1. Go to admin/settings/googleanalytics
  2. Under “Advanced settings” make sure “Track Internal Search” is checked
  3. Click save changes
Back to top

About Mario Albrecht

Mario's first programming experience was a small calculation program written in BASIC on a Commodore Amiga in the early 90s. Since then, he as written code for dozens of companies and nonprofits such as Mednovo Medical Software Solutions, Telesense and ROOT Gaming. He creates modifications and tool for video games, like Diablo 2 and StarCraft 2, and helps out as technical administrator on various big internet communities and clans.

Mario uses Delphi as his language of choice for desktop development and PHP / Drupal for web applications. Mario loves challenging problems of any nature. If there is somebody saying "Thats technically not possible!" you'll most likely find Mario with his headphones on, working on a solution.

On weekend adventures, you'll find Mario playing a nice game of Magic: The Gathering or in a pub drinking beer.