3

Well when I search our website through Google site:allsports.app. I notice first that it correctly limited itself to what is (was) defined in the sitemap. I also notice that for most pages it does not render the JavaScript in the preview, whether SEO is important enough (right now) to warrant server-side rendering is still something we have to internally discuss. Most of our traffic comes far and wide through word of mouth and other channels anyways.

However one other thing confused me: the preview for our main page is just the cookie banner. This means that Google is actually rendering the JavaScript, but it picks the most illogical preview to put on there.

I've found no sources anywhere indicating how I can influence the preview through robots.txt or sitemaps... So how can I make it not use the banner but instead a custom message (like what is on the about page). The main site is just a search bar for other resources, so not much text on it anyways.

1
  • Here's an article on how to use the robots meta tag and the data-nosnippet="data-nosnippet" attribute to limit search result snippets. Commented Nov 11 at 6:42

2 Answers 2

3

When you say "preview" I think you are talking about the sentence of text under the link in the search results that is typically called the "snippet." Google has some documentation for that: How snippets are created

When I do your search on Google, I see your pages have snippets like "You need to enable JavaScript to view this website. AllSports." There are two problems with your site:

  1. Your meta description isn't a sentence that is unique to each page. When the meta description is a sentence and it contains some of the query, Google is more likely to use it as the snippet. Instead your meta description is <meta name="Description" content="Sports platform, event calendar, enroll">. Because it isn't a sentence and because it is the same on every page of your site, Google is going to ignore it.

  2. Your site is all JavaScript. While Google can now render and index JavaScript powered sites, it still isn't a good idea to load your site with JavaScript if you want good SEO. Google may eventually be able to pull actual sentences from your pages to use in the snippet but Googlebot needs to render your pages first. That is a process that seems to take months longer than when your content is embedded in the HTML.

6
  • 1
    Many are using systems such as React to build sites these days... and those are 100% JavaScript. Commented Aug 25, 2021 at 1:07
  • 5
    Despite Google's best efforts to render JavaScript and support those frameworks, they are still problematic for SEO. Rendering and indexing the content takes a LONG time and there are a ton of gotchas about what Googlebot actually renders. Other search engines can't crawl JS powered sites at all. I wouldn't recommend using those technologies with a site that requires SEO unless you are using pre-rendering to convert the site to plain HTML. Commented Aug 25, 2021 at 1:11
  • 1
    There are ways around this. You can inject content into the <meta> tags with javascript and, if it happens fast enough (figures like <200ms or 150ms are what I remember seeing online), Google will read it and take it into account. This allows you to have good SEO with single page applications even without server-side rendering.
    – theberzi
    Commented Aug 25, 2021 at 11:32
  • 1
    One way around the cookie banner snatching the "first content", that I have seen used (or maybe they were just slow websites) is to delay the appearance of the cookie banner by some 250ms or more, to ensure that whatever Google renders while constructing the snippet is not the cookie banner. This might raise other issues, though (would it count towards cumulative layout shift?). It might also help to move the cookie banner's code toward the bottom of the markup--it's meant to be an overlay anyway, it doesn't need to be up top.
    – theberzi
    Commented Aug 25, 2021 at 11:35
  • 1
    Our site is indeed build on react, and as said the value of SSR is something we need to evaluate at a higher level than just a topic here. There is a real -repeated- cost to maintaining that, unlike something like a sitemap generator which tends to keep working SSR adds complexity that needs to be considered in all future updates. And we need to evaluate if being able to be better found on google is worth that cost. We've so far done fine just by "word of mouth", and with corona it all became even more complex for us. As for changing the meta tags, that is due to react not touching those...
    – paul23
    Commented Aug 25, 2021 at 13:16
3

The simple answer is "it's complicated".

Google is not influenced by tags in the header because they've discovered (a long time ago) that many really put whatever in there. So it's not totally ignored, but it's strongly verified. If it detects that the meta data looks like stuffing, you're penalized¹ (mostly likely, that page won't appear in search results).

In general, the engine will trigger a result that corresponds to your site possibly only including a section of a certain page and they will show that section's text. Again, you can't really influence them on that part.

One possible solution to at least avoid the cookie popup would be to detect that's a Google robot and avoid loading that code when it's Google. However, Google often frowns upon users who do such things. In this situation, though, it's probably okay. I don't really see why Google would think you were trying to mislead their users (which is the main point).

2
  • 2
    "Google is not influenced by tags in the header" - Google certainly uses the title and meta description "tags", and these are in the "header"?
    – MrWhite
    Commented Aug 25, 2021 at 9:40
  • 1
    @MrWhite I see that Google changed their mind again... for a while they didn't want to use anything the user couldn't see (so I total agree the title has always been used). I made an update and added a link to a Google page which gives that information. Commented Aug 25, 2021 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.