Home > Others > Tracking Google Image Search In Google Analytics

Tracking Google Image Search In Google Analytics

August 24th, 2011

Today I modify the tracking  code in sokubag.com,  for tracking  the traffic from Google Image. Main Code is as follow:

//handle search referrer
var ref = document.referrer;
if ((ref.search(/google.*imgres/) != -1)) {
var regex = new RegExp(“\.google\.([^\/]+)(.*)”);
var match = regex.exec(ref);
_gaq.push(
['_setReferrerOverride', 'http://images.google.' + match[1] +
unescape(match[2])],
['_addOrganic', 'images.google', 'q', true]
);
}

Note: place this code before _setCustomVar( if using setCustomVar ).

Refer: http://www.google.com/support/forum/p/Google+Analytics/thread?tid=7731f9d0e198f11e&hl=en

Today I find many methods is not work. For example:     push['_addOrganic', 'images.google', 'prev', true] , then add filter.

This method don’t work now. Because google image search url has change now, for example : www.google.com/imgres?q=XXXX.  So we must change the tracking code.

 

 

 

 

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • MySpace
  • RSS
  • StumbleUpon
Comments are closed.