Google Explains Links and JavaScript

Google has released the first series of “Lightning Talk” for webmasters. In it, search specialist Martin Splitt told how Googlebot uses links to detect pages on the Internet, and how to use JavaScript with links without unnecessary problems.

We suggest looking at Martin’s explanation. Russian subtitles are available for the video. Below you will find a brief transcript.

At the beginning of his presentation, Splitt noted that links are essential not only for users but also for bots and search engines. By clicking on the links, the search robot gets an idea of the structure of the site. And its information architecture. As a result, the search engine understands which pages are most relevant to a given topic.

Then Splitt goes to the question of how to make a link. There are several ways to do this. The easiest way is to use a time-tested < a > tag from the URL of the page it points to in the href attribute. You can add some JavaScrip to the link.

Split notes that you should not create a link without the href attribute. The link will only work if JavaScript is functioning correctly and search robots will not be able to determine where the link leads. Such a link becomes unreliable.

Adding href attribute without a suitable URL or with pseudo-URL will not work because the result will be the same as for a link without href attribute. You should not use buttons to create a link, either. If the action takes place on one page, a button is most likely needed. But if the user goes to another page – you need a link.

The split does not advise to simulate links using other HTML elements, and then add a click handler in JavaScript. It violates the access functions. You need to use semantic HTML markup and direct the link to the correct URL.

Martin Splitt then told us what Google believes the correct URL is:

  • the protocol is the “language” to access the URL, such as HTTP or HTTPS;
  • the other part is the domain name;
  • the last part is the path to certain content on your computer.

The URL may also contain an element, such as a fragment identifier, which points to a specific part of the document. Split pays attention that because fragments do not point to other content, search robots ignore them. It means that if you create a one-page application with a URL that looks like example.com/#products or example.com/#/products, search robots will not follow these links.

Recall that Google has announced the launch of the Lighting Talks series in mid-April. As part of the series, well-known employees of Google team will present brief informative reports in the style of Google Webmaster Conference.

Leave a Reply