How does Google interpret JS redirects?
πŸ‘‰πŸ» It indexes the start page
πŸ‘‰πŸ» It doesn't index the destination page
πŸ‘‰πŸ» It sees redirect as a DOM update and uses the content of the destination page

#seo #googlebot

Hello, this is Adriano Cuzmalorgicon

Welcome to my personal page

@merlinox
That is quite bizarre behaviour- good test!

@simoncox thanks. I must to did it because we have a customer with an horrible configuration, due its agency ;(

JS is totally DOM-related

@merlinox Interesting.

I wonder if Googlebot would behave differently if the original/start page was not blank?

I still think Googlebot crawls a lot *without* javascript (like a 'forward scout bot') so if the page the scout found wasn't empty - would it behave differently? πŸ€”

@optimisey @merlinox my experience is that they are treated much like 302 redirect, so rather than seeing as a DOM update, it's more a case of the first url being treated as the canonical of the second's content for a while. This normally changes given time.

@dwsmart @optimisey When 302 was treated by Google as 302 the destination content was temporarily ignored. In that case, the destination content is the only content Google considers.

ps: now Google treats 302 as 301!

@merlinox @optimisey

There's still a difference between 302 and 301, (see: https://developers.google.com/search/docs/crawling-indexing/http-network-errors) and canonicalisation still applies, so it can go both ways. 302 hijacking was a thing for a reason until they tightened this up, mainly now same origin stuff.

302 eventually becomes 301, once they decide that's what you mean, and from a very practical level, you are right, long term they do.

HTTP Status Codes, Network and DNS Errors, and Google Search | Google Search Central  |  Documentation  |  Google for Developers

See how different HTTP status codes, and network and DNS errors can affect Google Search. Learn how to debug network and DNS errors.

Google for Developers

@dwsmart @optimisey about that topic there are a lot of tweets:
https://twitter.com/search?q=from%3Ajohnmu%20302&src=typed_query&f=live

The summary is that a 302 will become a 301 in an unknown x time!

@simoncox @optimisey sure! And I will be glad to read your results.

@merlinox @optimisey

🀣

yeah, ok.

@merlinox @optimisey

I'm building a test now anyway. :)

Javascripting a redirect

This is a javascripted redirecting page to see what happens when it is indexed.

Simon Cox
@simoncox @optimisey have the pages the same content?
@merlinox @optimisey
No slightly different so I can tell what gets indexed. Have put the first url in GSC.

@merlinox @optimisey

Page 1 indexed with content and is findable with "Javascripted redirected page" as a query.

Page 2 not crawled and indexed yet.

#seo

@merlinox @optimisey
More info...

Title of page 1 is: "Javascripting a redirect"
and description: "This is a javascripted redirecting page to see what happens when it is indexed."

The title of page 2 is: "Javascripted a redirect"
and description: "This is a javascripted and redirected page to see what happens when it is indexed."

And we can see the SERP is showing the 1st page URL, The title and description from the 2nd page - even though it is not indexed.

@merlinox @optimisey

My conclusion so far is that if I come across this with any clients it might be good practice to change the redirect page's title and description to match the landing page.

@simoncox @merlinox Love this stuff from both you fellas. Proper on the spot testing! πŸ‘

So, Google takes a bit of a mishmash of both pages? Weird. Almost buggy? Why would doing that make sense?

Should we invoke the Google JS Elf King, Martin S? See what he thinks?

@optimisey @merlinox
Not yet there is more testing to be done!

Kind of does make sense though if you think about what Google crawls, how and when.

@optimisey @simoncox as other still wrote, that behaviour is strictly similar to the 302 (before the unknown time Google treats it as a 301) ;)
@simoncox @optimisey like my test :)
@merlinox @optimisey exactly! Not seeing anything different to your test so far!
@[email protected]
This behavior appeared not too long ago in google. In order to not index page 1 you must send the x-robots header with the value noindex, follow.
@optimisey both pages are generated by JS. Sure in the first wave, Google sees blank pages but it happens in almost all the JS websites without a rendering server.
@optimisey @merlinox a good case study is when all the old webmaster central blogs moved from https://webmasters.googleblog.com/ to https://developers.google.com/search/blog/ and had to be done via javascript redirect, which was mostly successful apparently, covered in their podcast here: https://www.youtube.com/watch?v=SOyeNx80fKY
Official Google Webmaster Central Blog

Official news on crawling and indexing sites for the Google index

Official Google Webmaster Central Blog