Googlebot vs “Google Plus +1 Share Button bot”?

女生的网名这么多〃 提交于 2020-01-06 15:30:47

问题


Site Setup

I have a fully client-side one page webapp that is dynamically updated and routed on the client side. I redirect any #! requests to a headless server that renders the request with javascript executed and returns the final html to the bot. The head of the site also contains:

<meta name="fragment" content="!">

Fetch as Google works

Using the Fetch as Google webmaster tool, in the Fetch Status page, I can see that the jQuery I used to update the og:title, og:image, and og:description was executed and the default values replaced. Everything looks good, and if I mouseover the URL, the screenshot is correct.

However, with the Google Plus button, no matter what values og:title, og:image, and og:description tags are updated to, the share pop-up always uses the default/initial values.

Attempted use

I call this after each time the site content is updated, rerouted, and og meta content updated.

gapi.plusone.render("plusone-div");

I was assuming that if this approach works for the Googlebot, it should also work for the +1 button. Is there a difference between the Googlebot and whatever is used by +1 to retrieve the site metadata?

edit: Passing a url containing the #! results in a 'site not found'

gapi.plusone.render("plusone-div", {"href" : 'http://www.site.com/#!city/Paris');

回答1:


The Google crawler does not render the snippet when the +1 button is rendered but rather when a user clicks the +1 button (or share button). What you should try is to determine what your server is sending to the Googlebot during this user initiated and asynchronous load by the Google crawler.

You can emulate this by using the following cURL command:

curl -A "Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0 Google (+https://developers.google.com/+/web/snippet/)" http://myurl.com/path/to/page

You can output that command to a file by adding -o testoutput.html to the command.

This will give you an idea of what the Google crawler sees when it encounters your page. The structured data testing tool can also give you hints.

What you'll likely see is that unless your doing your snippet preparation in a static file or on the server side is that you're likely not going to get the snippet that you desire.

If you can provide real URLs to test, I can probably provide more specific feedback.




回答2:


Google+ fetch the pages using the _escaped_fragment_ query parameter but without the equal sign.

So, it would fetch http://www.site.com/?_escaped_fragment and NOT https://www.site.com?_escaped_fragment_=

Google Search crawler still using the fragment with the equal sign, this is just for Google plus crawler.



来源:https://stackoverflow.com/questions/19418055/googlebot-vs-google-plus-1-share-button-bot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!