As Twitter increasingly becomes a tool that people use to find information it is really critical for companies to know how people are finding their sites on Twitter. Doing so will allow them to incorporate that learning into future marketing efforts on Twitter as well as other sources (e.g. Google etc).
Since Google Analytics does not yet recognize Twitter search as a search engine like WebTrends or Ominiture does, I will show you how you can do it easily with one line of code.
However, keep in mind this solution only works when the search originates on Twitter (i.e. http://search.twitter.com). 3rd party tools like TweetDeck, those will not be captured in this solution (nor will it, I believe, be captured in WebTrends’ solution). Use this information to understand general search keywords being searched on Twitter but do not get caught up in actual number of visits that your Twitter efforts are driving.
So how do you capture searches conducted in Twitter?
GA provides a few functions to allow you to add your own search engines to the list of search engines that are already tracked by GA.
You simply call this function right after var pageTracker = _gat._getTracker(“UA-XXXXXX-X”); This functions to track any custom search engine.
Twitter uses “q” as the querystring that contains the keyword. So in this case our search engine is search.twitter.com and newOrganicKeyword is the value in query string q
So you code will look like
var pageTracker = _gat._getTracker(“UA-XXXXXX-X”);
(Note: pageTracker._addOrganic(“twitter”, “q”) will also work)
What will the reports look like in Google Analytics?
Note: For some reason I cannot get Twitter search to show up as Twitter in Google Analytics Search Engines report, it shows up as “search”(Maybe it’s a bug in GA? If anybody can provide pointer that will be a great help). However, for now this works fine as long as you know what “search” means in your search engine report. I am playing with filters and if I get that resolved I will post the fix or if you know the fix please email me.
Search Engines Report will show the following:
Drilling down to keywords will show the keywords on Twitter Search.
Looks like Twitter Search brings me repeat visits and more engaged traffic.
Originally Posted at : Adding Twitter Search to Google Analytics – Web Analytics, Behavioral Targeting and Optimization by Anil Batra in Feb. 2009