Don’t Lose Your Google Image Search Traffic
June 21st, 2007 by Stefan JuhlIn my last post I mentioned that I had discovered one of my websites getting tons of image search traffic. But I also found that I was losing much of the traffic that I kind of deserved. This isn’t a my-website-only thing, actually most websites ranking on Google image search aren’t fully leveraging the “traffic they get”.
Many Google image search users are quickly clicking on to the direct image URL and thereby not seeing the page with the image. Also, it seems that many of the users don’t hesitate to click back to the image SERPs when they don’t see the image “above the fold” - probably because of Google image search framing the page with the picture and thus making it almost too easy to do so.
How to leverage Google image search rankings
This can easily be solved. It’s not something new nor is the “solution”, but still very few websites seem to do it. All you have to do is add a simple JavaScript - like the one below - to prevent framing of your pages (this is of course a bit more complicated if a website uses frames, but I hope yours doesn’t..).
<script language="JavaScript" type="text/javascript">
if (top.location != self.location) top.location = self.location;
</script>
After adding this to the one of my websites I saw a quite big increase in pageviews. It turned out that the visitors happily continued to browse around the website - which I find somewhat impressive since it’s not really an image focused website.
I can’t say for sure what Google’s standpoint is on breaking out of the image search frameset. But I don’t believe Google would punish webmasters who utilize such a script. Because such breaking-out-of-frames scripts are somewhat common and it’s really not a big deal. And I’m very sure that Google are aware of many websites doing this, that are still included in the image search index.
You should note that you might be getting image search traffic even though your stats/tracking system doesn’t report it. I won’t bother going into the details about this, but it happens with some tracking systems that are JavaScript based and try to get information that isn’t allowed to be retrieved from “external domains” - which a website will be since it’s framed by Google. This results in JavaScript execution being stopped by the browser, and thereby the traffic won’t get tracked.
Update:
LordThanatos suggested in the comments, that the following code can be used instead, and then avoid the back button problem that makes a user unable to go back to where they actually came from.
<script language="JavaScript" type="text/javascript">
if (top.location != self.location) top.location.replace(self.location);
</script>
Posted in Black Hat SEO, White Hat SEO, Monetization |











June 21st, 2007 at 12:01 pm
this sollution could bring your site down in teh SERPS in time. This is because this script is also used by mostly a lot of the spam pages.(offcourse encoded to make it less visible to users and SEs)
i would not apply this redirect method personally.
June 21st, 2007 at 12:40 pm
Geskimo, I don’t agree with there being a risk of this causing penalties. First of all because it’s not used on spam pages - the redirect scripts used on such are quite different (and yes, obfuscated). Which basically means that Google has to manually identify the script or check its behavior.
Another reason is that breaking-out-of-frames scripts are very common and necessary in many cases - and Google can’t afford to penalize such since it would affect the the SERPs too much in a negative way due to many quality sites being filtered.
And lastly, I’ve never seen a site being automatically penalized or banned due to javascript redirects.
June 21st, 2007 at 2:47 pm
Hi Stefan,
i must dissagree here. In my experience until now i have had pages automatically identified because of JavaScript and on some case Google can understand JavaScript. Probably it has a scale of 1 to 10 on is this page Spam or Not and if you pages score on this is over a certain limit that page will be much closely analised. Anyway all this is based on my personal experience.
I agree with you that this is a needed script by a lot of pages and website models, but i would personally stay away of it for important sites.
I would better try to identify that the search is coming from Google Images and make a redirect if so, or modify the page in such a way that it will create a visualy appealing model for a user to start browsing away in the site, if he comes from a Google Image search.
I have had sites banned because of JavaScript redirects, unfortunately and since then i stay away from them.(obfuscated or not).
At that point i decided to create the site more user frinendly and target the visitors more to make them take an action. On the short run a redirect is better but on the long term a cleaner site will surely be better.
Just my 2 cents
;)
June 21st, 2007 at 3:27 pm
Geskimo, There’s no doubt that Google penalizes sneaky redirects. But from all the legit and spam sites I’ve had my hands on my experience is that this clearly happens manually since it’s very sporadic. Otherwise Google would be damned Good and suck at it at the same time because I’ve never seen any false positives nor have I seen them penalize many of the clearly spam sites.
It should be very obvious to most that if Google would make a strict algorithm to determine javascript redirects and then penalize those automatically they’d simple lose too many great and legit websites from their index.
When you’re talking about create a visually appealing model for image search traffic, then you’re suggesting to cloak pages. This is “not allowed” if you’re strictly following the webmaster guidelines and it’s probably much riskier. But still, cloaked content doesn’t get automatically banned either since too many sites are utilizing this for legit reasons like geo-targeting etc.
Lastly, in case a site should ever get penalized or banned due to the javascript above (which I highly doubt), then it’s clearly a mistake on the search engine’s side. And with Google this should be solved quickly with a re-inclusion request through webmaster central.
June 21st, 2007 at 4:05 pm
In other search engines like Yahoo and MSN these would not be considered spam.The redirects have a long life there.
On Google i do not know(as i said).
Anyway this is a neat feature
and can be tested.
July 10th, 2007 at 9:02 am
Thanks, this was very interesting. I had not thought of it.
July 12th, 2007 at 5:20 pm
[…] 14. Use Javascript to prevent framing of your webpages By adding a piece of javascript code, you can prevent your images from being framed when users click on the image within Google Image Search. Visitors will not see the Google image frame but the full site and this may encourage more pageviews for your site as well. This practice may not entirely be endorsed by Google so try at your own risk. […]
July 16th, 2007 at 11:14 am
[…] The first is “Use Javascript to prevent framing of your webpages” which is a feature in Google Images I’ve always disliked a little. It’s like coming in from Google Search with an annoying header showing a text highlight the search words (a bit like with Google Cache). Basically, you can use a piece of Javascript code that I use on most of my sites which will disable that frame: <script language=”JavaScript” type=”text/javascript”>if (top.location != self.location) top.location = self.location;</script> […]
July 28th, 2007 at 5:03 am
[…] Prevent the framing of your web site with javascript - You can stop Google from framing your web site by adding javascript code to your pages. […]
August 10th, 2007 at 2:33 am
I’m curious if you’ve seen any negative consequences from the practice of breaking out of frames…
August 10th, 2007 at 1:37 pm
Used it for a number of years to get out of spammy sites that frame ours. I have never thought that there could be a penalty for doing so and I do not believe that there is.
August 11th, 2007 at 12:22 pm
Robert, I’ve used it for a couple of months on a site that I’m 99% sure Google is aware of due to the rankings and traffic it’s getting on their image search. And I haven’t experienced anything but success with the script.
Richard, I agree as I also don’t believe there are penalties for it.
August 15th, 2007 at 1:59 pm
[…] Chceli by ste odstrániť frames pri vyhľadávaní z obrazového vyhľadávania Google a dostať tak návštevníkov na vlastné stránky? Tak v tomto článku sa to […]
August 23rd, 2007 at 12:18 am
Stefan, I have been looking into this trick and I checked out an image result on Google for your site and it did not work. Is Google onto this?
August 23rd, 2007 at 12:31 am
Andrew, I don’t use it on this blog, so that’s why it didn’t work.. I’m still using it on other sites and it hasn’t caused any problems.
August 23rd, 2007 at 12:43 am
Stefan and Richard - Thanks for the feedback on the use of javascript to break frames. I’ll be deploying this shortly. Thanks again!
August 23rd, 2007 at 1:35 am
Stefan, could you email me a link to a site you are using this on? I’d like to recommend this technique to a client but I’d like to show them an example of how it works first. I’ll keep it confidential of course. If you’re not up for this it’s no prob. Thanks.
August 23rd, 2007 at 1:14 pm
Andrew, I’m not to happy about disclosing my websites. But here’s another well known website where the technique is utilized: www.thesuperficial.com - You can check the behavior by doing a site search: http://images.google.com/images?q=site%3Athesuperficial.com (you might need to turn off the SafeSearch filtering)
September 5th, 2007 at 2:01 pm
“Many Google image search users are quickly clicking on to the direct image URL and thereby not seeing the page with the image.”
So, how does the frame-breakout javascript help this? You can’t put javascript directly in the image
September 5th, 2007 at 2:15 pm
Atomische, the “direct image URL/link” is shown in the top frame, and unless the users computer/browser is very slow they hardly get a chance to see the image and click on it before they’re being redirected.
September 8th, 2007 at 12:24 pm
I have seen a very similar javascript used on this site:-
http://www.destination360.com/europe/ireland/rock-of-cashel.php
But it disrupts the user experience in that when they press on the browser ‘back’ button - it takes them back to the google framed page - which then automatically removes the frame again and puts them back on the above page (unless they click on the back button twice very quickly)..
Does you script so the same thing? (I was not able to get that superficial link above working…)
September 8th, 2007 at 7:47 pm
Jordan, unfortunately it does have the same effect..
September 10th, 2007 at 3:34 pm
mmmmmmmmmmmmmmmmmmmmm….
Thanks for the reply.
All the same - it IS tempting…..
September 13th, 2007 at 9:33 pm
Hello again.
I started a thread here
The feedback there persuaded me to try it and see how it goes!
Thanks for the idea…
September 17th, 2007 at 2:16 pm
It went badly! (for me anyway). See the above thread for detailed info…
September 18th, 2007 at 1:36 pm
There are framebuster scripts that do not create an entry in your history, and therefore you will not have to click the back button twice real fast to go back: Frames Buster
Cheers!
September 20th, 2007 at 11:50 am
Jordan, I just checked the thread you created. The part about your stats getting messed up is quite obvious since a page will be loaded twice, if the script/browser isn’t acting fast enough to interrupt following javascripts on the page. A workaround for this could be to add a delay in the javascript after the redirect command, but that would also cause any other javascripts to be delayed on regular pageviews.
The other thing you’re talking about is a drop in your adsense earnings. I haven’t experienced anything like that. But to make sure, it’s your overall revenue that dropped? How was the pageviews, CTR and eCPM affected?
John, your script only gives a user more time to click the back button twice. So it doesn’t really solve the problem. But most importantly, it decreases the desired effect since it will give users more time to click on to see the image directly without the page, which is pretty much what we want to avoid.
January 29th, 2008 at 4:26 am
I think Google should remove the framing of images. Its a bad practice. What if the framed organic search? That would really suck! I search with images just the same as text so why should it be framed
February 6th, 2008 at 7:25 pm
Before I write this comment I want to suggest you to add the Subscribe to Comment plugin, so users can track a discussion adn get an email when someone is commenting on a blog.
Now ..I’ve added this little script to a website of mine, and after a few days I’ve noticed that Google Search Image traffic from Google Analytics decreased. Might be this because the script is to fast, and the tracker can’t get the reffer ?
And a final question that haven’t been resolved ….is this legal ? Can you website suffer from this ? I want a clear answer, and I’m sure I’m not the only one.
February 7th, 2008 at 10:27 am
Michael, I’ll consider the “Subscribe to comments” plugin.
In regards to this technique and Google Analytics reporting, yes if this script is placed before your Google Analytics code in the html then traffic probably won’t get reported.
Unfortunately I can’t give you a clear answer on whether or not Google is okay with this. Only Google can, so you’re probably best of asking them. The one thing I can say is that I’ve used this technique since before writing this post and I’ve still not seen any signs of it having harmed my sites, rankings etc. in any way.
February 13th, 2008 at 11:45 am
Hi. About that “back button” problem. You can use this:
if (top.location != self.location) top.location.replace(self.location);
location.replace does the trick without adding a new URL to the history.
February 13th, 2008 at 4:51 pm
LordThanatos, spot on.. thanks!
February 21st, 2008 at 2:53 am
Highly informative. I emailed google adsense to try to get a definitive response from them. There was a toing and froing of emails (3 from them to me in total) as they didn’t seem to understand what I was asking. They kept sending me irrelavant replies about not being allowed to load ads in frames etc etc blah blah. I kept trying to explain, and their final response was “we can’t answer questions not related to adsense”.
So I asked, and they certainly didn’t say it’s not allowed. I’ve just installed the updated script one one page as a tester, and it works an absolute treat. If I experience any negative results, will come back and post.
February 23rd, 2008 at 11:14 pm
Chris H, there’s the matter of Google’s search index and whether or not they approve of it, a question the Adsense support probably can’t answer. But in regards to Adsense, one should probably make sure that Adsense doesn’t get loaded on pageviews that are going to break out of frames, as it would result in a view that doesn’t get shown, which is quite bad if some advertisers are paying on a CPM basis.
February 27th, 2008 at 10:14 pm
I’m trying this on a large picture website.
I’ll report back in a month with mi findings.
March 25th, 2008 at 2:46 am
How about if want to break the frame from every site out there except one, how will the javascript look like (the second one, from LordThanatos that is)?
March 25th, 2008 at 7:48 pm
If you wished to install this onto a Wordpress powered site, what php page would you put it on and where? Would it be in the header.php page between the tags or in the body?
Cheers,
Khalid.
March 26th, 2008 at 11:52 am
Mickey, it would look like the below, but with the domain of the site that’s allowed to frame a page, instead of WWW.DOMAIN.COM:
<script language="JavaScript" type="text/javascript">
var loc = top.location.href;
var ls = loc.indexOf("//");
var ds = ls + 2;
var wr = loc.substring(ds, loc.length);
var ns = wr.indexOf("/");
var domain = wr.substring(0, ns);
if ((top.location!=self.location) && (domain!="WWW.DOMAIN.COM")) top.location.replace(self.location);
</script>
I haven’t tested the above code, so you might need to mess a bit with it. Also note that the script needs improvement if the allowed site uses multiple subdomains.
March 26th, 2008 at 11:58 am
Khalid, yes you could just put it somewhere in between <head> and </head> in header.php
March 27th, 2008 at 12:34 am
Stefan, thanks for the prompt reply, has there been any further reviews yet? I am curious to know the long term effects, both on traffic and seo.
Thanks,
Khalid.
March 27th, 2008 at 11:37 pm
Thx Stefan, Im gonna try it out.
March 31st, 2008 at 9:32 am
Khalid, there are no reviews except the ones on this page.
April 15th, 2008 at 4:06 am
Thanks! It works well. Mine loads a bit slowly, but it works. If you want to test it, search for ” coach bag ” and click on one of the results under ” colour-dreams.net “.
Thanks! I will be watching carefully for lowering in rank, but I get soooooooooooooooo many Google Image searches, and I just noticed this happening on The Superficial and similar sites, so I decided I must have it.
April 16th, 2008 at 2:34 am
Web masters!
Please stop using this technique. It is immoral.
I leave sites which use this technique immediately.
By using this you are taking control away from the user and that is no better than what malware does.
April 16th, 2008 at 7:57 am
Me, I disagree since the only thing a user miss out on is Google’s framing of a given page. It mainly has to do with Google and not the users. Comparing it to malware is just plain stupid.
April 18th, 2008 at 11:11 pm
To Me:
I totally disagree with your malware statement. Let me pose something your way. How would you like it if you had a site and Google framed your keyword results? doubt you’d like it. Well then why should they frame image results?
This is something google should quit doing. Quit framing image results…
April 22nd, 2008 at 7:40 pm
I site I’m updating gets a huge amount of Google image search hits. I think if you don’t disable the back button this is a great way of retaining some of the otherwise useless traffic.