AddThis 拉错段落

发布于 2024-12-11 11:51:32 字数 914 浏览 0 评论 0原文

我使用 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>

I use AddThis to share my blog post. When I try to share my most recent post it pulls and displays the wrong paragraph on Facebook. I am unsure how to get it to pull the correct paragraph. Here is my AddThis code:

<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&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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ㄟ。诗瑗 2024-12-18 11:51:32

要解决此问题,您必须使用 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打开图谱主页

To solve this issue you must use OG Tags to tell Facebook what to use. Here is an example that solved my issue:

<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" />

More Info can be found on Facebook and the Open Graph Homepage

烟燃烟灭 2024-12-18 11:51:32

对我有用的方法

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

根据 Sol,使用 OpenGraph 元标记,然后使用 FB 调试器 验证 Facebook缓存已刷新并正确获取页面标题中的所有正确元标记,然后验证您的 AddThis 共享链接到 facebook 中是否没有查询字符串 UTM/变量。出于我的目的,Index.html 无法包含任何查询字符串变量,或者 AddThis 将 URL 错误地传递给了 Facebook。对我有用的唯一方法如下:

<a href="http://api.addthis.com/oexchange/0.8/forward/facebook/offer?pco=tbx32nj-1.0&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" alt="Facebook" /></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>

What Worked For Me

If you happen to be trying to use AddThis with UTM codes or other querystring variables, here's what finally worked for me.

As per Sol, use OpenGraph meta tags but then use the FB Debugger to verify that Facebook cache has been refreshed and got all the proper meta tags in the page header correctly, then verify that there are no querystring UTMs/variables your AddThis sharing link to facebook. For my purposes, Index.html couldn't include any querystring variables or AddThis passed the URL incorrectly to Facebook. The only way that worked for me looks like this:

<a href="http://api.addthis.com/oexchange/0.8/forward/facebook/offer?pco=tbx32nj-1.0&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" alt="Facebook" /></a>

What Failed For Me

When trying to use the below AddThis "data_track_addressbar" and "addthis_widget.js" modules for sharing, Facebook completely fail to pull the new OpenGraph Meta Tags.

<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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文