html+js links come - advanced seo question

6 replies
  • SEO
  • |
hi guys,

the following questions regards a <a href> + javascript on click combined in a link.

look at the following code:
<a href="domain.com" onclick="javascript:window.open('domain.com/affiliate-link.html');return false;"><img src="image.jpg" alt="image alt" border=0></a>

elements we have:
1. A href link - to domain.com
2. onclick JS event who links to domain.com/affiliate-link.html
3. img src , inside the A HREF, with an alt tag.

my question for you guys are:
1. which link will be counted to site domain.con - will it be the A HREF or the Javascript one? (the a href is a clean hardlink, the JS is a long affiliation link).
2. can the alt tag be counted as an anchor text for this link?
3. can this be called a "sneaky javascript redirect" ? can this be picked up by SE as cloaking?

sorry to say, but i have not live example to show you guys, but based on your understanding, what do you think happens here?

thanks
#advanced #html #links #question #seo
  • Profile picture of the author orvn
    Originally Posted by datentravel View Post

    PHP Code:
    <a href="domain.com" onclick="javascript:window.open('domain.com/affiliate-link.html');return false;"><img src="image.jpg" alt="image alt" border=0></a
    ....
    my question for you guys are:
    1. which link will be counted to site domain.con - will it be the A HREF or the Javascript one? (the a href is a clean hardlink, the JS is a long affiliation link).
    2. can the alt tag be counted as an anchor text for this link?
    3. can this be called a "sneaky javascript redirect" ? can this be picked up by SE as cloaking?
    To my best knowledge:
    1) The JavaScript link will not be counted by most search engines. Naturally, in your example, the crawler will scan through the html-href link.
    2) Yes- the alt attribute for the image will be considered as anchor text.
    3) No, the Googlebot just ignores the JS entirely. You're not going to get penalized for cloaking, this is done in ad campaigns all the time- visit any porn site.

    There's been some debate about this issue on the internet: which bots crawl javascript and which don't. I made it a point to research it a while ago.

    Turns out, the vast majority of crawlers ignore links embedded directly into Javascript, like the one you demonstrated. They simply do not follow them.

    It seems Google does this too. You see evidence for it when you visit a cached version of a page with Javascript embedded links: they're often not there or replaced with link (or alt, in the case of images) text.
    Signature
    Orun Bhuiyan[@orvn] [linkedin] See what I've been doing lately by visiting my marketing agency's site. SEOcial specializes in content marketing and integrated optimization. We create conversions for businesses by gracefully connecting the realms of design, development and marketing.

    {{ DiscussionBoard.errors[2842953].message }}
  • Profile picture of the author orvn
    Originally Posted by kingofseo View Post

    js links never work they are bad just like flash links and asp link. Always use html links.
    Well actually- in his case- they're good.
    His cloaking with the javascript.onclick popup will override the html link, but the crawler will count the href link.

    So he's cloaking the link to mask his affiliate motive.

    http://www.google.com/support/webmas...n&answer=66355
    Originally Posted by Google

    Sneaky JavaScript redirects
    When Googlebot indexes a page containing JavaScript, it will index that page but it cannot follow or index any links hidden in the JavaScript itself. Use of JavaScript is an entirely legitimate web practice. However, use of JavaScript with the intent to deceive search engines is not. For instance, placing different text in JavaScript than in a noscript tag violates our Webmaster Guidelines because it displays different content for users (who see the JavaScript-based text) than for search engines (which see the noscript-based text). Along those lines, it violates the Webmaster Guidelines to embed a link in JavaScript that redirects the user to a different page with the intent to show the user a different page than the search engine sees. When a redirect link is embedded in JavaScript, the search engine indexes the original page rather than following the link, whereas users are taken to the redirect target. Like cloaking, this practice is deceptive because it displays different content to users and to Googlebot, and can take a visitor somewhere other than where they intended to go.

    Note that placement of links within JavaScript is alone not deceptive. When examining JavaScript on your site to ensure your site adheres to our guidelines, consider the intent.

    Keep in mind that since search engines generally can't access the contents of JavaScript, legitimate links within JavaScript will likely be inaccessible to them (as well as to visitors without Javascript-enabled browsers). You might instead keep links outside of JavaScript or replicate them in a noscript tag.
    Signature
    Orun Bhuiyan[@orvn] [linkedin] See what I've been doing lately by visiting my marketing agency's site. SEOcial specializes in content marketing and integrated optimization. We create conversions for businesses by gracefully connecting the realms of design, development and marketing.

    {{ DiscussionBoard.errors[2843115].message }}
    • Profile picture of the author datentravel
      thanks ORVN. well those were my thoughts too. but if we make this case a little more complex and on the A HREF link you link to an authority site like yahoo, and the javascript will link to an affiliate site, can't this misleading of user be flagged as cloaking by the big bad bots?
      {{ DiscussionBoard.errors[2843139].message }}
      • Profile picture of the author orvn
        Originally Posted by datentravel View Post

        thanks ORVN. well those were my thoughts too. but if we make this case a little more complex and on the A HREF link you link to an authority site like yahoo, and the javascript will link to an affiliate site, can't this misleading of user be flagged as cloaking by the big bad bots?
        I was going to answer this question with a 'no', but then I did some Googling.
        It seems Google made some policy changes.

        The way I underSTOOD it:
        Bots are busy entities.
        They don't like to waste their time on javascript.
        What happens if a javascript enabled bot hits an unresponsive script?
        They'll wait for a timeout.
        This can be extremely detrimental to efficiency, so the bots just surf with javascript turned off.

        Now apparently, Google is smarter than that now (this must have been a recent change).

        Check this out:
        SEOmoz | YOUmoz - New Reality: Google Follows Links in JavaScript.

        More investigation leads:
        Most don't handle JavaScript at all. They ignore all JavaScript. It's best to have a sitemap that navigates around.

        Some, (like Google's) are a little bit smarter. They're not going to run your javascript, but they will look at it, and might make some decisions based on that. They might hit your AJAX server or something.
        how do web crawlers handle javascript - Stack Overflow
        This is news to me. No clue when Google could have done this.
        This means that a simple affiliate cloak shouldn't be a problem (same domain, often just a &php=paramenter), but a full on misdirection will be considered akin to a doorway passage, and Google WILL penalize you for that.
        Signature
        Orun Bhuiyan[@orvn] [linkedin] See what I've been doing lately by visiting my marketing agency's site. SEOcial specializes in content marketing and integrated optimization. We create conversions for businesses by gracefully connecting the realms of design, development and marketing.

        {{ DiscussionBoard.errors[2843284].message }}
        • Profile picture of the author datentravel
          I've that post on SEOMOZ. What I understand from it what we agreed earlier - that googlebot does crawl the JS link. The post is from 2008, if I remember correctly, google had improved their ability to crawl JS and flash from 2008.

          the issue here, is that we have 2 links under the same spot, HTML and JS.

          but yes, its a fact that the JS link is crawled and followed, and having two different links on HTML and JS creates "an issue", i'm still not sure i'd call it a type of cloaking, since the urls are both still visible to SE.
          {{ DiscussionBoard.errors[2846925].message }}
  • Profile picture of the author bgmacaw
    My observation is that Google will, in some cases, follow Javascript links when the link in question is (a) not a complex script; and (b) is within a hyperlink <a></a> block. It does not seem to follow links outside of <a> tags, such as using a onclick script in a <div>. AJAX and Flash based links also don't appear to be followed from what I've seen.
    {{ DiscussionBoard.errors[2849059].message }}

Trending Topics