3

I have a page which uses react, and from what I understood docs, Google bot, before indexing, is executing JS (see here: JavaScript SEO Basics). First thing which I want to ask, is if my thinking is correct.

Also, I want to add that I haven't added any code to tell Google bot to run JS. If there is anything which I need to add to run the JS, please guide me a bit what it would be.

If this is truth, then Google would index my page correctly, as react would be fired, and react would render content based on data attributes which are in page source. Not sure if this is important, but I don't fetch any data, required by react to render the app, all data are already in data attributes in the markup, but final markup is empty, something like this:

<div data-params="{'article':'super important content.'}"> 
    // content goes here, rendered by react
</div

If that is not the case, and google bot wouldn't execute JS during indexing process, it would mean that Google will not index my page correctly, as it won't have any content (and I would need to use Server Side Rendering).

Also, I want to ask if there is any way to check, for non public pages (lets say on integration environment which is available only from internal network) how google would index my page. I know that it can be check for public pages through Google Search Console (if I'm not mistaken), but this doesn't work for environments which are not available publicly.

Can you help me with that ?

4

1 Answer 1

2

Since as early as ~2015, Google has been consistently fully rendering pages, seeing the full DOM and not just the source code.

As far as I know Google will just render your JS, you don't need to tell it to.

The easiest way to test this as Googlebot (without a paid tool) on a non-public page is probably Google's Mobile-Friendly Test. You can see the rendered HTML, and even a screenshot. I ran it on my site not logged in, so you shouldn't need to have a GSC property registered to use it.

enter image description here

There are a number of crawlers on GitHub

I like pyspider

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.