Does Googlebot trace route-href? (SEO tips)

I’d like to ask about client side rendering.

Googlebot follows static <a href but not <a route-href, right? <a href.bind is also NG?

Google can follow links only if they are an tag with an href attribute.

When Googlebot looks for links in your pages, it only considers URLs in the href attribute of HTML links.

(As I misunderstood route-href, I rewrote all.)

Googlebot requires href="link" on the <a element to follow the link. We can use either route-href or href for Googlebot, because route-href adds an href attribute.

Both a relative link (URL) and an absolute URL are good for SEO according to a Google person.

Even if the <a element has click.delegate=“func()” and the func() calls router.navigate() or router.navigateToRoute() for routing, the element should have href or route-href for Googlebot.

I think use of href and pushState is the easiest SEO.

For somebody who needs SEO without server side rendering or Rendertron, here are some tips. Please add if you know more.

  1. Read this and this to know Google’s policy on Javascript execution.
  2. To use pushState, provide your main bundle as the 404 page. And have config.options.pushState = true; in configureRouter(). If your base URL is not ‘/’, set it to config.options.root and also specify it to baseUrl on webpack.config.js so that index.ejs has a proper base tag.
  3. Provide href for Googlebot with <a route-href="route: viewName; params.bind=params or <a href="${router.generate(viewName, params}"
  4. Use navigator.webdriver to know your code runs on a browser or a bot. You can skip an opening dialog with it.
  5. To test how Google renders a URL, use Mobile friendly test. You can see a screenshot.
4 Likes