Yoast: Building Page.ly Part4: Scalable and Fast Managed WordPress Hosting | Page.ly Blog http://t.co/ba32Hemn
![]()
Google Analytics and Google Image search: revisited
I wrote earlier about using a custom urchin.js to get Google Analytics to extract the keywords from Image Search. Now my colleague Roy recently spoke about this with an engineer from Google, and this engineer suggested that I could just rewrite the one function and add that as an extra javascript instead of using a completely custom urchin.js. This is, of course, way more preferable, because it saves quite some bandwidth, and you won't have to update every time Google updates it.
What you have to do is this:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> <script src="http://www.example.com/custom_se.js" type="text/javascript"></script> <script src="http://www.example.com/track-imagesearch.js" type="text/javascript"></script> <script type="text/javascript"> _uacct = "UA-XXXXXX-X"; urchinTracker(); </script>
The custom_se.js adds the extra image search engines amongst other things, so you can see stuff is coming from image search. Otherwise the hits would be counted as "plain" Google. The track-imagesearch.js rewrites the _uInfo function, and makes sure Google "get's" it's own image search parameters.
You can download the two zipped together: Track Image-search Scripts.
This post will tell you how to do this with the new ga.js script.






by webdesign on 7 September, 2007 at 13:27
This is indead a much better approach to the script !
thx for the tip cause this saves a lot of editing work when google updates !
keep up the good work and kick those Ba**ER*S of Dmoz for me :)
by Joost de Valk on 7 September, 2007 at 13:34
The WordPress plugin I'm building which supports this is nearing completion to, testing that with a few people now.
by webdesign on 7 September, 2007 at 14:23
ok good to hear that !
i dont use wordpress for myself but i come along it way to often to let such a plugin uninstalled :)
by Avinash Kaushik on 8 September, 2007 at 01:03
Joost,
This is a very elegant solution!
Thanks so much for putting this out there for the good of all us analytics practitioners! :)
-Avinash.
by John Stevens on 8 September, 2007 at 22:11
Joost, thanks to share this with us. What is more important to you? To know what really comes from the plain search (so filter out the image search) or to find out how many users and via what keyword visitors ends on your website?
Personally I don't give much attention to Google Image search... should I do that ? Maybe your tool can convince me.
by DennisG on 9 September, 2007 at 16:34
Joost,
Thank you very much.
Through Mybloglog I already know that image search is a big part of my search engine traffic. Now, getting it consolidated in Analytics makes a lot of sense.
Does this mean that you can tweak the track-image.js for other search engines from Google.
Blogsearch.Google comes to mind here.
Thanks
Dennis
Pingback: Grow A Blog » Blog Archive » redcardinal: Getting Traffic From Image Search. (Search Engine Optimization (SEO))
by Joost de Valk on 9 September, 2007 at 20:04
Yeah Dennis, it does :) In fact, adding blogsearch is probably a great idea.
by Rhoda Schueller on 9 September, 2007 at 21:24
Hi,
I want to thank you for your method to track image searches. I added the original files with added images engines like Yahoo and Ask. A few others too though I have not seen much from the others. Yahoo has sent traffic for images. I would like to try your new file out that is specifically for Google image searches. However, will it cause problems with the Yahoo image searches? Or will it just process the Google image searches and not affect any of the other engine image searches?
Thanks,
Rhoda
by Joost de Valk on 9 September, 2007 at 21:27
@Rhoda: it will not affect any of the other engine image searches.
Pingback: Web Analytics Facts » Google Analytics tips
by glamcars on 12 October, 2007 at 11:29
I`ve just installed this plugin and waiting results. I have one question - is google-analytics system updates every domain once per day? I`ll be very happy if it`ll make this even twice per day... Thanks a lot for plugin
by Joost de Valk on 12 October, 2007 at 11:43
It's once a day yeah.
by George on 18 October, 2007 at 09:53
One quick tip for us part-time coders out there: make sure you change, in the code above, the "www.example.com" to your own domain! I noticed my stats were dropping off and I finally went back and looked at the code - I realized I never updated the example.com text to my own domain!
I made some other mistakes that hurt my Google Image search in general (not sure exactly why, but I read somewhere that when 301 redirecting you should leave the old content up for a few months, which I didn't do - I thought that was what the redirect was there for).
I am hoping that renaming the image files and pages was what hurt my image search results, and that they will eventually be reindexed. I wish I would have found your mod_rewrite for underscores to dashes first! I did need to rename some files anyways.
I guess when you learn this way you never make those mistakes twice!
by Joost de Valk on 18 October, 2007 at 09:54
@George: "I read somewhere that when 301 redirecting you should leave the old content up for a few months, which I didn't do - I thought that was what the redirect was there for)."
You were right and what you read was NOT true.
by George on 18 October, 2007 at 10:05
Thanks for that info!
Now I wonder what I did to cause all my images to drop out of the Google Image search results.
Blog images are fine (blog is in a subdirectory of my main site), but all the images from my main portfolio site are no longer in GIS when they used to be on the first page for the same keyword searches.
The hunt goes on I guess. Thanks again!
by Domus on 21 November, 2007 at 18:37
Thank you very much!
by Mitico on 8 December, 2007 at 11:19
I have included your scripts but Analytics continues showing images.google (referal). Any idea?
Pingback: Image search keyword tracking with the new Google Analytics - Analytics - Joost de Valk’s SEO Blog
by homicidal on 19 December, 2007 at 19:16
hi Joost,
An excellent script, I read it this morning and set it up today, and already am I seeing the hits coming from image searches enter in the 'search engines' section rather than the 'referring sites' section, which makes everything a lot more clearer (ie bounce rates, exit rates are generally higher for image searches). I run a small NSFW-ish blog :P with a lot of celebrity images so I attract a lot of image search hits.
Amazing actually that Google sofar hasn't put this functionality standard in Analytics, they should take your script and give you credit for it!
Thanks again, a new big fan of your blog! (counts as a conversion! :)
by Kristjan on 16 January, 2008 at 19:09
Hi,
All these improvements are great, but could you tell
the visitors if all this works with new google tracking code at the start with red color or something. Saves a lot of buzz.
Does your image search work if I change search engine list according to ga.js
pageTracker._addOrganic("search_engine_name","query");
Cheers
Kristjan
by Rhoda on 17 January, 2008 at 02:22
Hi,
I would like to say that I converted one web site to the new ga.js for Google Analytics. I also converted the custom_se.js file listing the search engines. I now see images.google.com but only as a referral. Clicking on the listing does not lead me to the keywords as it does with the organic listing for images.google.com in the old system with the urchin.js. In the old system I also have image listings from other engines too all called organic which will lead to keywords by clicking on the organic listing.
Not sure what the problem is.
Rhoda
by webdesign on 20 January, 2008 at 13:32
i tried the code as well !! it worked fine ! you can see every referer !! i even added a few of my own.
by Eoghan on 19 February, 2008 at 20:32
Joost, Thanks for making this script available. I have been using it for several months now. As I am going through an effort to reduce the size of my website I ran the 9kb custom_se.js script through the compressor at http://javascriptcompressor.com/ and the compressed version is just over 50% smaller. Do you know if there would be any problems with this smaller version? Would it work as the original version?
by Joost de Valk on 19 February, 2008 at 20:33
Eoghan: it would probably work just as well! There's a lot of whitespace etc. in the file...
by Eoghan on 19 February, 2008 at 20:43
Joost, thanks for the quick reply. If it was only white space removal I would be fully confident however it also obfuscates the Javascript code, hence my doubt. Do you think that the obfuscating would make it work any different? A quick look at the code the compression tool pumps out might give some indication, unfortunately I don't have the javascript knowledge to make such a call...
by Joost de Valk on 19 February, 2008 at 20:45
By it's nature, obfuscated code is hard to read ;) Can't you just minimize it and NOT obfuscate it?
by Robin on 10 May, 2009 at 18:54
How do I know if this is recording data? How will it show up in my analytics account - under which section? Thanks :)
by Ion de la Paclisa on 9 July, 2009 at 02:53
Finally I think I managed to get it work...
After I checked the "Track extra Search Engines" in the plugin options it appeared in the analytics code
"... wp-content/plugins/google-analytics-for-wordpress/custom_se.js" type="text/javascript">
You never said that on the plugin page.. you just kept on putting links...
Pingback: Nerd Alert: Track Keywords from Google Images via Analytics « AfghanAnt – Still Dreaming…
Pingback: Google Analytics: keywords fehlerhaft, Bildsuche vergessen | tagSeoBlog
Pingback: Traffic from google image - WebProWorld