Tracking Country Specific Google Search Engines in Google Analytics using Filters

Tracking additional search engines (see 1, 2 and 3) in Google Analytics is hardly a new thing. The usual method of adding additional search engines to be tracked would be to use the _addOrganic() function of the tracking code. While that works perfectly, I would like to propose a different way of achieving the same results using filters in Google Analytics.

The advantages of using filters:

  • You can (and you should) create an additional profile with the same tracking ID to track country specific search engines while leaving the original profile for an overview. Calling _addOrganic() will modify all the profiles with the same tracking ID.
  • Visitors to your website do not have to load a long list of JavaScript code containing all the additional search engines you want to track therefore reducing some (minimal) load time.
  • There should be no changes required even if Google deploys another search engine at If you call _addOrganic() with a static list of search engine names, you will have to add and update your list of search engines to track.

This is an example of the steps required to track additional Google search engines using a single filter:

  • Create an additional profile with the same tracking ID.
  • Add a new filter with filter type as “Custom Filter” and choose “Advanced“.
  • Select “Campaign Source” under “Field A -> Extract A” and enter “^google$” as input.
  • Select “Referral” under “Field B -> Extract B” and enter “^http://www\.(google\.[^/]*)” as input.
  • Select “Campaign Source” under “Output To -> Constructor” and enter “$B1” as input.
  • Set “Field A Required” to “Yes“.
  • Set “Field B Required” to “Yes“.
  • Set “Override Output Field” to “Yes“.

What this filter does is to check that the traffic source is one of Google’s search engines and thus extract the “” part from the referral field (usually something like “…“) then show the search engine source as ““. Do take note that while this is an example for Google search engines, the same steps (with slightly different input) will work with other search engines.

Bookmark and Share
This entry was posted in Uncategorized and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • Pingback: Google Analytics Setup

  • Ani Lopez

    Fantastic! That is what I was looking for, I'll test it in one of my sites to see what data can I segment

  • Aaron Bradley

    Very useful information – thanks.

    However, while this system will seemingly track Google regional engines well, what about Bing?

    Bing doesn't use variant domains for different regions; worse, they don't appear to use query strings identifying regions that can be parsed. Perhaps this is a limitation of Google Analytics when it comes to Bing (and many other situations in GA, such as redirects where referrer-identifying parameters are dropped in the final rendered URL that GA uses). Perhaps is a hard limitation of all analytics packages: it would be interesting to know if enterprise packages like Omniture or Coremetrics displays regional Bing information.

    A bit of red herring, I know, as Bing barely registers compared to Google in most non-US markets. But this may become more of an issue if Bing gains more international market share.

  • Derick Ng

    Great. Let me know if it works for you as well!

    Edit: Just remembered having an issue with this. It only work in modifying the *first* visit that came directly from the search engine since I was relying on the “Referral” field. This meant that subsequent visits (e.g. from a page refresh after 30 minutes) will be tracked inaccurately. This will still work fine if the purpose is just to understand entrances. Otherwise, it may be better off using _addOrganic() method.

  • Derick Ng

    Bing is stuck to using cookies for that, unfortunately. I am quite doubtful of any analytics software being able to display Bing's regional information unless it manages to exploit browsers' cookie handling. I.e. reading cookies from other websites. I do remember reading somewhere that it is possible with some hacks but this will definitely not be something that will remain “open” for a long time.

    You are probably right that most analytics packages will fail without the referrer headers which brings me to worry more once browsers supports HTML5 and its rel=”noreferrer” tag.

  • seopilot

    Thank you this nice post.

  • Pingback: 在谷歌分析中使用过滤器谷歌本地搜索引擎 - 肖庆的外贸营销博客 -:>谷歌分析,谷歌广告,搜索引擎优化,搜索引擎营销,百度推广

  • Pingback: Click Here