Googlebot与"Google Plus +1共享按钮bot"? [英] Googlebot vs "Google Plus +1 Share Button bot"?

查看:73
本文介绍了Googlebot与"Google Plus +1共享按钮bot"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个完整的客户端一页Web应用程序,该应用程序在客户端动态更新和路由.我重定向任何#!向无头服务器发送请求,该服务器使用已执行的javascript呈现请求,并将最终的html返回给bot.该网站的标题还包含:

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="!">

在Google工作时获取

使用以Google身份提取"网站站长工具,在提取状态"页面中,我可以看到用于更新og:title,og:image和og:description的jQuery已执行,并且替换了默认值.一切看起来都很不错,如果我将鼠标悬停在URL上,则屏幕截图是正确的.

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.

但是,使用Google Plus按钮,无论og:title,og:image和og:description标记的值更新为什么,共享弹出窗口始终使用默认值/初始值.

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.

每次网站内容更新,重新路由和og元内容更新后,我都称呼它.

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

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

我当时假设,如果这种方法适用于Googlebot,那么它也应适用于+1按钮. Googlebot和+1用于检索网站元数据的内容之间有区别吗?

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');

推荐答案

Google搜寻器在呈现+1按钮时不会呈现该代码段,而是在用户单击+1按钮(或共享按钮)时呈现该代码段.您应该尝试确定在此用户发起的搜索以及Google搜寻器异步加载期间服务器要发送给Googlebot的内容.

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.

您可以使用以下 cURL 命令来模拟此情况:

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

您可以通过在命令中添加-o testoutput.html将该命令输出到文件.

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

这将使您大致了解Google搜寻器在遇到您的页面时看到的内容. 结构化数据测试工具也可以为您提供提示.

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.

如果您可以提供真实的URL进行测试,那么我可能会提供更具体的反馈.

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

这篇关于Googlebot与"Google Plus +1共享按钮bot"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆