Google Found My Javascript Redirect

I put a javascript redirect into an external javascript file to redirect traffic from one mostly undeveloped site that was getting some traffic to another site. Google found the redirect.

Many people have wondered whether or not Googlebot looks at javascript files. The answer, obviously, is yes. The only way Google could have found it is if their bot crawled the external JS file.

I was hoping to hide the redirect from Google. It did not work. Just thought you people might like to know.

By the way, I tried searching to see if anyone else has said anything about this but Sitepoint’s search functionality is not working at the moment.

I agree , google’s crawler skips javasript codes on the web page…

um, no it doesn’t. Please read the link in my last post.

i did not think crawler can execute js files. (after read last reply, i change this!)

“corelation does not mean reason”. Can you test more on this, another 20 or more siteA and siteB?

Does this really brings penalty!

A little clarification: Google did not find a link to, it found a link to The site I am redirecting from has no links to the site I am redirecting to and never has except in the javascript redirect in the external JS file. Since there are no links to the redirected to site, the only place Google could have found the link to the site is in the redirected from site’s external javascript file. There is no other place Google could have found the link.

Yes, upon further inspection, that is exactly what happened. I used an external javascript redirect on Site1 to redirect traffic to Site2. External javascript–if Google doesn’t read javascript, it should never see the redirect, right? Wrong. Google does read javascript. It has to because of the roughly 2300 pages on Site1, I now have about 1850 incoming links from Site1 to Site2 showing in Site2’s Google Webmaster Tools.

In Google Webmaster Tools, in the “Links to your site” section, I am seeing approximately 1850 links from Site1 to Site2. There are no links to Site2 on Site1 and never have been. There are no links at all to Site2 in Site1’s HTML. Therefore, the only way Google could have discovered a link is if it concocted one after following the javascript redirect on Site1.

I know you people have been saying for years that Google does not crawl javascript. Maybe Google didn’t in the past, but they certainly do now and I have proof of it. I got 1850 incoming links from Site1 to Site2 and the only reference to Site2 is in the external javascript file on Site1.

Now that Google admitted to crawling JavaScript and forms

According to this link below from 2006, if Google finds a “clean” javascript URL it will crawl it. And apparently, it is following links in external javascript files, too. Because it did with me. I read on Sitepoint many times over the years that Google doesn’t crawl javascript. Maybe you people already knew that it did, but this is news to me. Had I known, I would never have tried the javascript redirect.

How do you know that no one has added a link to your site to a page on theirs?

It looks like both. Obviously, Google had to find it because it references the URL of the redirect in Webmaster Tools. The redirect URL is with the code being something I selected so I could see in my logs that the visitor came from the redirected site. The only place that code exists is in the external javascript file with the redirect.

Even worse, I think the site has been penalized as a result. The redirect was put into place one month ago today. My traffic from Google is down 50%. That could be a seasonal variation or could be a penalty.

I get the feeling it may be a penalty because my index page does not rank when I search for my domain name. If I type in “” into Google, it returns my Myspace profile for promoting the site, Myspace pages where I have made comments, other web pages that have mentioned my domain name, and just a few secondary pages from my site–but not the main page.

It has been a recent development (well, recent being over 12 months ago). I has been pretty well covered in the blogs and even confirmed by Google officially and unofficially…sorry that it came as a shock to you.

What do you mean CD? Do you mean Google merely accessed the external JS file? Or that Google actually got redirected via the JS in that file to the destination URL?

That isn’t what I am talking about. I redirected traffic from Site1 to Site2 using a Javascript redirect. There is no link to Site2 on Site1 and never has been. However, in Google Webmaster tools in the incoming links section for Site2, Google shows an incoming link from Site1 even though there are none anywhere on the site except for in the external JS file. The incoming link did not show before I started doing the redirect.

Therefore, the only conclusion I can come to is that Google read the external javascript file in Site1, saw the redirect to Site2, then counted that as a link. I can think of no other explanation.

Also, I find it highly coincidental that my traffic from Google to two sites dropped dramatically after I included an onclick pop-under advertisement in an external javascript file. It could be a coincidence. There is nothing I can prove.

I also find it highly coincidental that right after Google dropped its traffic to Site2 in July I got a message offering $100 in free Adwords advertising if I sign up. Tank traffic, get people to pay you for traffic at $0.10 per click. If that isn’t a conspiracy, I don’t know what is.