我可以强制Google+按钮使用开放图形网址吗? [英] can I force Google+ button to use open graph URL?

查看:64
本文介绍了我可以强制Google+按钮使用开放图形网址吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使Google Plus使用开放图形网址?我已经在Facebook上使用OG,所以在代码中有此内容:

Is it possible to make Google Plus use open graph URL? I already use OG for Facebook, so have this in code:

<meta property="og:url" content="http://www.sandrophoto.com/category/famous-photographers/"/>
<meta property="og:type" content="website" />

但是Google不想尊重它!有什么想法吗?

But Google doesn't want to respect it! Any thoughts?

推荐答案

Google Plus 1当前不支持og标记.+1的网址是由以下三项之一确定的:

Google Plus 1 doesn't currently support og tags. The URL that is +1'd is determined by one of three things, in this order:

  1. 按钮的href属性该属性显式定义+1目标URL.
  2. 页面的< link rel ="canonical" .../> 标记如果未提供+1按钮的href属性,则Google将使用页面的规范URL .有关定义页面规范URL的更多信息,请参见 http://www.google.com/support/webmasters/bin/answer.py?answer=139066 .
  3. document.location.href提供的URL(不推荐).如果这两个数据均不存在,则Google将使用在DOM中找到的页面URL.由于此URL可能包含会话ID,锚点或其他实际上不属于规范URL的参数,因此我们强烈建议您为+1按钮设置href属性或添加< link rel ="canonical"...> 标记到您的页面.
  1. The button's href attribute This attribute explicitly defines the +1 target URL.
  2. The page's <link rel="canonical" ... /> tag If the +1 button's href attribute is not provided, Google will use the page's canonical URL. For more information on defining the canonical URL for a page, see http://www.google.com/support/webmasters/bin/answer.py?answer=139066.
  3. The URL provided by document.location.href (not recommended) If neither of these pieces of data are present, Google will use the URL of the page as found in the DOM. Because this URL might contain session IDs, anchors, or other parameters that are not actually part of the canonical URL, we highly recommend either setting the href attribute for the +1 button or adding a <link rel="canonical" ...> tag to your page.

这篇关于我可以强制Google+按钮使用开放图形网址吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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