Forum Moderators: martinibuster

Message Too Old, No Replies

Effect of 'frame busting' code

Describes the possible effect of inserting javascript in pages.

         

thaiwebsites

4:44 am on Sep 25, 2005 (gmt 0)

10+ Year Member



Having noticed that my webpages are displayed in frames n other websites, and somehow not really liking that, I inserted some frame busting Javascript code into my pages. The effect on my adsense statistics was quite remarkable. The pages were the code has been inserted seem to be counted twice.
Well, that may not be too bad I guess, bringing the CTR down substantially however. But most alarming the absolute number of clicks has decreased dramatically. The sites involved get between 550-700 clicks a day, actually quite stable and rising over time. However, during the 24 hours I run the Javascript code, the number of clicks decreased to 350, which is the lowest for many, many months.
I decided not to wait for further data (earnings are down proportionally) and removed the code from my webpages. The code involved is actually a very simple script, just a few lines. Anyone had similar experiences with the same or other Javascript code?

deepesh

5:06 am on Sep 25, 2005 (gmt 0)

10+ Year Member



My best Guess will be that ppl were cliking your ads when they saw it on other site in FRAMES. Also, frame busting code may seem like a popup opening.

Jenstar

5:10 am on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Certain frame breaker scripts can cause AdSense to repeatedly load within the iframe, since the script keeps breaking the iframe as well. This is against the terms - technically it is impression fraud - so you should definitely remove it.

ann

5:49 am on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am using the one I picked up here in WW and I have seen no anomalies associated with it.

This one keeps the back click.

Ann

Woz

5:54 am on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps Google could publish an acceptable frame-buster script that does not interfer with tracking.

Onya
Woz

jetteroheller

6:02 am on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



All my sites have since years

if(top.location!=location){top.location.href=location.href}

Why should a frame buster have more lines?

The Contractor

12:28 pm on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have been using the following for well over a year with no problems whatsoever with AdSense:

<SCRIPT LANGUAGE="JAVASCRIPT" type="text/javascript">
if (top!= self) top.location.href = location.href;
</SCRIPT>

incrediBILL

6:36 pm on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The pages were the code has been inserted seem to be counted twice.

It might double load AdSense if you put the code in the middle or the bottom of the page or something silly like that.

Make sure it's above the <BODY> in the <HEAD> section of your page so the frame is broken before any of the page is displayed.

ann

8:17 pm on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is the one I picked up here on WW. I place it just above the </head> tag:

<script language="JavaScript1.1"
type="text/javascript"><!-- // hide from old browsers
if (parent.frames.length > 0) top.location.replace(document.location); // Escape from any referring site's frame, but preserve one-click "Back". -->
</script>

I have this on all my sites and pages, seen no trouble at all.
Ann

Garfieldt

8:49 pm on Sep 25, 2005 (gmt 0)

10+ Year Member



I've picked this up on WW I tested it, and it works great. Havn't had a problem at all with adsense.

<script type="text/javascript">
if( window!= window.top ) { top.location.href = location.href; }
</script>

vordmeister

9:00 pm on Sep 25, 2005 (gmt 0)

10+ Year Member Top Contributors Of The Month



I've been using the same code as Ann. Presumably I copied it from the same WebmasterWorld thread. Seems to work well.

I put the code in for image searches to improve the user experience by breaking them out of G and onto my site instead.

crescenta

9:40 pm on Sep 25, 2005 (gmt 0)

10+ Year Member



I have a frame buster on one page, that other sites keep on linking to (they put their ads on the top frame). It's just one page, so I removed all ads from it, just to be on the safe side. (I was worried about inflated impressions as well.) It is gratifying to see the freeloading sites (who were trying to exploit my page) being thwarted by the framebusting.

foxtunes

9:44 pm on Sep 25, 2005 (gmt 0)

10+ Year Member



Here's one I've been using that works a treat.

<script language="JavaScript" type="text/JavaScript">
if (parent.frames.length > 0) top.location.replace(document.location);
</script>

Quoting Ray Parker Jr - "....Bustin' makes me feel good...."

Broadway

10:12 pm on Sep 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Someone came up with a twenty year old Ray Parker Jr. lyric right off the top of their head? This is an interesting crowd.

Alioc

12:44 am on Sep 27, 2005 (gmt 0)

10+ Year Member



Do it using .htaccess instead of JS.

NoLimits

12:49 am on Sep 27, 2005 (gmt 0)

10+ Year Member



I don't visit sites that break frames. When I'm using Google, or anyone elses image search, breaking my frames torques me off. I have the option to break the frame if I deem the site worthy of being viewed in further depth.

You may as well remove your back button.

incrediBILL

1:02 am on Sep 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



breaking my frames torques me off

Well, you can just be torqued.

Having idiots frame my site with AdSense in the other frame torques me off, or any other advertising for that matter. To be blunt, nobody has a right to stick my site in a frame, I don't want it, and if that upsets some people too bad as I don't like to be hijacked without permission.

The Contractor

1:06 am on Sep 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yeah, I know it upsets people trying to save other peoples images through Google Image search also....that's the breaks. If you would rather see my sites framed by another site, I'd rather you left anyways ;)

NoLimits

1:11 am on Sep 27, 2005 (gmt 0)

10+ Year Member



I can see your point Bill, I don't like my content being hijacked either. When I'm looking for "images", however; I find it useful to be able to browse through the index, moving gracefully on to the next site when I've grown tired of one.

I know it doesn't matter what I want, and it probably won't/doesn't hurt your overall ad revenue much - for all I know it could increase it. I just find it to be distasteful from a user perspective. From a publisher perspective, I do not want anyone encasing my pages in a crappy looking advertising frame either - but it's something I'm willing to deal with knowing that all of my ads are being shown, and my user will have a pleasant memory of my site.... not think - oh yeah, that's the site that breaks my frames every time and skip it.

edit -

I'd love to see this same topic discussed on a forum of non-webmasters. Just to see the outcome. Perhaps I will query the users of a site that I maintain... I'm just really curious at this point. Perhaps I'm anal?! Oh well, at least now I know who's been breaking my frames :(

Jon_King

1:50 am on Sep 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>Do it using .htaccess instead of JS.

Help me out with that one Alioc.

Whoa, just tried the js with the G image search. Now thats different. What are the implications of busting G's image search other than the obvious viewing of your entire page?

The Contractor

1:43 pm on Sep 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What are the implications of busting G's image search other than the obvious viewing of your entire page?

None. Why should a SE be treated any different than any other site framing yours? I think breaking the frames of Google Images reminds the viewer that the picture/image actually belongs to someone and is the property of the site in question.

Alioc

1:47 pm on Sep 27, 2005 (gmt 0)

10+ Year Member



Hi Jon.

Add these lines to your .htaccess file: Don't forget to change example.com with your domain name and TLD.
------

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^www\.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

------
This also permenantly redirects all example.com traffic to www.example.com which is found to be useful for SE crawling and pagerank.

Have fun!

WallyWorld

2:53 pm on Sep 27, 2005 (gmt 0)

10+ Year Member



Hmmm..... The .htaccess code given on WW earlier was slightly different.

------------
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
------------

Which one is correct?

stu2005

12:05 am on Sep 28, 2005 (gmt 0)



Excuse my ignorance I'm new to all this, but does scraping and hijacking a site have any effect on the search engine ranking of the site being copied/framed?

TheDonster

8:23 am on Oct 6, 2005 (gmt 0)

10+ Year Member



A quick question regarding frame breaking code: my site is getting a lot of traffic from the search images feature of all the major engines. But my traffic logs show a huge difference between what AS records and my Urchin stats, sometimes up to 100% per day of page views. I'm guessing a big reason for this discrepancy is that the ads are not showing when framed in a search image page request. Will this frame breaking code result in displaying more ads? And is it ok with Google's TOS?

Padders

11:59 am on Oct 6, 2005 (gmt 0)



This is hardly a statistically valid experiment, but others may find it useful....

One particular page (around 1,100 page views/day) gets a disproportionately large amount of traffic from Google Images. On Monday, I tried the frame bustin' code, CTR fell to below its normal fluctuation range, eCPM more than halved. On Tuesday I took it off, and CTR returned to normal, but curiously eCPM has yet to recover.

That's one experiment I won't be trying again for a while.

The Contractor

12:16 pm on Oct 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



On Monday, I tried the frame bustin' code, CTR fell to below its normal fluctuation range, eCPM more than halved.

FB code assures they will visit your page containing the image instead of viewing the image through Google images.

I believe your answer is below:
What happened to your pageviews? I'll bet they increased - right? This is what caused your CTR and eCPM to drop.

For example: If you double the amount of pageviews, but do not keep up in terms of CTR your eCPM is going to look like it dropped. Bottom line – did your earnings drop?

jomaxx

3:27 pm on Oct 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe, or maybe people didn't like the Google Images frame being closed automatically and backed out. That traffic source is a lot different from places like About.com and AskJeeves, where people are following conventional search results that are presented in a frame.