Hi All, Working on a new site where a requirement is that we use a javascript method for outbound links on our "resources" page, so as to track how many visitors go where, etc. That's a given, can't change this. Anyhow, I plan to do a small, solid reciprocal link building campaign done tastefully as a small part of a much larger overall internet marketing strategy. I'm concerned, however, that being as we use JS links others might not want to swap links for fear it will not benefit them with PR or "link credit" in Google and to some extent other SE's. Anyhow, we're experimenting with trading in the JS for another type of redirect that will enable us to track. Can anyone tell if the following method of linking will: 1) Pass PR to the external site? 2) Give the external site some small bit of link credit in their SEO campaign? <A href="/folder/redirectURL?URL=http%3A%2F%2Fwww.outsidewebsite.com%2F">Visit Outside Website</a> This enables us to track w/o our JS method. Or for that matter, will the following JS method satisfy our situation? <A href="javascript:redirectURL( 'http://www.outsidewebsite/' )">Visit Outside Website</a> <script name="JavaScript"> var partnerPath = ''; function redirectURL( url ) { var redirectURL = "/folder/redirectURL?URL=" + escape( url ) ; location.href = redirectURL; } </script> Thoughts?
I've seen sites track clicks with a standard A href and an onClick event, but i cant remember which one unfortunately...
The answer isn't absolutely clear for Google, but the other search engines will not see the links. Google can detect complete URLs embedded in JavaScript, but the weight or PagaRank that it allows those "links" to pass is not clear. So, for Google its a grey area. But its also true that many of your potential link partners will not agree to an exchange if you use that code. Because of that, and for other useability issues, you should change your code to read something like: <a href="http://www.othersite.com" onclick="document.location="/your-counter-script.cgi?site=www.othersite.com"> so that (a) all search engines will see a normal link to your link partners and (b) users running with JavaScript disabled will still have access to the link. Good luck! Richard L. Trethewey
I am no expert, but can't you do <script> <A href="javascript:redirectURL( 'http://www.outsidewebsite/' )">Visit Outside Website</a> </script> <noscript> <A href="http://www.outsidewebsite/">Visit Outside Website</a> </noscript> Or something similar? One advantage is that your site is not broken for people without javascript.
Great ideas, although I'm afraid to go the <no script> route with links and link text for fear that there's a chance it may be taken as spam/black hat. Even if its a small chance, in this case I'm not willing to take it. I like the "onclick" idea. I don't see how that wouldn't fit the need, but have sent it over to my more technilogically-savvy associate to review Update: I think we're going to give that onclick method the go. Seems simple enough. Thanks!