sam*_*and 11 query-string open-graph-protocol google-plus facebook-opengraph
当标准网址共享时,Google Plus非常擅长提取Open Graph元标记指定的图片,如:
http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048
看到:

但是,当您开始附加查询字符串时,事情开始变得棘手,例如在此URL中完成:
http://stackoverflow.com/questions/22342854/what-is-the-optimal-algorithm-for-the-game-2048?utm_source=google-plus&utm_medium=social&utm_campaign=stackoverflow-general-promotion

对于某些URL +查询字符串,默认图像似乎完全没有意义:
http://skeptics.stackexchange.com/questions/4508/can-every-grain-of-sand-be-addressed-in-ipv6?xyz_12312313

上面的screengrab中的图像是最后留下对共享问题的答案的人的用户pic.
是否有任何方法可以强制Google Plus退回由og:image标签定义的图像,即使附加了查询字符串?
不,没有办法与Google+相悖.
Facebook刮刀可以实现这种行为,因为它支持检查og:url哪些Google+不支持(为什么???).这些是Google+支持的项目
<meta property="og:title" content="..." />
<meta property="og:image" content="..." />
<meta property="og:description" content="..." />
Run Code Online (Sandbox Code Playgroud)
通常在添加查询参数时og:url定义
他们推荐的格式是Schema,如https://developers.google.com/+/web/snippet/所述
Google+检查的顺序
看到您链接的页面上定义了多个架构,根据https://developers.google.com/+/web/snippet/文档,它应该从最近定义的itemscope中获取信息
<body class="question-page new-topbar" itemscope itemtype="http://schema.org/QAPage">
所以,这会让我们回到你的第二张图片

标题也不同,所以og:title也没有被检测到.<title>正在被刮掉
这是什么意思呢?
谷歌加上糟糕的标记分享.
您需要调整最顶级的Schema.org微数据,并希望Google+在向规范网址添加参数时理解它.
<body itemscope itemtype="http://schema.org/QAPage">
<h1 itemprop="name">Shiny Trinket</h1>
<img itemprop="image" src="{image-url}" />
<p itemprop="description">Shiny trinkets are shiny.</p>
</body>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5871 次 |
| 最近记录: |