AddThis 拉错段落

Posted

技术标签:

【中文标题】AddThis 拉错段落【英文标题】:AddThis pulling wrong Paragraph 【发布时间】:2011-10-25 07:23:40 【问题描述】:

我使用AddThis 分享我的博文。当我尝试分享我最近的帖子时,它会在 Facebook 上拉出并显示错误的段落。我不确定如何让它拉出正确的段落。这是我的 AddThis 代码:

<div class="social"><!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook"></a>
<a class="addthis_button_twitter"></a>
<a class="addthis_button_email"></a>
<span class="addthis_separator">|</span>
<a class="addthis_button_compact" href="http://www.addthis.com/bookmark.php?
v=250&amp;pubid=ra-">Share</a>
</div>
<script type="text/javascript">var addthis_config = "data_track_clickback":
true;    
</script>
<script type="text/javascript" src="http://s7.addthis.com/js/250
/addthis_widget.js#pubid=ra-"></script>
<!-- AddThis Button END --></div>

【问题讨论】:

【参考方案1】:

要解决此问题,您必须使用 OG 标签来告诉 Facebook 使用什么。这是一个解决我的问题的示例:

<meta content="Title of Page" property="og:title" />
<meta content="Blog Post" property="og:type" />
<meta content="Page URL" property="og:url" />
<meta content="Image to represent blog post." property="og:image" />
<meta content="Site Name" property="og:site_name" />
<meta content="Description of Page or Paragraph to display" 
               property="og:description" />

更多信息请访问Facebook 和Open Graph Homepage

【讨论】:

【参考方案2】:

什么对我有用

如果您碰巧尝试将 AddThis 与 UTM 代码或其他查询字符串变量一起使用,那么这就是最终对我有用的方法。

根据Sol,使用OpenGraph meta tags,但随后使用FB Debugger 验证Facebook 缓存是否已刷新并正确获取页面标题中的所有正确元标记,然后验证没有查询字符串UTM/将您的 AddThis 共享链接更改为 facebook。出于我的目的,Index.html 不能包含任何查询字符串变量或 AddThis 将 URL 错误地传递给 Facebook。对我有用的唯一方法是这样的:

<a href="http://api.addthis.com/oexchange/0.8/forward/facebook/offer?pco=tbx32nj-1.0&amp;url=https%3A%2F%2Fwww.example.com%2Findex.html" target="_blank" ><img src="http://cache.addthiscdn.com/icons/v1/thumbs/32x32/facebook.png" border="0"  /></a>

我失败的原因

当尝试使用以下 AddThis“data_track_addressbar”和“addthis_widget.js”模块进行分享时,Facebook 完全无法拉取新的 OpenGraph 元标记。

<script type="text/javascript">var addthis_config = "data_track_addressbar":false;</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js"></script>

【讨论】:

以上是关于AddThis 拉错段落的主要内容,如果未能解决你的问题,请参考以下文章

使用适用于 iOS 的 AddThis SDK,需要更改默认 Twitter 文本的“通过 @AddThis”

AddThis按钮CSS问题

AddThis 和 Google Page Speed

如何将“addThis”社交集成添加到灯箱(jquery prettyphoto 或 jquery fancybox)中?

php 使用AddThis共享按钮

markdown 添加社交分享 - AddThis社交分享按钮