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 www.google.new.tld. 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 “google.com.sg” part from the referral field (usually something like “http://www.google.com.sg/search?q=…“) then show the search engine source as “google.com.sg“. 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.
blog comments powered by Disqus