P粉7885713162023-08-23 10:40:07
I want to say hello to you from the future :) Recent events:
So, to answer your question, you can safely change the title and other meta tags via javascript (if you want to support non-Google search engines, you can also add something like https://prerender.io stuff), just make them accessible as separate URLs (otherwise how would Google know they are different pages and show them in search results?). Changing SEO-related tags after a user clicks on something is simple:
if (document.title != newTitle) { document.title = newTitle; } $('meta[name="description"]').attr("content", newDescription);
Just make sure you don't block CSS and javascript from loading in robots.txt, and you can use the Fetch as Google service in Google Webmaster Tools.
1: http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157
P粉9596764102023-08-23 00:34:11
UPDATE: Based on comments and references on SearchEngineLand, most web crawlers will index the updated titles. The answer below is outdated, but the code still applies.