Forum Moderators: DixonJones

Message Too Old, No Replies

Tracking the referring keyword for Google Image Search traffic

         

dailypress

7:30 pm on Dec 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can someone please explain a few ways to find out what keywords are referring Google Image traffic?

Google.com/webmasters OR Analytics?

Achernar

12:49 am on Dec 15, 2007 (gmt 0)

10+ Year Member Top Contributors Of The Month



If you know the user is coming from google images, then you should find the searched keyword(s) in the same referrer string.

Jasp

3:53 am on Dec 15, 2007 (gmt 0)

10+ Year Member



You need to urldecode the 'prev' parameter of the referrer, and then grab the 'q' parameter within that.

For php you could use this:


function get_vars($string)
{
$ret = array();
$v2 = split("[?&]",$string);
foreach($v2 as $x1){
$x = explode("=",$x1);
$ret[$x[0]] = $x[1];
}
return $ret;
}
function get_var($var_name,$string)
{
$a = get_vars($string);
return $a[$var_name];
}
$referrer = $_SERVER['HTTP_REFERER'];
$prev = get_var('prev',$referrer);
$prev = urldecode($prev);
$q = get_var('q',$prev);
$var = str_replace("+"," ",$q);
echo "image search keywords:".$var."<br />";

But the solution you are looking for to track image search with google analytics can be very easily found on the web by using your favourite search engine.

tedster

9:01 pm on Dec 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From what I'm reading, a key step for using Google Analytics is adding images.google.com as a separate search engine - otherwise it is tracked merely as a referer.

References:
[code.google.com...] (see "Search Engine Configuration" section)
[joostdevalk.nl...]

Also note, the referer strings from Google Images can be extremely long - so some tracking software truncates the referer url, which drops the keywords so they're not available. If this is the case for anyone, they need to modify the analytics package they are using or get the supplier to do that.

dailypress

1:01 am on Dec 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thanks guys!

Receptional

10:17 am on Dec 17, 2007 (gmt 0)



If one adds "images.google.com" as a search engine, beware of duplicating your traffic signals. If you are already using something like a bolean expression like: "URL contains google.com" as a search engine, then many analytics packages will now count those image search visitors twice.

jdevalk

4:17 pm on Dec 17, 2007 (gmt 0)

10+ Year Member



You might want to add images.yahoo.com as well, if you want to track your image search keywords...