Facebook 图 API 能否区分 website.com/?source=text 与 website.com/#fragment 的分享数?

Can the Facebook graph API distinguish between share counts of website.com/?source=text vs. website.com/#fragment?

例如,我想区分类似

的股票

http://google.com 对比 http://google.com/#fragment 对比 http://google.com/?source=keyword

https://api.facebook.com/method/links.getStats?urls=http://google.com/#gizmodo&format=json or https://api.facebook.com/method/links.getStats?urls=http://google.com/?source=gizmodo&format=json versus shares of a straight-up https://api.facebook.com/method/links.getStats?urls=http://google.com/&format=json

是的,您可以 - 假设您谈论的不是 www.google.com,而是您控制的网站。此外,假设通过更改作为 url 一部分的查询字符串,实际上会更改用户看到的页面。

您这样做的方法是根据 url 的内容更改 HTML 中呈现的元标记。因此,如果用户使用 url 访问页面:

http://www.myUrl.com

然后元标记可以像

<meta property="og:title" content="Workday Sets Price Range for I.P.O." />
<meta property="og:url" content="www.myUrl.com" />
// there are more then just these look up Facebook Docs

然后当用户去:

http://www.myUrl.com?q=blah&a=blah

你会从你的服务器呈现不同的元标签,Facebook 会读取这些并知道它们应该是不同的页面

<meta property="og:title" content="DIffernt title here" />
<meta property="og:url" content="www.myUrl.com/blahhblooblah" />
// there are more then just these look up Facebook Docs

完成后,您应该使用所有这些元标记

  • og:标题
  • og:site_name
  • og:url
  • og:描述
  • og:图片
  • fb:app_id